1 // TortoiseMerge - a Diff/Patch program
\r
3 // Copyright (C) 2006-2007 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 #include "TortoiseMerge.h"
\r
21 #include "AboutDlg.h"
\r
22 //#include "svn_version.h"
\r
23 //#include "svn_diff.h"
\r
24 //#include "..\..\\apr\include\apr_version.h"
\r
25 //#include "..\..\apr-util\include\apu_version.h"
\r
26 #include "..\version.h"
\r
30 IMPLEMENT_DYNAMIC(CAboutDlg, CDialog)
\r
31 CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
\r
32 : CDialog(CAboutDlg::IDD, pParent)
\r
34 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
\r
37 CAboutDlg::~CAboutDlg()
\r
41 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
\r
43 CDialog::DoDataExchange(pDX);
\r
44 DDX_Control(pDX, IDC_WEBLINK, m_cWebLink);
\r
45 DDX_Control(pDX, IDC_SUPPORTLINK, m_cSupportLink);
\r
49 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
\r
51 ON_WM_QUERYDRAGICON()
\r
57 void CAboutDlg::OnPaint()
\r
61 CPaintDC dc(this); // device context for painting
\r
63 SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
\r
65 // Center icon in client rectangle
\r
66 int cxIcon = GetSystemMetrics(SM_CXICON);
\r
67 int cyIcon = GetSystemMetrics(SM_CYICON);
\r
69 GetClientRect(&rect);
\r
70 int x = (rect.Width() - cxIcon + 1) / 2;
\r
71 int y = (rect.Height() - cyIcon + 1) / 2;
\r
74 dc.DrawIcon(x, y, m_hIcon);
\r
82 // The system calls this function to obtain the cursor to display while the user drags
\r
83 // the minimized window.
\r
84 HCURSOR CAboutDlg::OnQueryDragIcon()
\r
86 return static_cast<HCURSOR>(m_hIcon);
\r
89 BOOL CAboutDlg::OnInitDialog()
\r
91 CDialog::OnInitDialog();
\r
92 // Set the icon for this dialog. The framework does this automatically
\r
93 // when the application's main window is not a dialog
\r
94 SetIcon(m_hIcon, TRUE); // Set big icon
\r
95 SetIcon(m_hIcon, FALSE); // Set small icon
\r
97 //set the version string
\r
98 CString temp, boxtitle;
\r
99 boxtitle.Format(IDS_ABOUTVERSIONBOX, TSVN_VERMAJOR, TSVN_VERMINOR, TSVN_VERMICRO, TSVN_VERBUILD, _T(TSVN_PLATFORM), _T(TSVN_VERDATE));
\r
100 SetDlgItemText(IDC_VERSIONBOX, boxtitle);
\r
101 const svn_version_t * diffver = svn_diff_version();
\r
102 temp.Format(IDS_ABOUTVERSION, TSVN_VERMAJOR, TSVN_VERMINOR, TSVN_VERMICRO, TSVN_VERBUILD, _T(TSVN_PLATFORM), _T(TSVN_VERDATE),
\r
103 diffver->major, diffver->minor, diffver->patch, CString(diffver->tag),
\r
104 APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION,
\r
105 APU_MAJOR_VERSION, APU_MINOR_VERSION, APU_PATCH_VERSION);
\r
106 SetDlgItemText(IDC_VERSIONABOUT, temp);
\r
107 this->SetWindowText(_T("TortoiseMerge"));
\r
109 CPictureHolder tmpPic;
\r
110 tmpPic.CreateFromBitmap(IDB_LOGOFLIPPED);
\r
111 m_renderSrc.Create32BitFromPicture(&tmpPic,468,64);
\r
112 m_renderDest.Create32BitFromPicture(&tmpPic,468,64);
\r
114 m_waterEffect.Create(468,64);
\r
115 SetTimer(ID_EFFECTTIMER, 40, NULL);
\r
116 SetTimer(ID_DROPTIMER, 300, NULL);
\r
118 m_cWebLink.SetURL(_T("http://tortoisesvn.net"));
\r
119 m_cSupportLink.SetURL(_T("http://tortoisesvn.tigris.org/contributors.html"));
\r
121 return TRUE; // return TRUE unless you set the focus to a control
\r
122 // EXCEPTION: OCX Property Pages should return FALSE
\r
125 void CAboutDlg::OnTimer(UINT_PTR nIDEvent)
\r
127 if (nIDEvent == ID_EFFECTTIMER)
\r
129 m_waterEffect.Render((DWORD*)m_renderSrc.GetDIBits(), (DWORD*)m_renderDest.GetDIBits());
\r
130 CClientDC dc(this);
\r
131 CPoint ptOrigin(15,20);
\r
132 m_renderDest.Draw(&dc,ptOrigin);
\r
134 if (nIDEvent == ID_DROPTIMER)
\r
139 r.right = r.left + m_renderSrc.GetWidth();
\r
140 r.bottom = r.top + m_renderSrc.GetHeight();
\r
141 m_waterEffect.Blob(random(r.left,r.right), random(r.top, r.bottom), 2, 400, m_waterEffect.m_iHpage);
\r
143 CDialog::OnTimer(nIDEvent);
\r
146 void CAboutDlg::OnMouseMove(UINT nFlags, CPoint point)
\r
151 r.right = r.left + m_renderSrc.GetWidth();
\r
152 r.bottom = r.top + m_renderSrc.GetHeight();
\r
154 if(r.PtInRect(point) == TRUE)
\r
156 // dibs are drawn upside down...
\r
158 point.y = 64-point.y;
\r
160 if (nFlags & MK_LBUTTON)
\r
161 m_waterEffect.Blob(point.x -15,point.y,5,1600,m_waterEffect.m_iHpage);
\r
163 m_waterEffect.Blob(point.x -15,point.y,2,50,m_waterEffect.m_iHpage);
\r
168 CDialog::OnMouseMove(nFlags, point);
\r