ciderpress/app/ChooseDirDialog.h
Andy McFadden d8223dbcfd Relocate method comments
This moves method comments from the .cpp file to the .h file,
where users of the methods can find them.  This also makes it
possible for the IDE to show the comments when you mouse-hover over
the method name, though Visual Studio is a bit weak in this regard.

Also, added "override" keywords on overridden methods.  Reasonably
current versions of popular compilers seem to support this.

Also, don't have the return type on a separate line in the .cpp file.
The motivation for the practice -- quickly finding a method definition
with "^name" -- is less useful in C++ than C, and modern IDEs provide
more convenient ways to do the same thing.

Also, do some more conversion from unsigned types to uintXX_t.

This commit is primarily for the "app" directory.
2014-11-21 22:33:39 -08:00

69 lines
1.9 KiB
C++

/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* Dialog for choosing a directory.
*/
#ifndef APP_CHOOSEDIRDIALOG
#define APP_CHOOSEDIRDIALOG
#include "../util/UtilLib.h"
#include "resource.h"
/*
* Choose a directory. This is distinctly different from what the standard
* "Open" and "Save As" dialogs do, because those want to choose normal files
* only, while this wants to select a folder.
*/
class ChooseDirDialog : public CDialog {
public:
ChooseDirDialog(CWnd* pParent = NULL, int dialogID = IDD_CHOOSEDIR) :
CDialog(dialogID, pParent)
{
fPathName = L"";
}
virtual ~ChooseDirDialog(void) {}
const WCHAR* GetPathName(void) const { return fPathName; }
// set the pathname; when DoModal is called this will tunnel in
void SetPathName(const WCHAR* str) { fPathName = str; }
protected:
virtual BOOL OnInitDialog(void) override;
// Special handling for "return" key.
virtual BOOL PreTranslateMessage(MSG* pMsg) override;
/*
* Replace the ShellTree's default SELCHANGED handler with this so we can
* track changes to the edit control.
*/
afx_msg void OnSelChanged(NMHDR* pnmh, LRESULT* pResult);
// F1 key hit, or '?' button in title bar used to select help for an
// item in the dialog. For ON_WM_HELPINFO.
afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo);
// User pressed "Expand Tree" button.
afx_msg void OnExpandTree(void);
// User pressed "New Folder" button.
afx_msg void OnNewFolder(void);
// User pressed "Help" button.
afx_msg void OnHelp(void);
private:
CString fPathName;
ShellTree fShellTree;
MyBitmapButton fNewFolderButton;
DECLARE_MESSAGE_MAP()
};
#endif /*APP_CHOOSEDIRDIALOG*/