ALBA
albaGUIMovieCtrl.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIMovieCtrl
5 Authors: Paolo Quadrani
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
17#ifndef __albaGUIMovieCtrl_H__
18#define __albaGUIMovieCtrl_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaObserver.h"
25#include "albaGUIPanel.h"
26
27//----------------------------------------------------------------------------
28// forward references :
29//----------------------------------------------------------------------------
30class albaGUIPicButton;
31class albaGUIValidator;
32
33//----------------------------------------------------------------------------
34// Constants :
35//----------------------------------------------------------------------------
36#define ID_TIMER 702
37#define MOVIE_BUTTONS_NUM 6
38
39//----------------------------------------------------------------------------
40// albaGUIMovieCtrl :
42//----------------------------------------------------------------------------
44{
45public:
46 albaGUIMovieCtrl(wxWindow* parent,wxWindowID id = -1);
48
51 {
53 };
54
55 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
56
57 void OnEvent(albaEventBase *alba_event);
58
60 void SetFrameBounds(double min, double max, double step = 1);
61
63 void Loop(bool enable = true) {m_Loop = enable;};
64
65protected:
66 double m_Frame;
67 double m_FrameMin;
68 double m_FrameMax;
70 int m_Loop;
71 wxCheckBox *m_LoopCheck;
72
73 //----------------------------------------------------------------------------
74 // constant
75 //----------------------------------------------------------------------------
77 {
84 };
85
86 wxBoxSizer *m_Sizer;
88 wxTimer m_Timer;
89
91
93 void Update();
94
96 void OnTimer(wxTimerEvent &event);
97DECLARE_EVENT_TABLE()
98};
99#endif
MINID
Definition: albaDecl.h:251
#define MOVIE_BUTTONS_NUM
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUIMovieCtrl is a wxPanel with a set of widget to handle time.
albaObserver * m_Listener
wxCheckBox * m_LoopCheck
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
MOVIECTRL_EVENT_ID
Id of the event sent to the listener when the frame changes (the frame is the double of the event)
void SetFrameBounds(double min, double max, double step=1)
Set the frames bounds for the movie.
virtual ~albaGUIMovieCtrl()
void OnTimer(wxTimerEvent &event)
Update the frame and send ID_FRAME_SET to the listener.
albaGUIMovieCtrl(wxWindow *parent, wxWindowID id=-1)
void Update()
Update the movie ctrl interface.
albaGUIPicButton * m_TimeBarButtons[MOVIE_BUTTONS_NUM]
void SetListener(albaObserver *Listener)
void Loop(bool enable=true)
Enable/Disable loop.
wxBoxSizer * m_Sizer
class name: albaGUIPanel Inherits directly from wxPanel and adds the pointer to the next panel
Definition: albaGUIPanel.h:27
albaGUIPicButton inherit from wxBitmapButton.
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36