]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.h
*** empty log message ***
[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 onChechBoxClicked( 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         private:
127         //------------------------------------------------------------------------------------------------------------
128         //  Private methods
129         //------------------------------------------------------------------------------------------------------------
130         void initializeResolutionSlider();
131
132         void changeResolutionAtConceptControl( wxConceptControl * theConceptToUpdate );
133
134         void setVerticalMaxSelectedNums( std::string groupMaxVertNums );
135
136         //------------------------------------------------------------------------------------------------------------
137         // Attributtes
138         //------------------------------------------------------------------------------------------------------------
139
140         std::vector<wxConceptControl *> * _concepts;
141
142         wxConceptControl * _lastConceptUpdated;
143
144         wxSlider * _resolutionSlider;
145
146         wxFlexGridSizer * _outSizer;
147
148         bool _orientation;
149
150         bool _resolutionOverALL;
151         
152         std::map<std::string,int>* _actualInstant;
153
154         std::vector<int> _verticalMaxSelected;
155         
156         wxEvtHandler * _eventHandler;
157
158         std::string _configuration;
159     
160
161         //DECLARE_CLASS(wxInstantChooserPanel)
162         // any class wishing to process wxWindows events must use this macro
163         //DECLARE_EVENT_TABLE()
164
165 };
166
167 #endif