]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.h
c7b3b6548f9681f391d2d650471ba7895fd64cba
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxInstantChooserPanel.h
1 #ifndef __wxInstantChooserPanel_h_INCLUDED_H__
2 #define __wxInstantChooserPanel_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 <string>
24 #include <vector>
25 #include  "wxConceptControl.h"
26 #include <map>
27 #include "ConceptDataWrap.h"
28 #include <wx/event.h>
29 //------------------------------------------------------------------------------------------------------------
30 // Events declaration
31 //------------------------------------------------------------------------------------------------------------
32
33 BEGIN_DECLARE_EVENT_TYPES()
34         DECLARE_EVENT_TYPE(wxINSTANT_CHOOSER_CHANGE,400)
35 END_DECLARE_EVENT_TYPES()
36
37
38 /** file wxInstantChooserPanel.h */
39
40
41 //------------------------------------------------------------------------------------------------------------
42 // Class definition
43 //------------------------------------------------------------------------------------------------------------
44
45 class wxInstantChooserPanel : public wxPanel {
46
47         public:
48
49         //------------------------------------------------------------------------------------------------------------
50         // Constructors & Destructors
51         //------------------------------------------------------------------------------------------------------------
52         
53         wxInstantChooserPanel (wxWindow * parent, std::string title, bool theOrientation, bool resolutionALL = false, std::string configurationElem="", std::string groupConfig = "");
54
55         wxInstantChooserPanel (wxWindow * parent,wxWindowID id ,std::string title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool theOrientation=true, std::string configurationElem="", std::string groupConfig = "");
56
57         ~wxInstantChooserPanel();
58
59         //------------------------------------------------------------------------------------------------------------
60         // Creational and initialization methods
61         //------------------------------------------------------------------------------------------------------------
62         
63         /**
64         * Adds a concept to the instant managment. PRE: The concept doesn't exists in the included _concepts.
65         * @param aConceptName 
66         * @param minV
67         * @param maxV
68         * @param actualV
69         */
70         void addConcept(std::string aConceptName, int minV, int maxV, int actualV);
71
72         void setWxEventHandler( wxEvtHandler * theEventHandler );
73
74         //------------------------------------------------------------------------------------------------------------
75         // Methods for capturing events
76         //------------------------------------------------------------------------------------------------------------
77         void onResolutionSlider( wxScrollEvent& event );
78
79         void onCheckBoxClicked( wxCommandEvent& event );
80
81         void onConceptRelease( wxCommandEvent& event );
82         //------------------------------------------------------------------------------------------------------------
83         //  Methods for sending events
84         //------------------------------------------------------------------------------------------------------------
85
86         //------------------------------------------------------------------------------------------------------------
87         //  Attributes getters and setters
88         //------------------------------------------------------------------------------------------------------------
89         
90         ConceptDataWrap * getLastConceptData();
91
92         //------------------------------------------------------------------------------------------------------------
93         //  Other functional methods
94         //------------------------------------------------------------------------------------------------------------
95         
96         void setInstant(std::vector<int> choiceInstant);
97         
98         void setInstant(std::map<std::string,int>* _actualInstant );
99
100         void getInstant(std::vector<int> & choiceInstant);
101
102         void getInstantData(std::map<std::string,int> & choiceInstantData);
103
104         std::map<std::string,int>* getInstantData();
105
106         void setResolutionRangeWithLasUpdate();
107
108         void refreshConceptLabels();
109
110         void setConfiguration(std::string aConfiguration);
111
112         std::string getConfiguration();
113         
114         void setResolutionOverAll( bool condition );
115
116         bool getIfResolutionOverAll();
117
118         void setConceptValue( std::string theConceptName, int theValue );
119
120         int getConceptValue( std::string theConceptName );
121
122         ConceptDataWrap * getConceptDataOf( std::string theConceptName );
123
124         bool getIfConceptCheckedAt( std::string theConceptName, int atChecksPosition );
125
126         void onChangeInstant( wxCommandEvent& event );
127
128         void addConcepts(std::vector<std::string> conceptNameVect,std::vector<int> conceptSizeVect);
129
130         private:
131         //------------------------------------------------------------------------------------------------------------
132         //  Private methods
133         //------------------------------------------------------------------------------------------------------------
134         void initializeResolutionSlider();
135
136         void changeResolutionAtConceptControl( wxConceptControl * theConceptToUpdate );
137
138         void setVerticalMaxSelectedNums( std::string groupMaxVertNums );
139
140         //------------------------------------------------------------------------------------------------------------
141         // Attributtes
142         //------------------------------------------------------------------------------------------------------------
143
144         std::vector<wxConceptControl *> * _concepts;
145
146         wxConceptControl * _lastConceptUpdated;
147
148         wxSlider * _resolutionSlider;
149
150         wxFlexGridSizer * _outSizer;
151
152         bool _orientation;
153
154         bool _resolutionOverALL;
155         
156         std::map<std::string,int>* _actualInstant;
157
158         std::vector<int> _verticalMaxSelected;
159         
160         wxEvtHandler * _eventHandler;
161
162         std::string _configuration;
163     
164
165         //DECLARE_CLASS(wxInstantChooserPanel)
166         // any class wishing to process wxWindows events must use this macro
167         //DECLARE_EVENT_TABLE()
168
169 };
170
171 #endif