#include <omDialog.h>
Inheritance diagram for omDialog:
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 |
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
|
Build omDialog class.
|
|
Call wxDialog::Destroy().
|
|
Return the code of the button pressed or -1 if no button was pressed.
|
|
Return true if a button was pressed.
|
|
Cancel Button handler.
|
|
No Button handler.
|
|
Ok Button handler.
|
|
No Button handler.
|
|
Yes Button handler.
|
|
Override ShowModal method of wxDialog class.
|
|
|
|
|
Copyright © by Luca Clivio |