MGUI::DLG_BASE Class Reference

#include <mgui/dlgbase.h>

Inheritance diagram for MGUI::DLG_BASE:

Inheritance graph
[legend]
List of all members.

Public Types

enum  BUTTONS {
  BUTTONS_Default = 0x00, BUTTON_OK = 0x01, BUTTON_Cancel = 0x02, BUTTON_Apply = 0x04,
  BUTTON_Close = 0x08, BUTTON_Help = 0x10
}
enum  STYLE {
  STYLE_Default = 0x00, STYLE_Resizable = 0x01, STYLE_ContextHelp = 0x02, STYLE_AllowMinimize = 0x04,
  STYLE_AllowMaximize = 0x08, STYLE_CenterOnScreen = 0x10, STYLE_CenterOnMouse = 0x20, STYLE_DeleteOnClose = 0x40
}

Public Member Functions

void Close (bool notify=true)
ERRVALUE CreateModeless (MDLGPARENT dlgparent, bool AllowMinimize=false)
ERRVALUE DoModal (MDLGPARENT dlgparent)
MDLGPARENT GetDlgParent () const
void GetWindowPlacement (WINDOWPLACEMENT &placement) const
bool IsCreated () const
bool IsOpen () const
virtual void OnApply ()
virtual void OnCancel ()
virtual void OnClose ()
virtual void OnDestroy ()
virtual void OnOK ()
virtual void OnOpen ()
ERRVALUE Open ()
 operator MDLGPARENT () const
void SetApplyEnabled (bool enabled=true)
void SetOkEnabled (bool enabled=true)
void SetTitle (TEXTID textid)
void SetTitle (const UNICODE *title)
bool SetWindowPlacement (const WINDOWPLACEMENT &placement)
virtual ~DLG_BASE ()=0

Protected Member Functions

MGUI::CTRL_PUSHBUTTONCreateButton (BUTTONS button, const char *label=0)
void CreateButtons (BUTTONS buttons=BUTTONS_Default)
 DLG_BASE (STYLE style=STYLE_Default)
MGUI::LAYOUT_PANEGetButtonPane ()
MGUI::COMMAND_ROUTERGetCmdRouter () const
virtual const char * GetDialogHelpID () const
virtual const char * GetDialogName () const =0
MGUI::LAYOUT_PANE_MAINGetMainPane ()
virtual ERRVALUE OnInitDialog ()=0
void SetIgnoreNonVisible (bool IgnoreNonVisible=true)
void SetReturnValue (int RetValue)
void SetRootSpacing (int RootSpacing)
void SetStatusBar (MGUI::CTRL_STATUSBAR &StatusBar)
void SetStatusBar (CStatusBar *StatusBar)
void SetStyle (STYLE style)
void UpdateLayout ()

Detailed Description

Deprecated:
Replaced with MGUI::DLGSHELL Base class for general dialog support for both modeless and modal behavior.
This class is available for both X and MFC with a nearly identical public and protected interfaces. There are a few platform-specific methods for use by the actual dialog implementation. The derived dialog implementation class must override the GetDialogName() and OnInitDialog() methods. Most derived classes will also override the OnApply to perform the desired update of the external data when the user presses 'OK' or 'Apply'. When overriding the On...() virtual methods pay close attention to when (or whether) the corresponding base method is to be called to ensure correct behavior.

Definition at line 110 of file dlgbase.h.


Member Enumeration Documentation

enum MGUI::DLG_BASE::BUTTONS
 

Standard dialog button selections, may be combined for some methods.

Enumeration values:
BUTTONS_Default  Default buttons per dialog style.
BUTTON_OK 
BUTTON_Cancel 
BUTTON_Apply 
BUTTON_Close 
BUTTON_Help 

Definition at line 126 of file dlgbase.h.

enum MGUI::DLG_BASE::STYLE
 

Style settings, may be combined.

Enumeration values:
STYLE_Default  Default style.
STYLE_Resizable  Dialog is resizable.
STYLE_ContextHelp  (Non-X) Include '?' icon in titlebar, cannot combine with AllowMinimize or AllowMaximize
STYLE_AllowMinimize  (Non-X) Include minimize box in titlebar, cannot combine with STYLE_ContextHelp
STYLE_AllowMaximize  (Non-X) Include maximize box in titlebar, cannot combine with STYLE_ContextHelp
STYLE_CenterOnScreen  Initially center dialog on monitor containing parent window.
STYLE_CenterOnMouse  Initially center dialog on mouse cursor.
STYLE_DeleteOnClose  Delete (destroy) dialog on closing, only used for modeless dialogs.

Definition at line 114 of file dlgbase.h.


Constructor & Destructor Documentation

virtual MGUI::DLG_BASE::~DLG_BASE  )  [pure virtual]
 

Destructor.

MGUI::DLG_BASE::DLG_BASE STYLE  style = STYLE_Default  )  [protected]
 

Default constructor, initializes only.

Parameters:
style  Dialog style settings


Member Function Documentation

void MGUI::DLG_BASE::Close bool  notify = true  ) 
 

Close the dialog if modeless.

Parameters:
notify  Notify via OnClose()

MGUI::CTRL_PUSHBUTTON& MGUI::DLG_BASE::CreateButton BUTTONS  button,
const char *  label = 0
[protected]
 

Create standard button.

Returns:
Reference to button created (usually for alignment only).
Parameters:
button  Button to create
label  Override for label, used for resource lookup

void MGUI::DLG_BASE::CreateButtons BUTTONS  buttons = BUTTONS_Default  )  [protected]
 

Create standard buttons at bottom of dialog.

Default button labels will depend on the dialog style. Modal dialog buttons will be 'OK', 'Cancel' and 'Help'. Modeless dialog buttons will be 'OK', 'Cancel', 'Apply' and 'Help'. For modeless dialogs, pressing 'OK' has the same effect as pressing 'Apply' followed by 'Close'.

Parameters:
buttons  Buttons to create

ERRVALUE MGUI::DLG_BASE::CreateModeless MDLGPARENT  dlgparent,
bool  AllowMinimize = false
 

Create 'modeless' dialog (without opening it).

Parameters:
dlgparent  Parent for dialog
AllowMinimize  (Non-X) Allow dialog to be "minimized"

ERRVALUE MGUI::DLG_BASE::DoModal MDLGPARENT  dlgparent  ) 
 

Open dialog in modal state and wait for user to dismiss via OK/Cancel.

Returns:
0 if OK, EUserCancel if Cancel, < 0 if error
Parameters:
dlgparent  Parent for modal dialog

MGUI::LAYOUT_PANE& MGUI::DLG_BASE::GetButtonPane  )  [protected]
 

Get pane to create buttons at bottom of dialog.

This allows additional 'non-standard' buttons to be added to the dialog. This will create the pane if it has not been created already.

MGUI::COMMAND_ROUTER* MGUI::DLG_BASE::GetCmdRouter  )  const [inline, protected]
 

Get "command router" for dialog.

Definition at line 286 of file dlgbase.h.

virtual const char* MGUI::DLG_BASE::GetDialogHelpID  )  const [protected, virtual]
 

Get dialog HelpID.

Returns:
String for HelpID.

virtual const char* MGUI::DLG_BASE::GetDialogName  )  const [protected, pure virtual]
 

Get dialog name for title resource.

Returns:
String for title resource lookup.

MDLGPARENT MGUI::DLG_BASE::GetDlgParent  )  const
 

Get MDLGPARENT for use as parent for child dialogs.

MGUI::LAYOUT_PANE_MAIN& MGUI::DLG_BASE::GetMainPane  )  [protected]
 

Get main layout pane.

void MGUI::DLG_BASE::GetWindowPlacement WINDOWPLACEMENT &  placement  )  const
 

Get current window placement (MFC only).

bool MGUI::DLG_BASE::IsCreated  )  const [inline]
 

Determine if dialog window has been created.

Definition at line 172 of file dlgbase.h.

bool MGUI::DLG_BASE::IsOpen  )  const
 

Determine if dialog is currently open.

virtual void MGUI::DLG_BASE::OnApply  )  [virtual]
 

Called when user presses 'Apply' button.

Will also be called when 'OK' button is pressed UNLESS 'Apply' button exists AND is disabled. Derived class must call base class OnApply() method BEFORE performing its own processing.

Reimplemented in MGUI::DLG_XML.

virtual void MGUI::DLG_BASE::OnCancel  )  [virtual]
 

Called when 'Cancel' button is pressed.

Derived class must call base class OnCancel() method AFTER performing its own processing to properly close the dialog. In some cases the user may be given an opportunity to verify that they intended to press the Cancel button. If they elect not to cancel then the base class OnCancel() method should not be called. This will cause the dialog to remain open and allow the user to retain the settings.

Reimplemented in MGUI::DLG_XML.

virtual void MGUI::DLG_BASE::OnClose  )  [virtual]
 

Called when dialog is closed.

Derived class must call base class OnClose() method AFTER performing its own processing to properly close the dialog.

Reimplemented in MGUI::DLG_XML.

virtual void MGUI::DLG_BASE::OnDestroy  )  [virtual]
 

Called when dialog is destroyed.

Reimplemented in MGUI::DLG_XML.

virtual ERRVALUE MGUI::DLG_BASE::OnInitDialog  )  [protected, pure virtual]
 

Create dialog contents.

Derived class MUST implement this. Function must return 0 for success or an error code. This will be called by the dialog creation code and thus should not be called directly. This is normally overridden only by the specific dialog implementation and not by the code that actually uses that dialog implementation. The implementation should call GetMainForm() or GetMainPane() to determine the form widget or pane to create the controls in.

Implemented in MGUI::DLG_XML.

virtual void MGUI::DLG_BASE::OnOK  )  [virtual]
 

Called when 'OK' button is pressed.

Derived class must call base class OnOK() method AFTER performing its own processing to properly close the dialog. If the dialog settings do not pass their associated validation test then an appropriate message should be displayed for the user and the base class OnOK() method should not be called. This will cause the dialog to remain open and allow the user to correct the settings.

Reimplemented in MGUI::DLG_XML.

virtual void MGUI::DLG_BASE::OnOpen  )  [virtual]
 

Called when dialog is opened after the dialog is actually "managed" and displayed.

Derived class must call base class OnOpen() method BEFORE performing its own processing.

Reimplemented in MGUI::DLG_XML.

ERRVALUE MGUI::DLG_BASE::Open  ) 
 

Open dialog if created in modeless state.

MGUI::DLG_BASE::operator MDLGPARENT  )  const [inline]
 

Cast to MDLGPARENT for use as parent for other dialogs.

Definition at line 140 of file dlgbase.h.

void MGUI::DLG_BASE::SetApplyEnabled bool  enabled = true  )  [inline]
 

Set whether 'Apply' (if exists) button is enabled.

Definition at line 229 of file dlgbase.h.

void MGUI::DLG_BASE::SetIgnoreNonVisible bool  IgnoreNonVisible = true  )  [inline, protected]
 

Set to ignore nonvisible items when doing layout.

This must be called before CreateModeless() or DoModal() and is usually done in the subclass constructor.

Definition at line 320 of file dlgbase.h.

void MGUI::DLG_BASE::SetOkEnabled bool  enabled = true  )  [inline]
 

Set whether 'OK' button (if exists) is enabled.

Definition at line 234 of file dlgbase.h.

void MGUI::DLG_BASE::SetReturnValue int  RetValue  )  [inline, protected]
 

Set value to return from dialog.

Definition at line 325 of file dlgbase.h.

void MGUI::DLG_BASE::SetRootSpacing int  RootSpacing  )  [inline, protected]
 

Set spacing for root pane.

This must be called before CreateModeless() or DoModal() and is usually done in the subclass constructor.

Definition at line 332 of file dlgbase.h.

void MGUI::DLG_BASE::SetStatusBar MGUI::CTRL_STATUSBAR StatusBar  )  [inline, protected]
 

Set status bar so dialog allows for in layout (MFC only).

StatusBar must be created before OnInitDialog() returns.

Definition at line 347 of file dlgbase.h.

void MGUI::DLG_BASE::SetStatusBar CStatusBar *  StatusBar  )  [inline, protected]
 

Set status bar so dialog allows for in layout (MFC only).

StatusBar must be created before OnInitDialog() returns.

Parameters:
StatusBar  Pointer to status bar

Definition at line 339 of file dlgbase.h.

void MGUI::DLG_BASE::SetStyle STYLE  style  )  [inline, protected]
 

Set dialog style.

This must be called before CreateModeless() or DoModal() and not in OnInitDialog() for proper behavior.

Definition at line 355 of file dlgbase.h.

void MGUI::DLG_BASE::SetTitle TEXTID  textid  ) 
 

Set dialog title from TEXTID.

void MGUI::DLG_BASE::SetTitle const UNICODE title  ) 
 

Set dialog title from UNICODE string.

bool MGUI::DLG_BASE::SetWindowPlacement const WINDOWPLACEMENT &  placement  ) 
 

Set window placement (MFC only).

void MGUI::DLG_BASE::UpdateLayout  )  [inline, protected]
 

Force update of dialog layout.

Definition at line 360 of file dlgbase.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:48 2004 for TNTsdk by  doxygen 1.3.8-20040913