Fixed issue #1507: Submodule Diff Dialog should show dirty state only on working...
[TortoiseGit.git] / src / TortoiseMerge / AboutDlg.cpp
blobb5e5384f545cd414dc128e9a14c3d1ca3073a90c
1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2006-2007, 2009-2010 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "stdafx.h"
20 #include "TortoiseMerge.h"
21 #include "AboutDlg.h"
22 #include "svn_version.h"
23 #include "svn_diff.h"
24 #include "..\..\\apr\include\apr_version.h"
25 #include "..\..\apr-util\include\apu_version.h"
26 #include "..\version.h"
28 // CAboutDlg dialog
30 IMPLEMENT_DYNAMIC(CAboutDlg, CStandAloneDialog)
31 CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
32 : CStandAloneDialog(CAboutDlg::IDD, pParent)
36 CAboutDlg::~CAboutDlg()
40 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
42 CStandAloneDialog::DoDataExchange(pDX);
43 DDX_Control(pDX, IDC_WEBLINK, m_cWebLink);
44 DDX_Control(pDX, IDC_SUPPORTLINK, m_cSupportLink);
48 BEGIN_MESSAGE_MAP(CAboutDlg, CStandAloneDialog)
49 ON_WM_TIMER()
50 ON_WM_MOUSEMOVE()
51 ON_WM_CLOSE()
52 END_MESSAGE_MAP()
55 BOOL CAboutDlg::OnInitDialog()
57 CStandAloneDialog::OnInitDialog();
59 //set the version string
60 CString temp, boxtitle;
61 boxtitle.Format(IDS_ABOUTVERSIONBOX, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD, _T(TGIT_PLATFORM), _T(TGIT_VERDATE));
62 SetDlgItemText(IDC_VERSIONBOX, boxtitle);
63 const svn_version_t * diffver = svn_diff_version();
64 temp.Format(IDS_ABOUTVERSION, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD, _T(TGIT_PLATFORM), _T(TGIT_VERDATE),
65 diffver->major, diffver->minor, diffver->patch, CString(diffver->tag),
66 APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION,
67 APU_MAJOR_VERSION, APU_MINOR_VERSION, APU_PATCH_VERSION);
68 SetDlgItemText(IDC_VERSIONABOUT, temp);
69 this->SetWindowText(_T("TortoiseMerge"));
71 CPictureHolder tmpPic;
72 tmpPic.CreateFromBitmap(IDB_LOGOFLIPPED);
73 m_renderSrc.Create32BitFromPicture(&tmpPic,468,64);
74 m_renderDest.Create32BitFromPicture(&tmpPic,468,64);
76 m_waterEffect.Create(468,64);
77 SetTimer(ID_EFFECTTIMER, 40, NULL);
78 SetTimer(ID_DROPTIMER, 300, NULL);
80 m_cWebLink.SetURL(_T("http://tortoisesvn.net"));
81 m_cSupportLink.SetURL(_T("http://tortoisesvn.tigris.org/contributors.html"));
83 return TRUE; // return TRUE unless you set the focus to a control
84 // EXCEPTION: OCX Property Pages should return FALSE
87 void CAboutDlg::OnTimer(UINT_PTR nIDEvent)
89 if (nIDEvent == ID_EFFECTTIMER)
91 m_waterEffect.Render((DWORD*)m_renderSrc.GetDIBits(), (DWORD*)m_renderDest.GetDIBits());
92 CClientDC dc(this);
93 CPoint ptOrigin(15,20);
94 m_renderDest.Draw(&dc,ptOrigin);
96 if (nIDEvent == ID_DROPTIMER)
98 CRect r;
99 r.left = 15;
100 r.top = 20;
101 r.right = r.left + m_renderSrc.GetWidth();
102 r.bottom = r.top + m_renderSrc.GetHeight();
103 m_waterEffect.Blob(random(r.left,r.right), random(r.top, r.bottom), 2, 400, m_waterEffect.m_iHpage);
105 CStandAloneDialog::OnTimer(nIDEvent);
108 void CAboutDlg::OnMouseMove(UINT nFlags, CPoint point)
110 CRect r;
111 r.left = 15;
112 r.top = 20;
113 r.right = r.left + m_renderSrc.GetWidth();
114 r.bottom = r.top + m_renderSrc.GetHeight();
116 if(r.PtInRect(point) == TRUE)
118 // dibs are drawn upside down...
119 point.y -= 20;
120 point.y = 64-point.y;
122 if (nFlags & MK_LBUTTON)
123 m_waterEffect.Blob(point.x -15,point.y,5,1600,m_waterEffect.m_iHpage);
124 else
125 m_waterEffect.Blob(point.x -15,point.y,2,50,m_waterEffect.m_iHpage);
129 CStandAloneDialog::OnMouseMove(nFlags, point);
132 void CAboutDlg::OnClose()
134 KillTimer(ID_EFFECTTIMER);
135 KillTimer(ID_DROPTIMER);
136 CStandAloneDialog::OnClose();