Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

W32DLib::Dialog Class Reference

The base Dialog class. More...

#include <w32dlib/dialog.h>

Inheritance diagram for W32DLib::Dialog:

W32DLib::Window List of all members.

Public Member Functions

 Dialog ()
 Constructor.
virtual ~Dialog ()
 Destructor.
virtual int ResourceID ()=0
 Returns the Resource ID for the dialog.
virtual void OnInit ()
 Called when the dialog is displaying.
virtual void OnClose ()
 Called when the dialog is closing.
void Enable (bool enable)
 Enables or disables all Controls in the dialog.
INT_PTR ShowModal (HINSTANCE instance, HWND parent)
 Displays a modal dialog.
void Close (INT_PTR result)
 Closes the dialog.
void AddControl (Control *control)
 Adds a control to the dialog.
void SetMenuProc (Window *owner, W32DLibCallback callback)
 Sets a callback for handling menu commands.
void SetData ()
 Request data exchange with all controls.
void GetData ()
 Request data exchange with all controls.

Protected Member Functions

virtual BOOL InstanceProc (HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
 Handles windows messages.

Detailed Description

The base Dialog class.


Constructor & Destructor Documentation

W32DLib::Dialog::Dialog  ) 
 

Constructor.

virtual W32DLib::Dialog::~Dialog  )  [virtual]
 

Destructor.


Member Function Documentation

void W32DLib::Dialog::AddControl Control control  ) 
 

Adds a control to the dialog.

Note that the pointer to the control is stored, so the control must exist as long as the dialog is in use.

Parameters:
control The control the add.

void W32DLib::Dialog::Close INT_PTR  result  ) 
 

Closes the dialog.

Closes the dialog. Silently ignored if the dialog is not open.

Parameters:
result The result to return.
See also:
ShowModal()

void W32DLib::Dialog::Enable bool  enable  ) 
 

Enables or disables all Controls in the dialog.

Overrides Window::Enable.

Reimplemented from W32DLib::Window.

void W32DLib::Dialog::GetData  ) 
 

Request data exchange with all controls.

Values will be stored in the DataX objects registered with the controls.

This shouldn't be called any earlier than when OnInit() is invoked.

virtual BOOL W32DLib::Dialog::InstanceProc HWND  wnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp
[protected, virtual]
 

Handles windows messages.

Parameters:
wnd The window handle
msg The message
wp Additional parameters. Depends on the value of msg.
lp Additional parameters. Depends on the value of msg.
Returns:
TRUE if the message has been handled.
See also:
Window::InstanceProc

Reimplemented from W32DLib::Window.

virtual void W32DLib::Dialog::OnClose  )  [virtual]
 

Called when the dialog is closing.

Override this call to pick up this event.

virtual void W32DLib::Dialog::OnInit  )  [virtual]
 

Called when the dialog is displaying.

Override this call to initialise dialog controls.

virtual int W32DLib::Dialog::ResourceID  )  [pure virtual]
 

Returns the Resource ID for the dialog.

All derived classes must implement this. This should return the ID of the dialog in the resource file.

void W32DLib::Dialog::SetData  ) 
 

Request data exchange with all controls.

Values will be set from DataX objects registered with the controls.

This shouldn't be called any earlier than when OnInit() is invoked.

void W32DLib::Dialog::SetMenuProc Window owner,
W32DLibCallback  callback
 

Sets a callback for handling menu commands.

This call simply passes on all WM_COMMAND messages that were not for any registered control's resource ID.

Due to this, the callback should take care to ensure it only actions recognised menu commands.

Parameters:
owner The class (generally a Dialog derived one) in which the callback resides. The class must be derived from Window.
callback The callback.

INT_PTR W32DLib::Dialog::ShowModal HINSTANCE  instance,
HWND  parent
 

Displays a modal dialog.

Call this to display the dialog.

Parameters:
instance The HINSTANCE. Call Common::GetInstance() to get an instance (from a DLL, for example) if all else fails.
parent The parent window of the dialog (NULL for none).
Returns:
The result from Close().
See also:
Close()

Common::GetInstance()


The documentation for this class was generated from the following file:
Generated on Fri May 6 01:22:33 2005 for W32DLib by  doxygen 1.4.1