Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
TimeDlg.h
1 //
2 // Name: TimeDlg.h
3 //
4 // Copyright (c) 2004-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __TimeDlg_H__
9 #define __TimeDlg_H__
10 
11 #include "wxosg_UI.h"
12 
13 #include "vtdata/vtTime.h"
14 #include "vtlib/core/TimeEngines.h"
15 
16 // WDR: class declarations
17 
18 //----------------------------------------------------------------------------
19 // TimeDlg
20 //----------------------------------------------------------------------------
21 
22 class TimeDlg: public TimeDlgBase, public vtTimeTarget
23 {
24 public:
25  // constructors and destructors
26  TimeDlg( wxWindow *parent, wxWindowID id, const wxString &title,
27  const wxPoint& pos = wxDefaultPosition,
28  const wxSize& size = wxDefaultSize,
29  long style = wxDEFAULT_DIALOG_STYLE );
30  void AddOkCancel();
31 
32  void OnInitDialog(wxInitDialogEvent& event);
33 
34  // WDR: method declarations for TimeDlg
35  wxSlider* GetSliderSpeed() { return (wxSlider*) FindWindow( ID_SLIDER_SPEED ); }
36  wxTextCtrl* GetTextSpeed() { return (wxTextCtrl*) FindWindow( ID_TEXT_SPEED ); }
37  wxButton* GetStop() { return (wxButton*) FindWindow( ID_BUTTON_STOP ); }
38  wxSpinCtrl* GetSpinSecond() { return (wxSpinCtrl*) FindWindow( ID_SPIN_SECOND ); }
39  wxSpinCtrl* GetSpinMinute() { return (wxSpinCtrl*) FindWindow( ID_SPIN_MINUTE ); }
40  wxSpinCtrl* GetSpinHour() { return (wxSpinCtrl*) FindWindow( ID_SPIN_HOUR ); }
41  wxSpinCtrl* GetSpinDay() { return (wxSpinCtrl*) FindWindow( ID_SPIN_DAY ); }
42  wxSpinCtrl* GetSpinMonth() { return (wxSpinCtrl*) FindWindow( ID_SPIN_MONTH ); }
43  wxSpinCtrl* GetSpinYear() { return (wxSpinCtrl*) FindWindow( ID_SPIN_YEAR ); }
44 
45  // implement TimeTarget method, to catch events from the engine
46  void SetTime(const vtTime &time);
47  void SetTimeEngine(vtTimeEngine *pEngine);
48  void GetTime(vtTime &time);
49 
50 private:
51  void PullTime();
52  void PushTime();
53  void UpdateEnabling();
54  void UpdateSlider();
55  void SetTimeControls(const vtTime &time);
56 
57  // WDR: member variable declarations for TimeDlg
58  int year, month, day;
59  int hour, minute, second;
60 
61  bool m_bGoing;
62  int m_iSpeed;
63  float m_fSpeed;
64 
65  bool m_bSetting;
66 
67  vtTimeEngine *m_pTimeEngine;
68 
69  wxSizer *m_pTop;
70 
71 private:
72  // WDR: handler declarations for TimeDlg
73  void OnSpinner( wxSpinEvent& event );
74  void OnSliderSpeed( wxCommandEvent &event );
75  void OnTextSpeed( wxCommandEvent &event );
76  void OnStop( wxCommandEvent &event );
77 
78 private:
79  DECLARE_EVENT_TABLE()
80 };
81 
82 
83 
84 
85 #endif