1 // TortoiseGitMerge - 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.
20 #include "TortoiseMerge.h"
22 #include "svn_version.h"
24 #include "..\..\apr\include\apr_version.h"
25 #include "..\..\apr-util\include\apu_version.h"
26 #include "..\version.h"
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
)
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("TortoiseGitMerge"));
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://code.google.com/p/tortoisegit/"));
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());
93 CPoint
ptOrigin(15,20);
94 m_renderDest
.Draw(&dc
,ptOrigin
);
96 if (nIDEvent
== ID_DROPTIMER
)
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
)
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...
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
);
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();