ALBA
albaGUITimeBar.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUITimeBar
5 Authors: Silvano Imboden - 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 __albaGUITimeBar_H__
18#define __albaGUITimeBar_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include <wx/datetime.h>
24#include "albaEvent.h"
25#include "albaObserver.h"
26#include "albaGUIPanel.h"
27
28//----------------------------------------------------------------------------
29// forward references :
30//----------------------------------------------------------------------------
31class albaGUIPicButton;
32class albaGUIValidator;
35
36//----------------------------------------------------------------------------
37// Constants :
38//----------------------------------------------------------------------------
39# define ID_TITLE 700
40# define ID_CLOSE 701
41# define ID_TIMER 702
42
43//----------------------------------------------------------------------------
44// albaGUITimeBar :
46//----------------------------------------------------------------------------
48{
49public:
50 albaGUITimeBar(wxWindow* parent,wxWindowID id = -1,bool CloseButton = false);
51 virtual ~albaGUITimeBar();
52 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
53
54 void OnEvent(albaEventBase *alba_event);
55
58 void SetBounds(double min, double max);
59
61 void SetMultiplier(double mult = 1000.0);
62
65
67 void SetNumberOfIntervals(int intervals);
68
69protected:
70 double m_Time;
71 double m_TimeMin;
72 double m_TimeMax;
73 double m_TimeStep;
74 double m_TimeStart;
75
77
80
81 wxDateTime m_WorldTimeStart;
82
83 wxBoxSizer *m_Sizer;
85 wxTextCtrl *m_TimeBarEntry;
87 wxTimer m_Timer;
88
91
93 void OnTimer(wxTimerEvent &event);
94
96 void Update();
97
100
101DECLARE_EVENT_TABLE()
102};
103#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
a Slider that can be used to set double values, albaGUIFloatSlider send usual wxWindows Events; Use a...
class name: albaGUIPanel Inherits directly from wxPanel and adds the pointer to the next panel
Definition: albaGUIPanel.h:27
albaGUIPicButton inherit from wxBitmapButton.
class name: albaGUISettingsTimeBar Gui class for handling time bar properties inside application sett...
albaGUITimeBar is a wxPanel with a set of widget to handle time.
double m_TimeStart
ALBA time when the play button was pressed.
virtual ~albaGUITimeBar()
void SetTimeSettings(albaGUISettingsTimeBar *settings)
Set the reference to the time setting panel.
albaObserver * m_Listener
albaGUITimeBar(wxWindow *parent, wxWindowID id=-1, bool CloseButton=false)
void OnTimer(wxTimerEvent &event)
Update the time and send the TIME_SET event to synchronize all the application.
wxBoxSizer * m_Sizer
albaGUIFloatSlider * m_TimeBarSlider
void SetBounds(double min, double max)
Set the time bounds for the time bar.
void SetListener(albaObserver *Listener)
albaGUISettingsTimeBar * m_TimeBarSettings
Settings panel for the time bar.
albaString m_TimeMaxString
wxDateTime m_WorldTimeStart
World time when the play button was pressed.
wxTextCtrl * m_TimeBarEntry
int m_NumberOfIntervals
Number of subdivision intervals for the time bar.
void SetMultiplier(double mult=1000.0)
Set the multiplier for timer.
void Update()
Update the time bar interface.
void SetNumberOfIntervals(int intervals)
Set the number of subdivisions for the slider.
albaString m_TimeMinString
void UpdateTimeStep()
Calculate the Time step according to the number of intervals.
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
albaGUIPicButton * m_TimeBarButtons[5]
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43