1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - 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
23 * A simple wrapper class for the SHBrowseForFolder API.
\r
24 * Help-Link: ms-help://MS.VSCC/MS.MSDNVS/shellcc/platform/Shell/Functions/SHBrowseForFolder.htm
\r
31 CANCEL = 0, ///< the user has pressed cancel
\r
32 NOPATH, ///< no folder was selected
\r
33 OK ///< everything went just fine
\r
36 //constructor / deconstructor
\r
37 CBrowseFolder(void);
\r
38 ~CBrowseFolder(void);
\r
40 DWORD m_style; ///< styles of the dialog.
\r
42 * Sets the info text of the dialog. Call this method before calling Show().
\r
44 void SetInfo(LPCTSTR title);
\r
46 * Sets the text to show for the checkbox. If this method is not called,
\r
47 * then no checkbox is added.
\r
49 void SetCheckBoxText(LPCTSTR checktext);
\r
50 void SetCheckBoxText2(LPCTSTR checktext);
\r
52 * Shows the Dialog.
\r
53 * \param parent [in] window handle of the parent window.
\r
54 * \param path [out] the path to the folder which the user has selected
\r
55 * \return one of CANCEL, NOPATH or OK
\r
57 CBrowseFolder::retVal Show(HWND parent, CString& path, const CString& sDefaultPath = CString());
\r
58 CBrowseFolder::retVal Show(HWND parent, LPTSTR path, size_t pathlen, LPCTSTR szDefaultPath = NULL);
\r
61 * If this is set to true, then the second checkbox gets disabled as soon as the first
\r
62 * checkbox is checked. If the first checkbox is unchecked, then the second checkbox is enabled
\r
65 void DisableCheckBox2WhenCheckbox1IsEnabled(bool bSet = true) {m_DisableCheckbox2WhenCheckbox1IsChecked = bSet;}
\r
67 static BOOL m_bCheck; ///< state of the checkbox on closing the dialog
\r
68 static BOOL m_bCheck2;
\r
71 static void SetFont(HWND hwnd,LPTSTR FontName,int FontSize);
\r
73 static int CALLBACK BrowseCallBackProc(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM lpData);
\r
74 static LRESULT APIENTRY CheckBoxSubclassProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
\r
75 static LRESULT APIENTRY CheckBoxSubclassProc2(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
\r
77 static WNDPROC CBProc;
\r
78 static HWND checkbox;
\r
79 static HWND checkbox2;
\r
80 static HWND ListView;
\r
81 static CString m_sDefaultPath;
\r
82 TCHAR m_displayName[200];
\r
83 LPITEMIDLIST m_root;
\r
84 static TCHAR m_CheckText[200];
\r
85 static TCHAR m_CheckText2[200];
\r
86 static bool m_DisableCheckbox2WhenCheckbox1IsChecked;
\r