Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omDialog Class Reference
[GENERIC LIBRARY classes]

#include <omDialog.h>

Inheritance diagram for omDialog:

omObject

Public Member Functions

 omDialog (wxWindow *, wxString, wxString)
int ShowModal ()
 Override ShowModal method of wxDialog class.

bool IsButtonPressed ()
 Return true if a button was pressed.

int GetButtonPressed ()
 Return the code of the button pressed or -1 if no button was pressed.

bool Destroy ()
 Call wxDialog::Destroy().


Private Member Functions

void OnYesButton (wxCommandEvent &WXUNUSED(event))
 Yes Button handler.

void OnNoButton (wxCommandEvent &WXUNUSED(event))
 No Button handler.

void OnCancelButton (wxCommandEvent &WXUNUSED(event))
 Cancel Button handler.

void OnOkButton (wxCommandEvent &WXUNUSED(event))
 Ok Button handler.

void OnSaveButton (wxCommandEvent &WXUNUSED(event))
 No Button handler.


Private Attributes

bool isPressed
int buttonPressed

Detailed Description

OpenMAIA Dialog class.

This class provides an interface to wxDialog class to use with XRC resources file. The resource file containing the description of the dialog must be loaded before building omDialog class. The name of the dialog to load must be passed by the constructor of omDialog.
omDialog class handles buttons called:

When a button is pressed an internal flag stores the name of the button that was pressed. This name can be queried using GetButtonPressed() method of the class.

The following example shows how to use omDialog class. myresource.xrc contains the description of a dialog called dialog1 with yes and no buttons.

...

wxXmlResource::Get()->InitAllHandlers(); wxXmlResource::Get()->Load("myresource.xrc") ;

omDialog *myDialog = new omDialog(this, "Dialog title", "dialog1"); myDialog->ShowModal();

if (myDialog->ButtonPressed()) { int button = myDialog->GetButtonPressed(); switch(button) { case: omYES_BUTTON: // ... something break;

case: omNO_BUTTON: // ... something break; } }

...


Constructor & Destructor Documentation

omDialog::omDialog wxWindow *  parent,
wxString  title,
wxString  dialogName
 

Build omDialog class.

Parameters:
parent parent window of the dialog.
title Title of the dialg.
dialogName Name of the dialog in the loaded XRC file


Member Function Documentation

bool omDialog::Destroy  ) 
 

Call wxDialog::Destroy().

int omDialog::GetButtonPressed  ) 
 

Return the code of the button pressed or -1 if no button was pressed.

bool omDialog::IsButtonPressed  ) 
 

Return true if a button was pressed.

void omDialog::OnCancelButton wxCommandEvent &  WXUNUSED(event)  )  [private]
 

Cancel Button handler.

void omDialog::OnNoButton wxCommandEvent &  WXUNUSED(event)  )  [private]
 

No Button handler.

void omDialog::OnOkButton wxCommandEvent &  WXUNUSED(event)  )  [private]
 

Ok Button handler.

void omDialog::OnSaveButton wxCommandEvent &  WXUNUSED(event)  )  [private]
 

No Button handler.

void omDialog::OnYesButton wxCommandEvent &  WXUNUSED(event)  )  [private]
 

Yes Button handler.

int omDialog::ShowModal  ) 
 

Override ShowModal method of wxDialog class.


Field Documentation

int omDialog::buttonPressed [private]
 

bool omDialog::isPressed [private]
 


The documentation for this class was generated from the following files: