Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
BuildingDlg.h
1 //
2 // Name: BuildingDlg.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __BuildingDlg_H__
9 #define __BuildingDlg_H__
10 
11 #include "wx/colourdata.h"
12 
13 #include "vtui_UI.h"
14 #include "vtui/AutoDialog.h"
15 #include "vtdata/Building.h"
16 #include "vtdata/StructArray.h"
17 
18 // WDR: class declarations
19 
20 //----------------------------------------------------------------------------
21 // BuildingDlg
22 //----------------------------------------------------------------------------
23 
25 {
26 public:
27  // constructors and destructors
28  BuildingDlg( wxWindow *parent, wxWindowID id, const wxString &title,
29  const wxPoint& pos = wxDefaultPosition,
30  const wxSize& size = wxDefaultSize,
31  long style = wxDEFAULT_DIALOG_STYLE );
32 
33  // WDR: method declarations for BuildingDlg
34  wxTextCtrl* GetFeatures() { return (wxTextCtrl*) FindWindow( ID_FEATURES ); }
35  wxButton* GetLevelCopy() { return (wxButton*) FindWindow( ID_LEVEL_COPY ); }
36  wxButton* GetLevelDel() { return (wxButton*) FindWindow( ID_LEVEL_DEL ); }
37  wxButton* GetLevelDown() { return (wxButton*) FindWindow( ID_LEVEL_DOWN ); }
38  wxButton* GetLevelUp() { return (wxButton*) FindWindow( ID_LEVEL_UP ); }
39  wxStaticBitmap* GetColorBitmap1() { return (wxStaticBitmap*) FindWindow( ID_COLOR1 ); }
40  wxStaticBitmap* GetColorBitmap2() { return (wxStaticBitmap*) FindWindow( ID_COLOR2 ); }
41  wxListBox* GetLevelCtrl() { return (wxListBox*) FindWindow( ID_LEVEL ); }
42  wxListBox* GetEdgeCtrl() { return (wxListBox*) FindWindow( ID_EDGE ); }
43  wxChoice* GetFacadeChoice() { return (wxChoice*) FindWindow( ID_FACADE ); }
44  void Setup(vtStructureArray *pSA, vtBuilding *bld);
45 
46  void EditColor();
47  void SetLevel(int i);
48  void SetEdge(int i);
49  void UpdateSlopes();
50  void RefreshLevelsBox();
51  void RefreshEdgesBox();
52  void HighlightSelectedLevel();
53  void HighlightSelectedEdge();
54  void UpdateMaterialControl();
55  void UpdateColorControl();
56  void UpdateFeatures();
57  void UpdateFacade();
58  void SetupControls();
59  void DeleteCurrentLevel();
60  void CopyCurrentLevel();
61  void SetupValidators();
62  bool AskForTypeAndSlope(bool bAll, RoofType &eType, int &iSlope);
63  void AdjustDialogForEdges();
64 
65  // allow the dialog to control rendering (in case its being used w/3d)
66  virtual void EnableRendering(bool bEnable) {}
67 
68  // notify subclasses when building is modified
69  virtual void Modified() {}
70 
71 protected:
72  // WDR: member variable declarations for BuildingDlg
73  vtStructureArray *m_pSA;
74  vtBuilding *m_pBuilding;
75  vtLevel *m_pLevel;
76  vtEdge *m_pEdge;
77 
78  int m_iLevel;
79  int m_iEdge;
80  int m_iStories;
81  float m_fStoryHeight;
82  wxString m_strMaterial1;
83  wxString m_strMaterial2;
84  wxString m_strEdgeSlopes;
85  wxString m_strFeatures;
86  wxColour m_Color;
87  static wxColourData s_ColorData;
88  int m_iEdgeSlope;
89 
90  wxStaticBitmap *m_pColorBitmapControl;
91  wxListBox *m_pLevelListBox;
92  wxListBox *m_pEdgeListBox;
93 
94  bool m_bSetting;
95  bool m_bEdges;
96 
97 protected:
98  // WDR: handler declarations for BuildingDlg
99  void OnChoiceFacade( wxCommandEvent &event );
100  void OnVertOffset( wxCommandEvent &event );
101  void OnFeatDoor( wxCommandEvent &event );
102  void OnFeatWindow( wxCommandEvent &event );
103  void OnFeatWall( wxCommandEvent &event );
104  void OnFeatClear( wxCommandEvent &event );
105  void OnEdgeSlope( wxCommandEvent &event );
106  void OnLevelDown( wxCommandEvent &event );
107  void OnEdges( wxCommandEvent &event );
108  void OnLevelDelete( wxCommandEvent &event );
109  void OnLevelUp( wxCommandEvent &event );
110  void OnLevelCopy( wxCommandEvent &event );
111  void OnStoryHeight( wxCommandEvent &event );
112  void OnSpinStories( wxSpinEvent &event );
113  void OnColor1( wxCommandEvent &event );
114  virtual void OnOK( wxCommandEvent &event );
115  void OnCloseWindow(wxCloseEvent& event);
116  void OnInitDialog(wxInitDialogEvent& event);
117  void OnLevel( wxCommandEvent &event );
118  void OnEdge( wxCommandEvent &event );
119  void OnSetRoofType( wxCommandEvent &event );
120  void OnSetEdgeSlopes( wxCommandEvent &event );
121  void OnSetMaterial( wxCommandEvent &event );
122  void OnCharHook( wxKeyEvent &event );
123 
124 private:
125  DECLARE_EVENT_TABLE()
126 };
127 
128 #endif // __BuildingDlg_H__
129