]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxConceptControl.h
deedb5acf98ebd318bb020f4a0e218453ebdc24f
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxConceptControl.h
1 #ifndef __wxConceptControl_h_INCLUDED_H__
2 #define __wxConceptControl_h_INCLUDED_H__
3
4
5 // -----------------------------------------------------------------------------------------------------------
6 // WX headers inclusion.
7 // For compilers that support precompilation, includes <wx/wx.h>.
8 // -----------------------------------------------------------------------------------------------------------
9
10 #include <wx/wxprec.h>
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14 #ifndef WX_PRECOMP
15 #include <wx/wx.h>
16 #endif
17
18
19 //------------------------------------------------------------------------------------------------------------
20 // Includes
21 //------------------------------------------------------------------------------------------------------------
22 #include <iostream>
23 #include <vector>
24
25 //------------------------------------------------------------------------------------------------------------
26 // Events declaration
27 //------------------------------------------------------------------------------------------------------------
28 BEGIN_DECLARE_EVENT_TYPES()
29         DECLARE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE, -1 ) 
30 END_DECLARE_EVENT_TYPES()
31
32 /** file wxConceptControl.h */
33
34 //------------------------------------------------------------------------------------------------------------
35 // Class definition
36 //------------------------------------------------------------------------------------------------------------
37
38 class wxConceptControl : public wxPanel {
39
40         public:
41
42         //------------------------------------------------------------------------------------------------------------
43         // Constructors & Destructors
44         //------------------------------------------------------------------------------------------------------------
45         
46         wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV, int actualV, std::string &aConceptName, std::string elementsDef = "");
47
48         ~wxConceptControl();
49
50         //------------------------------------------------------------------------------------------------------------
51         // Methods for capturing events
52         //------------------------------------------------------------------------------------------------------------
53         
54         void onUpdateUICheckBox(wxCommandEvent& event);
55
56         void OnCheckOrRadioBox(wxCommandEvent& event);
57
58         void onSliderTrack(wxScrollEvent& event);
59         
60         void onSliderRelease(wxScrollEvent& event);
61         
62         //------------------------------------------------------------------------------------------------------------
63         //  Methods for sending events
64         //------------------------------------------------------------------------------------------------------------
65         void sendEnvent( WXTYPE theEventType );
66         //------------------------------------------------------------------------------------------------------------
67         //  Attributes getters and setters
68         //------------------------------------------------------------------------------------------------------------
69
70         std::string getName();
71
72         int getMinShowedValue();
73
74         int getMaxShowedValue();
75
76         void setMinValue(int theMin);
77
78         int getMinValue();
79
80         void setMaxValue(int theMax);
81
82         int getMaxValue();
83
84         void setActualValue(int theActual);
85
86         int getActualValue();
87
88         void setShowLables(bool ifShowCondition);
89
90         //------------------------------------------------------------------------------------------------------------
91         //  Other functional methods
92         //------------------------------------------------------------------------------------------------------------
93
94         void clearCheckAt( int position );
95
96         bool getIfChecked( int position );
97
98         void setRange(int minShow, int maxShow);
99
100         void reset();
101
102 private:
103         //------------------------------------------------------------------------------------------------------------
104         //  Private methods
105         //------------------------------------------------------------------------------------------------------------
106
107         //------------------------------------------------------------------------------------------------------------
108         // Creational and initialization methods
109         //------------------------------------------------------------------------------------------------------------
110         
111         void createElements( wxSizer *sizer, std::string elementsDef );
112         
113         wxCheckBox * createCheckBoxAndAddToSizer(wxSizer *sizer, std::string label, wxWindowID id, int groupID);
114
115         
116         //------------------------------------------------------------------------------------------------------------
117         // Attributtes
118         //------------------------------------------------------------------------------------------------------------
119
120         wxSlider * conceptSlider;
121
122         //std::string conceptName;
123
124         wxStaticText            * conceptName;
125
126         std::vector<wxTextCtrl *> textBoxes;
127
128         std::vector<wxCheckBox *> checkBoxes;
129
130         wxCheckBox * lastUpdate;
131
132         int minValue;
133
134         int maxValue;
135
136         bool showLabels;
137
138
139         //DECLARE_CLASS(wxConceptControl)
140
141
142         // any class wishing to process wxWindows events must use this macro
143 //      DECLARE_EVENT_TABLE()
144
145 };
146 #endif // __wxConceptControl__
147