ALBA
Public Member Functions | Public Attributes | List of all members
albaGUIDialog Class Reference

#include <albaGUIDialog.h>

Inheritance diagram for albaGUIDialog:
Inheritance graph
[legend]
Collaboration diagram for albaGUIDialog:
Collaboration graph
[legend]

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
 
albaObserverm_Listener
 

Detailed Description

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

See also
albaGUIDialogPreview

Definition at line 75 of file albaGUIDialog.h.

Constructor & Destructor Documentation

◆ albaGUIDialog()

albaGUIDialog::albaGUIDialog ( const wxString &  title,
long  style = albaCLOSEWINDOW|albaRESIZABLE|albaCLOSE 
)

◆ ~albaGUIDialog()

virtual albaGUIDialog::~albaGUIDialog ( )
virtual

Member Function Documentation

◆ SetListener()

void albaGUIDialog::SetListener ( albaObserver Listener)
inline

Definition at line 80 of file albaGUIDialog.h.

◆ OnEvent()

void albaGUIDialog::OnEvent ( albaEventBase e)
virtual

◆ Add() [1/3]

void albaGUIDialog::Add ( wxWindow *  window,
int  option = 0,
int  flag = wxEXPAND,
int  border = 0 
)
inline

Add a widget to the dialog.

Definition at line 84 of file albaGUIDialog.h.

◆ Add() [2/3]

void albaGUIDialog::Add ( albaGUI window,
int  option = 0,
int  flag = wxEXPAND,
int  border = 0 
)
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().

Here is the call graph for this function:

◆ Add() [3/3]

void albaGUIDialog::Add ( wxSizer *  sizer,
int  option = 0,
int  flag = wxEXPAND,
int  border = 0 
)
inline

Add a sizer to the dialog.

Definition at line 90 of file albaGUIDialog.h.

◆ Remove() [1/2]

bool albaGUIDialog::Remove ( wxWindow *  window)
inline

Remove a widget from the dialog.

Definition at line 93 of file albaGUIDialog.h.

◆ Remove() [2/2]

bool albaGUIDialog::Remove ( wxSizer *  sizer)
inline

Remove a sizer from the dialog.

Definition at line 96 of file albaGUIDialog.h.

◆ ShowModal()

int albaGUIDialog::ShowModal ( )

◆ EnableOk()

void albaGUIDialog::EnableOk ( bool  enable)
inline

Enable/Disable the default buttons – doesn't apply to user created buttons.

Definition at line 101 of file albaGUIDialog.h.

◆ EnableCancel()

void albaGUIDialog::EnableCancel ( bool  enable)
inline

Definition at line 102 of file albaGUIDialog.h.

◆ EnableClose()

void albaGUIDialog::EnableClose ( bool  enable)
inline

Definition at line 103 of file albaGUIDialog.h.

◆ WXSetInitialFittingClientSize()

virtual void albaGUIDialog::WXSetInitialFittingClientSize ( int  flags,
wxSizer *  sizer = NULL 
)
virtual

◆ OnOK()

virtual void albaGUIDialog::OnOK ( wxCommandEvent &  event)
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 –

◆ OnCancel()

virtual void albaGUIDialog::OnCancel ( wxCommandEvent &  event)
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 –

◆ OnCloseWindow()

virtual void albaGUIDialog::OnCloseWindow ( wxCloseEvent &  event)
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

◆ OnSize()

virtual void albaGUIDialog::OnSize ( wxSizeEvent &  event)
inlinevirtual

Handle on size event.

Reimplemented in albaGUIDialogTransferFunction2D, and albaGUILutHistogramEditor.

Definition at line 124 of file albaGUIDialog.h.

Member Data Documentation

◆ m_GuiSizer

wxBoxSizer* albaGUIDialog::m_GuiSizer

Sizer for user widgets – Calling Add() insert a widget in this sizer.

Definition at line 126 of file albaGUIDialog.h.

◆ m_ButtonsSizer

wxBoxSizer* albaGUIDialog::m_ButtonsSizer

Sizer holding the ok,cancel,close button (if any)

Definition at line 127 of file albaGUIDialog.h.

◆ m_DialogSizer

wxBoxSizer* albaGUIDialog::m_DialogSizer

Dialog sizer – manage the Dialog initial Size, and the other sizers.

Definition at line 128 of file albaGUIDialog.h.

◆ m_OkButton

wxButton* albaGUIDialog::m_OkButton

Button used to close the dialog with wxID_OK.

Definition at line 129 of file albaGUIDialog.h.

◆ m_CancelButton

wxButton* albaGUIDialog::m_CancelButton

Button used to close the dialog with wxID_CANCEL.

Definition at line 130 of file albaGUIDialog.h.

◆ m_CloseButton

wxButton* albaGUIDialog::m_CloseButton

Button used to close the dialog with wxID_CLOSE.

Definition at line 131 of file albaGUIDialog.h.

◆ m_Listener

albaObserver* albaGUIDialog::m_Listener

Definition at line 133 of file albaGUIDialog.h.

Referenced by albaGUILutHistogramEditor::GetListener().


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