Show selected refs in list ctrl
[TortoiseGit.git] / src / TortoiseProc / AboutDlg.cpp
blob49436a402809b912a44a49bfa3048598478aa55a
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - 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 "stdafx.h"
21 #include "TortoiseProc.h"
22 #include "AboutDlg.h"
23 //#include "svn_version.h"
24 #include "..\version.h"
25 //#include "AppUtils.h"
27 //IMPLEMENT_DYNAMIC(CAboutDlg, CStandAloneDialog)
28 CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
29 : CStandAloneDialog(CAboutDlg::IDD, pParent)
33 CAboutDlg::~CAboutDlg()
37 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
39 CStandAloneDialog::DoDataExchange(pDX);
40 DDX_Control(pDX, IDC_WEBLINK, m_cWebLink);
41 DDX_Control(pDX, IDC_SUPPORTLINK, m_cSupportLink);
44 BEGIN_MESSAGE_MAP(CAboutDlg, CStandAloneDialog)
45 ON_WM_TIMER()
46 ON_WM_MOUSEMOVE()
47 ON_BN_CLICKED(IDC_UPDATE, OnBnClickedUpdate)
48 END_MESSAGE_MAP()
50 BOOL CAboutDlg::OnInitDialog()
52 CStandAloneDialog::OnInitDialog();
54 // set the version string
55 CString temp;
57 #if 0
58 const svn_version_t * svnver = svn_client_version();
60 temp.Format(IDS_ABOUTVERSION, TSVN_VERMAJOR, TSVN_VERMINOR, TSVN_VERMICRO, TSVN_VERBUILD, _T(TSVN_PLATFORM), _T(TSVN_VERDATE),
61 svnver->major, svnver->minor, svnver->patch, CString(svnver->tag),
62 APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION,
63 APU_MAJOR_VERSION, APU_MINOR_VERSION, APU_PATCH_VERSION,
64 _T(NEON_VERSION),
65 _T(OPENSSL_VERSION_TEXT),
66 _T(ZLIB_VERSION));
67 SetDlgItemText(IDC_VERSIONABOUT, temp);
68 #endif
69 this->SetWindowText(_T("TortoiseGit"));
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, 1500, NULL);
80 m_cWebLink.SetURL(_T("http://code.google.com/p/tortoisegit/"));
81 m_cSupportLink.SetURL(_T("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GJGTG75GV5PL6&lc=C2&item_name=TortoiseGit&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"));
83 CenterWindow(CWnd::FromHandle(hWndExplorer));
84 GetDlgItem(IDOK)->SetFocus();
85 return FALSE;
88 void CAboutDlg::OnTimer(UINT_PTR nIDEvent)
90 if (nIDEvent == ID_EFFECTTIMER)
92 m_waterEffect.Render((DWORD*)m_renderSrc.GetDIBits(), (DWORD*)m_renderDest.GetDIBits());
93 CClientDC dc(this);
94 CPoint ptOrigin(15,20);
95 m_renderDest.Draw(&dc,ptOrigin);
97 if (nIDEvent == ID_DROPTIMER)
99 CRect r;
100 r.left = 15;
101 r.top = 20;
102 r.right = r.left + m_renderSrc.GetWidth();
103 r.bottom = r.top + m_renderSrc.GetHeight();
104 m_waterEffect.Blob(random(r.left,r.right), random(r.top, r.bottom), 5, 800, m_waterEffect.m_iHpage);
106 CStandAloneDialog::OnTimer(nIDEvent);
109 void CAboutDlg::OnMouseMove(UINT nFlags, CPoint point)
111 CRect r;
112 r.left = 15;
113 r.top = 20;
114 r.right = r.left + m_renderSrc.GetWidth();
115 r.bottom = r.top + m_renderSrc.GetHeight();
117 if(r.PtInRect(point) == TRUE)
119 // dibs are drawn upside down...
120 point.y -= 20;
121 point.y = 64-point.y;
123 if (nFlags & MK_LBUTTON)
124 m_waterEffect.Blob(point.x -15,point.y,10,1600,m_waterEffect.m_iHpage);
125 else
126 m_waterEffect.Blob(point.x -15,point.y,5,50,m_waterEffect.m_iHpage);
131 CStandAloneDialog::OnMouseMove(nFlags, point);
134 void CAboutDlg::OnBnClickedUpdate()
136 TCHAR com[MAX_PATH+100];
137 GetModuleFileName(NULL, com, MAX_PATH);
138 _tcscat_s(com, MAX_PATH+100, _T(" /command:updatecheck /visible"));
140 // CAppUtils::LaunchApplication(com, 0, false);