ALBA
albaGUIPicButton.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIPicButton
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 __albaGUIPicButton_H__
17#define __albaGUIPicButton_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include "albaEvent.h"
22#include "albaObserver.h"
23
24//----------------------------------------------------------------------------
25// albaGUIPicButton :
37//----------------------------------------------------------------------------
38class ALBA_EXPORT albaGUIPicButton : public wxBitmapButton
39{
40DECLARE_DYNAMIC_CLASS(albaGUIPicButton)
41
42public:
44 albaGUIPicButton(wxWindow *parent, wxString BitmapId, wxWindowID id = 0, albaObserver *listener = NULL, int offset = 0);
45 albaGUIPicButton(wxWindow *parent, wxBitmap *b, wxWindowID id = 0, albaObserver *listener = NULL, int offset = 0);
46
48 void SetListener(albaObserver *listener);
49
51 void SetEventId(long EventId);
52
56 void SetBitmap(wxString BitmapId, wxWindowID id = 0);
57
58protected:
60 virtual void Command(wxCommandEvent& event);
61
62 void OnSetFocus(wxFocusEvent& event) {};
63
64 int m_Id;
66
67 DECLARE_EVENT_TABLE()
68};
69#endif // __albaGUIPicButton_H__
albaGUIPicButton inherit from wxBitmapButton.
void SetListener(albaObserver *listener)
Set the Listener that will receive event-notification.
virtual void Command(wxCommandEvent &event)
Overriden function member to intercept event generation and forward it to the Listener.
void SetEventId(long EventId)
allow to change the Event-Id at run time
void SetBitmap(wxString BitmapId, wxWindowID id=0)
Used to change Bitmap and Event-ID at run time.
albaObserver * m_Listener
albaGUIPicButton(wxWindow *parent, wxBitmap *b, wxWindowID id=0, albaObserver *listener=NULL, int offset=0)
void OnSetFocus(wxFocusEvent &event)
albaGUIPicButton(wxWindow *parent, wxString BitmapId, wxWindowID id=0, albaObserver *listener=NULL, int offset=0)
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36