16#ifndef __albaGUIDialog_H__
17#define __albaGUIDialog_H__
25#include "albaServiceClient.h"
26#include "albaAbsLogicManager.h"
84 void Add(wxWindow* window,
int option = 0,
int flag = wxEXPAND,
int border = 0) {window->Reparent(
this); m_GuiSizer->Add(window,option,flag,border);};
87 void Add(
albaGUI* window,
int option = 0,
int flag = wxEXPAND,
int border = 0) {window->
Reparent(
this); window->
FitGui(); m_GuiSizer->Add(window,option,flag,border);};
90 void Add(wxSizer* sizer,
int option = 0,
int flag = wxEXPAND,
int border = 0) {m_GuiSizer->Add(sizer, option,flag,border);};
93 bool Remove(wxWindow* window) {
return m_GuiSizer->Detach(window);};
96 bool Remove(wxSizer* sizer ) {
return m_GuiSizer->Detach(sizer);};
101 void EnableOk(
bool enable) {
if(m_OkButton) m_OkButton->Enable(enable);};
102 void EnableCancel(
bool enable) {
if(m_CancelButton) m_CancelButton->Enable(enable);};
103 void EnableClose(
bool enable) {
if(m_CloseButton) m_CloseButton->Enable(enable);};
112 virtual void OnOK(wxCommandEvent &event);
124 virtual void OnSize(wxSizeEvent &event){DoLayout();};
137 void nvOnCloseWindow(wxCloseEvent &event) {OnCloseWindow(event);};
138 void nvOnOK(wxCommandEvent &event) {OnOK(event);};
139 void nvOnCancel(wxCommandEvent &event) {OnCancel(event);};
140 void nvOnClose(wxCommandEvent &event) {wxDialog::Close();};
142 bool m_DialogInitialized;
143 DECLARE_EVENT_TABLE()
Implementation of the message object for the Subject/Observer design pattern.
albaGUIDialog is the base class for albaDialogs.
wxBoxSizer * m_DialogSizer
Dialog sizer – manage the Dialog initial Size, and the other sizers.
void Add(albaGUI *window, int option=0, int flag=wxEXPAND, int border=0)
Add a albaGUI to the dialog.
virtual void OnCloseWindow(wxCloseEvent &event)
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event ...
bool Remove(wxSizer *sizer)
Remove a sizer from the dialog.
void EnableOk(bool enable)
Enable/Disable the default buttons – doesn't apply to user created buttons.
virtual void WXSetInitialFittingClientSize(int flags, wxSizer *sizer=NULL)
void SetListener(albaObserver *Listener)
bool Remove(wxWindow *window)
Remove a widget from the dialog.
virtual void OnCancel(wxCommandEvent &event)
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event ...
wxButton * m_CloseButton
Button used to close the dialog with wxID_CLOSE.
albaObserver * m_Listener
wxBoxSizer * m_GuiSizer
Sizer for user widgets – Calling Add() insert a widget in this sizer.
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
void Add(wxSizer *sizer, int option=0, int flag=wxEXPAND, int border=0)
Add a sizer to the dialog.
albaGUIDialog(const wxString &title, long style=albaCLOSEWINDOW|albaRESIZABLE|albaCLOSE)
void Add(wxWindow *window, int option=0, int flag=wxEXPAND, int border=0)
Add a widget to the dialog.
void EnableCancel(bool enable)
wxButton * m_OkButton
Button used to close the dialog with wxID_OK.
virtual void OnSize(wxSizeEvent &event)
Handle on size event.
virtual void OnOK(wxCommandEvent &event)
Virtual functions called to terminate ShowModal - these can be redefined without providing the Event ...
wxBoxSizer * m_ButtonsSizer
Sizer holding the ok,cancel,close button (if any)
wxButton * m_CancelButton
Button used to close the dialog with wxID_CANCEL.
void EnableClose(bool enable)
albaGUI is a panel with function to easily create GUI.
void FitGui()
Recalculate 'this' Gui Size and MinSize considering the space required by the children widgets.
void Reparent(wxWindow *parent)
place the GUI on a different parent, and perform the required Resize/Stretch/ and Show
Interface implementing the Observer of the Subject/Observer design pattern.