ALBA
albaGUIButton.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIButton
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaGUIButton_H__
17#define __albaGUIButton_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include "albaEvent.h"
22#include "albaObserver.h"
23//----------------------------------------------------------------------------
24// albaGUIButton :
33//----------------------------------------------------------------------------
34class ALBA_EXPORT albaGUIButton : public wxButton
35{
36
37public:
38 albaGUIButton(wxWindow* parent, wxWindowID id, const wxString& label,
39 const wxPoint& pos, const wxSize& size = wxDefaultSize, long style = 0);
40
41 albaGUIButton(wxWindow *parent, wxWindowID id = 0 );
42
44 void SetListener (albaObserver *listener) {m_Listener = listener;};
45
46protected:
47
49 virtual void Command(wxCommandEvent& event);
50
52 void OnSetFocus(wxFocusEvent& event) {};
53
54 int m_Id;
56
57 DECLARE_EVENT_TABLE()
58};
59#endif // __albaGUIButton_H__
albaGUIButton inherit from wxButton.
Definition: albaGUIButton.h:35
void SetListener(albaObserver *listener)
Set the Listener that will receive event-notification.
Definition: albaGUIButton.h:44
albaObserver * m_Listener
Definition: albaGUIButton.h:55
albaGUIButton(wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos, const wxSize &size=wxDefaultSize, long style=0)
void OnSetFocus(wxFocusEvent &event)
Called when the button take the focus.
Definition: albaGUIButton.h:52
albaGUIButton(wxWindow *parent, wxWindowID id=0)
virtual void Command(wxCommandEvent &event)
Overriden function member to intercept event generation and forward it to the Listener.
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36