ALBA
|
#include <albaGUIDialog.h>
Public Member Functions | |
albaGUIDialog (const wxString &title, long style=albaCLOSEWINDOW|albaRESIZABLE|albaCLOSE) | |
virtual | ~albaGUIDialog () |
void | SetListener (albaObserver *Listener) |
void | OnEvent (albaEventBase *alba_event) |
void | Add (wxWindow *window, int option=0, int flag=wxEXPAND, int border=0) |
void | Add (albaGUI *window, int option=0, int flag=wxEXPAND, int border=0) |
void | Add (wxSizer *sizer, int option=0, int flag=wxEXPAND, int border=0) |
bool | Remove (wxWindow *window) |
bool | Remove (wxSizer *sizer) |
int | ShowModal () |
void | EnableOk (bool enable) |
void | EnableCancel (bool enable) |
void | EnableClose (bool enable) |
virtual void | WXSetInitialFittingClientSize (int flags, wxSizer *sizer=NULL) |
virtual void | OnOK (wxCommandEvent &event) |
virtual void | OnCancel (wxCommandEvent &event) |
virtual void | OnCloseWindow (wxCloseEvent &event) |
virtual void | OnSize (wxSizeEvent &event) |
Public Member Functions inherited from albaObserver | |
albaObserver () | |
virtual | ~albaObserver () |
virtual void | OnEvent (albaEventBase *e)=0 |
Public Attributes | |
wxBoxSizer * | m_GuiSizer |
wxBoxSizer * | m_ButtonsSizer |
wxBoxSizer * | m_DialogSizer |
wxButton * | m_OkButton |
wxButton * | m_CancelButton |
wxButton * | m_CloseButton |
albaObserver * | m_Listener |
albaGUIDialog is the base class for albaDialogs.
albaGUIDialog can be constructed on the Stack as well as on the Heap ex1: {albaGUIDialog dlg("foo"); dlg.ShowModal();} ex2: {albaGUIDialog* dlg = new albaGUIDialog("foo"); dlg->ShowModal(); cppDEL(dlg);}
depending on the flag passed as the "Style" parameter albaGUIDialog can be resizable or not, have a close button on the frame or nor, have an ok and/or cancel and/or close button.
The Close button have the same behaviour of the Button on the Dialog Frame, both of them call wxWindow::Close(), wich in turn call wx::CloseWindow(), – that you can redefine – the default for CloseWindow is to call OnCancel().
albaGUIDialog is meant do be "Modal", to create non-modal Dialogs use a wxFrame instead.
The Layout of the Dialog is managed using "Sizers", user widget or sizer can be added calling the "Add" member function.
It is possible to place a albaGUI on an albaGUIDialog (call Add). Normally a albaGUI send event to it's creator, but if you place an OkCancel button on the Gui, to be able to close the Dialog, then events from the Gui must go first to the Dialog. Example: -create GUI -Create Dialog -Dialog Add GUI -Gui SetListener Dialog -Dialog SetListener Me
Definition at line 75 of file albaGUIDialog.h.
albaGUIDialog::albaGUIDialog | ( | const wxString & | title, |
long | style = albaCLOSEWINDOW|albaRESIZABLE|albaCLOSE |
||
) |
|
virtual |
|
inline |
Definition at line 80 of file albaGUIDialog.h.
|
virtual |
process the events sent by subjects
Implements albaObserver.
Reimplemented in albaGUIDialogFindVme, albaGUIDialogLogin, albaGUIDialogProsthesisSelection, albaGUIDialogTransferFunction2D, and albaGUILutHistogramEditor.
Referenced by albaGUIDialogTransferFunction2D::OnCommand().
|
inline |
Add a widget to the dialog.
Definition at line 84 of file albaGUIDialog.h.
|
inline |
Add a albaGUI to the dialog.
TECH: this is to force the calling of the correct reparent, is not virtual in wxWindow
Definition at line 87 of file albaGUIDialog.h.
References albaGUI::FitGui(), and albaGUI::Reparent().
|
inline |
Add a sizer to the dialog.
Definition at line 90 of file albaGUIDialog.h.
|
inline |
Remove a widget from the dialog.
Definition at line 93 of file albaGUIDialog.h.
|
inline |
Remove a sizer from the dialog.
Definition at line 96 of file albaGUIDialog.h.
int albaGUIDialog::ShowModal | ( | ) |
|
inline |
Enable/Disable the default buttons – doesn't apply to user created buttons.
Definition at line 101 of file albaGUIDialog.h.
|
inline |
Definition at line 102 of file albaGUIDialog.h.
|
inline |
Definition at line 103 of file albaGUIDialog.h.
|
virtual |
|
virtual |
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event Table.
called when a ShowModal stage end with ok - in general is called by an 'OK' button –
|
virtual |
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event Table.
called when a ShowModal stage end with Cancel - in general is called by an 'Cancel' button –
|
virtual |
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event Table.
called when a ShowModal stage end with because the user press a 'Close' button or the CloseButton on the frame. The default behavior is to call OnCancel() - I recommend not to override this, but OnCancel
|
inlinevirtual |
Handle on size event.
Reimplemented in albaGUIDialogTransferFunction2D, and albaGUILutHistogramEditor.
Definition at line 124 of file albaGUIDialog.h.
wxBoxSizer* albaGUIDialog::m_GuiSizer |
Sizer for user widgets – Calling Add() insert a widget in this sizer.
Definition at line 126 of file albaGUIDialog.h.
wxBoxSizer* albaGUIDialog::m_ButtonsSizer |
Sizer holding the ok,cancel,close button (if any)
Definition at line 127 of file albaGUIDialog.h.
wxBoxSizer* albaGUIDialog::m_DialogSizer |
Dialog sizer – manage the Dialog initial Size, and the other sizers.
Definition at line 128 of file albaGUIDialog.h.
wxButton* albaGUIDialog::m_OkButton |
Button used to close the dialog with wxID_OK.
Definition at line 129 of file albaGUIDialog.h.
wxButton* albaGUIDialog::m_CancelButton |
Button used to close the dialog with wxID_CANCEL.
Definition at line 130 of file albaGUIDialog.h.
wxButton* albaGUIDialog::m_CloseButton |
Button used to close the dialog with wxID_CLOSE.
Definition at line 131 of file albaGUIDialog.h.
albaObserver* albaGUIDialog::m_Listener |
Definition at line 133 of file albaGUIDialog.h.
Referenced by albaGUILutHistogramEditor::GetListener().