Custom dialogs
The Dialog
class handles a set of controls, which are added to the dialog by the AddControl
method. For a subclass of the Dialog
class, refer to PageSetupDialog
in the last section of this chapter. The Dialog class provides a modal dialog, which means that all other windows in the application become disabled until the dialog is closed.
The user may navigate between controls with the Tab key and between radio buttons in the same group with the arrow keys. They can also use mnemonics to access controls.
Dialog.h
namespace SmallWindows {
The dialogMap
field is used by DialogProc
to look up the dialog receiving the messages:
extern map<HWND,Dialog*> dialogMap; extern Font DialogFont;
The Dialog
class is a subclass of Window
even though it calls the default Window
constructor, which does not call the Win32 API function CreateWindowEx
. Instead, DoModal
collects information about the dialog and its controls and calls the Win32 API function DialogBoxIndirectParam
:
...