wxArt2D
canorderdlg.h
1 /*! \file wx/canvas/orderdlg.h
2  \brief Definition of class for dialog to specify the layerorder.
3  \author Klaas Holwerda
4 
5  Copyright: 2000-2004 (c) Klaas Holwerda
6 
7  Licence: wxWidgets Licence
8 
9  RCS-ID: $Id: orderdlg.h,v 1.6 2009/10/01 19:22:35 titato Exp $
10 */
11 
12 
13 //!
14 //!
15 /*
16  * Definition of class for dialog to specify the layerorder.
17 */
18 
19 #ifndef __CANORDERDLG_H
20 #define __CANORDERDLG_H
21 
22 #ifndef WX_PRECOMP
23 #include "wx/wx.h"
24 #endif
25 
26 
27 
28 //! GUI listbox with copy feature.
29 class A2DCANVASDLLEXP a2dDragListBox: public wxListBox
30 
31 {
32 
33 public:
34 
35  a2dDragListBox( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
36  int n, const wxString choices[], long style );
37 
38  void OnMouseLeftDown( class wxMouseEvent& );
39  void OnMouseLeftUp( class wxMouseEvent& );
40  void CmListBox( wxCommandEvent& );
41 
42  // Declare used events.
43  DECLARE_EVENT_TABLE()
44 
45  int m_selection;
46 
47 };
48 
49 //! This class is used to show the layerorder dialog, in which the drawing order of the used layers
50 //! can be set.
51 class A2DCANVASDLLEXP a2dLayerDlg: public wxDialog
52 {
53 public:
54 
55  //! constructor.
56  a2dLayerDlg( a2dHabitat* m_habitat, wxWindow* parent, a2dLayers* layersetup, bool onOrder, bool modal,
57  const wxString& title, const wxString& name = wxT( "layer_dlg" ) );
58 
59  //! destructor.
60  ~a2dLayerDlg();
61 
62  //! initialize with this layer setup
63  void Init( a2dLayers* layersetup );
64 
65  wxUint16 GetSelectedLayer() { return m_layerselected; }
66  void SetSelectedLayer( wxUint16 layerselected ) { m_layerselected = layerselected; }
67 
68 protected:
69 
70  //! Close window if OK-button is pressed.
71  void CmOk( wxCommandEvent& );
72 
73  //! Close window if CANCEL-button is pressed.
74  void CmCancel( wxCommandEvent& );
75 
76  //! Make sure the UP- and DOWN-button can't be used if the top or the bottom of the list
77  //! has been reached.
78  void CmListBox( wxCommandEvent& );
79 
80  //! Close window if EXIT-button is pressed.
81  void OnCloseWindow( wxCloseEvent& event );
82 
83  void OnComEvent( a2dComEvent& event );
84 
85  wxButton* m_buttonOK;
86 
87  wxButton* m_buttonCANCEL;
88 
89  wxListBox* m_listbox;
90 
91  // pointer to the layer setup of the active view.
92  a2dSmrtPtr<a2dLayers> m_layersetup;
93 
94  //! set or end selected layer
95  wxUint16 m_layerselected;
96 
97  //! drawing order in listbox instead of layer id
98  bool m_onOrder;
99 
100  //! show modal or not
101  bool m_modal;
102 
103  a2dHabitat* m_habitat;
104 
105  // Declare used events.
106  DECLARE_EVENT_TABLE()
107 
108 };
109 
110 
111 //! This class is used to show the layerorder dialog, in which the drawing order of the used layers
112 //! can be set.
113 class A2DCANVASDLLEXP a2dLayerOrderDlg: public wxDialog
114 {
115 public:
116 
117  //! constructor.
118  a2dLayerOrderDlg( a2dHabitat* m_habitat, wxWindow* parent, a2dLayers* layersetup, const wxString& title, long style = 0, const wxString& name = wxT( "layer_order_dlg" ) );
119 
120  //! destructor.
121  ~a2dLayerOrderDlg();
122 
123  //! initialize with this layer setup
124  void Init( a2dLayers* layersetup );
125 
126  //! store current order to layer setup
127  void StoreOrder();
128 
129 protected:
130 
131  //! Close window if OK-button is pressed.
132  void CmOk( wxCommandEvent& );
133 
134  //! Close window if CANCEL-button is pressed.
135  void CmCancel( wxCommandEvent& );
136 
137  //! Move selected layer to a heigher layersetting if UP-button is pressed.
138  void CmUp( wxCommandEvent& );
139 
140  //! Move selected layer to a lower layersetting if the DOWN-button is pressed.
141  void CmDown( wxCommandEvent& );
142 
143  //! Show new layerorder if the SHOW-button is pressed.
144  void CmShow( wxCommandEvent& );
145 
146  //! Make sure the UP- and DOWN-button can't be used if the top or the bottom of the list
147  //! has been reached.
148  void CmListBox( wxCommandEvent& );
149 
150  //! Close window if EXIT-button is pressed.
151  void OnCloseWindow( wxCloseEvent& event );
152 
153  void OnComEvent( a2dComEvent& event );
154 
155  wxButton* m_buttonOK;
156 
157  wxButton* m_buttonCANCEL;
158 
159  a2dDragListBox* m_listbox;
160 
161  wxButton* m_buttonUP;
162 
163  wxButton* m_buttonDOWN;
164 
165  wxButton* m_buttonSHOW;
166 
167  // pointer to the layer setup of the active view.
168  a2dSmrtPtr<a2dLayers> m_layersetup;
169 
170  a2dHabitat* m_habitat;
171 
172  // Declare used events.
173  DECLARE_EVENT_TABLE()
174 
175 };
176 
177 #endif
bool m_onOrder
drawing order in listbox instead of layer id
Definition: canorderdlg.h:98
GUI listbox with copy feature.
Definition: canorderdlg.h:29
defines common settinsg for a habitat for a set of a2dCameleons.
Definition: canglob.h:439
bool m_modal
show modal or not
Definition: canorderdlg.h:101
wxUint16 m_layerselected
set or end selected layer
Definition: canorderdlg.h:95
see a2dComEvent
Definition: gen.h:371
canorderdlg.h Source File -- Sun Oct 12 2014 17:04:14 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation