ALBA
albaGUIViewFrame.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIViewFrame
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 __albaGUIViewFrame_H__
17#define __albaGUIViewFrame_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include "albaEvent.h"
22#include "albaObserver.h"
23#include <wx/laywin.h>
24//----------------------------------------------------------------------------
25// forward reference
26//----------------------------------------------------------------------------
27class albaView;
28
29//----------------------------------------------------------------------------
30// albaGUIViewFrame :
31//----------------------------------------------------------------------------
32class ALBA_EXPORT albaGUIViewFrame: public wxFrame , public albaObserver
33{
34 public:
35 albaGUIViewFrame(wxFrame* parent,
36 wxWindowID id,
37 const wxString& title,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN
41 );
42
44
45 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
46
48 static void OnQuit () {m_Quitting=true;};
49
51 void SetView(albaView *view);
52
54 virtual void OnEvent(albaEventBase *alba_event);
55
56protected:
58 void OnCloseWindow (wxCloseEvent &event);
59
61 void OnSize (wxSizeEvent &event);
62
64 void OnSelect (wxCommandEvent &event);
65
67 void OnActivate (wxActivateEvent &event);
68
70 wxWindow *m_ClientWin;
72 static bool m_Quitting;
73
74 DECLARE_EVENT_TABLE()
75};
76#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
void OnCloseWindow(wxCloseEvent &event)
Send the event to destroy the owned view.
void SetView(albaView *view)
Set which is the external view.
void OnSelect(wxCommandEvent &event)
Send the event to select the owned view.
albaObserver * m_Listener
void OnActivate(wxActivateEvent &event)
Send the event to select the owned view.
static bool m_Quitting
void OnSize(wxSizeEvent &event)
Adjust the child size.
albaGUIViewFrame(wxFrame *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN)
static void OnQuit()
Set the quitting flag.
void SetListener(albaObserver *Listener)
virtual void OnEvent(albaEventBase *alba_event)
Answer to the messages coming from bottom classes.
wxWindow * m_ClientWin
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaView is the base class for Views in alba.
Definition: albaView.h:79