Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
LocationDlg.h
1 //
2 // Name: LocationDlg.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __LocationDlg_H__
9 #define __LocationDlg_H__
10 
11 #include "EnviroUI.h"
12 #include "vtlib/core/Location.h"
13 #include "vtlib/core/AnimPath.h"
14 #include "vtui/AutoDialog.h"
15 
16 class vtLocationSaver;
17 
18 #define PF_LOOP 1
19 #define PF_INTERP 2
20 #define PF_CONTIN 4
21 #define PF_POSONLY 8
22 #define PF_SPEED 16
23 #define PF_ALL (PF_LOOP|PF_INTERP|PF_CONTIN|PF_POSONLY|PF_SPEED)
24 
25 // WDR: class declarations
26 
27 //----------------------------------------------------------------------------
28 // LocationDlg
29 //----------------------------------------------------------------------------
30 
32 {
33 public:
34  // constructors and destructors
35  LocationDlg( wxWindow *parent, wxWindowID id, const wxString &title,
36  const wxPoint& pos = wxDefaultPosition,
37  const wxSize& size = wxDefaultSize,
38  long style = wxDEFAULT_DIALOG_STYLE );
39  ~LocationDlg();
40 
41  // WDR: method declarations for LocationDlg
42  wxButton* GetPlayToDisk() { return (wxButton*) FindWindow( ID_PLAY_TO_DISK ); }
43  wxTextCtrl* GetSpeed() { return (wxTextCtrl*) FindWindow( ID_SPEED ); }
44  wxTextCtrl* GetRecordSpacing() { return (wxTextCtrl*) FindWindow( ID_RECORD_SPACING ); }
45  wxRadioButton* GetRecordInterval() { return (wxRadioButton*) FindWindow( ID_RECORD_INTERVAL ); }
46  wxRadioButton* GetRecordLinear() { return (wxRadioButton*) FindWindow( ID_RECORD_LINEAR ); }
47  wxCheckBox* GetActive() { return (wxCheckBox*) FindWindow( ID_ACTIVE ); }
48  wxSlider* GetAnimPos() { return (wxSlider*) FindWindow( ID_ANIM_POS ); }
49  wxBitmapButton* GetReset() { return (wxBitmapButton*) FindWindow( ID_RESET ); }
50  wxCheckBox* GetLoop() { return (wxCheckBox*) FindWindow( ID_LOOP ); }
51  wxCheckBox* GetSmooth() { return (wxCheckBox*) FindWindow( ID_SMOOTH ); }
52  wxCheckBox* GetContinuous() { return (wxCheckBox*) FindWindow( ID_CONTINUOUS ); }
53  wxCheckBox* GetPosOnly() { return (wxCheckBox*) FindWindow( ID_POS_ONLY ); }
54  wxButton* GetSaveAnim() { return (wxButton*) FindWindow( ID_SAVE_ANIM ); }
55  wxButton* GetStop() { return (wxButton*) FindWindow( ID_STOP ); }
56  wxButton* GetRecord1() { return (wxButton*) FindWindow( ID_RECORD1 ); }
57  wxButton* GetPlay() { return (wxButton*) FindWindow( ID_PLAY ); }
58  wxTreeCtrl* GetAnimTree() { return (wxTreeCtrl*) FindWindow( ID_ANIMTREE ); }
59 
60  wxButton* GetStoreas() { return (wxButton*) FindWindow( ID_STOREAS ); }
61  wxButton* GetStore() { return (wxButton*) FindWindow( ID_STORE ); }
62  wxButton* GetRecall() { return (wxButton*) FindWindow( ID_RECALL ); }
63  wxListBox* GetLoclist() { return (wxListBox*) FindWindow( ID_LOCLIST ); }
64  wxButton* GetRemove() { return (wxButton*) FindWindow( ID_REMOVE ); }
65 
66  void Update();
67  void DeleteItem(wxListBox *pBox);
68 
69  void RefreshList();
70  void SetLocSaver(vtLocationSaver *saver);
71  void SetAnimContainer(vtAnimContainer *ac);
72  void RefreshButtons();
73  void RecallFrom(const char *locname);
74 
75  void RefreshAnims();
76  void RefreshAnimsText();
77  void UpdateSlider();
78  void UpdateEnabling();
79  void SlidersToValues();
80  void ValuesToSliders();
81  void AppendAnimPath(vtAnimPath *anim, const char *name);
82  vtAnimPath *CreateAnimPath();
83 
84  void SetValues(int which = PF_ALL);
85  void GetValues();
86  void TransferToWindow();
87 
88 private:
89  // WDR: member variable declarations for LocationDlg
90  vtLocationSaver *m_pSaver;
91 
92  vtAnimContainer *m_pAnimPaths;
93 
94  vtAnimPath *GetAnim(int i) { return m_pAnimPaths->at(i).m_pAnim; }
95  vtAnimPathEngine *GetEngine(int i) { return m_pAnimPaths->at(i).m_pEngine; }
96 
97  bool m_bActive;
98  bool m_bLoop;
99  bool m_bContinuous;
100  bool m_bSmooth;
101  bool m_bPosOnly;
102  int m_iAnim;
103  int m_iPos;
104  float m_fSpeed;
105  int m_iSpeed;
106  bool m_bSetting;
107  float m_fRecordSpacing;
108  bool m_bRecordLinear;
109  bool m_bRecordInterval;
110 
111  wxListBox* m_pLocList;
112  wxTreeItemId m_root, m_current;
113 
114 private:
115  // WDR: handler declarations for LocationDlg
116  void OnTreeKeyDown( wxTreeEvent &event );
117  void OnTreeSelChanged( wxTreeEvent &event );
118  void OnAnimPosSlider( wxCommandEvent &event );
119  void OnActive( wxCommandEvent &event );
120  void OnRadio( wxCommandEvent &event );
121  void OnText( wxCommandEvent &event );
122  void OnSpeedSlider( wxCommandEvent &event );
123  void OnReset( wxCommandEvent &event );
124  void OnCheckbox( wxCommandEvent &event );
125  void OnStop( wxCommandEvent &event );
126  void OnPlayToDisk( wxCommandEvent &event );
127  void OnRecord1( wxCommandEvent &event );
128  void OnPlay( wxCommandEvent &event );
129  void OnLoadAnim( wxCommandEvent &event );
130  void OnSaveAnim( wxCommandEvent &event );
131  void OnNewAnim( wxCommandEvent &event );
132  void OnRemove( wxCommandEvent &event );
133  void OnListDblClick( wxCommandEvent &event );
134  void OnLoad( wxCommandEvent &event );
135  void OnSave( wxCommandEvent &event );
136  void OnStoreAs( wxCommandEvent &event );
137  void OnStore( wxCommandEvent &event );
138  void OnRecall( wxCommandEvent &event );
139  void OnLocList( wxCommandEvent &event );
140 
141 private:
142  DECLARE_EVENT_TABLE()
143 };
144 
145 #endif // __LocationDlg_H__
146