]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxConceptControl.h
322185f8388eccda626d6baeb17755ebe84becb2
[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         int getNumCheckBox();
103
104 private:
105         //------------------------------------------------------------------------------------------------------------
106         //  Private methods
107         //------------------------------------------------------------------------------------------------------------
108
109         //------------------------------------------------------------------------------------------------------------
110         // Creational and initialization methods
111         //------------------------------------------------------------------------------------------------------------
112         
113         void createElements( wxSizer *sizer, std::string elementsDef );
114         
115         wxCheckBox * createCheckBoxAndAddToSizer(wxSizer *sizer, std::string label, wxWindowID id, int groupID);
116
117         
118         //------------------------------------------------------------------------------------------------------------
119         // Attributtes
120         //------------------------------------------------------------------------------------------------------------
121
122         wxSlider * conceptSlider;
123
124         //std::string conceptName;
125
126         wxStaticText            * conceptName;
127
128         std::vector<wxTextCtrl *> textBoxes;
129
130         std::vector<wxCheckBox *> checkBoxes;
131
132         wxCheckBox * lastUpdate;
133
134         int minValue;
135
136         int maxValue;
137
138         bool showLabels;
139
140         int _numCheckBox;
141
142
143         //DECLARE_CLASS(wxConceptControl)
144
145
146         // any class wishing to process wxWindows events must use this macro
147 //      DECLARE_EVENT_TABLE()
148
149 };
150 #endif // __wxConceptControl__
151