00001 #ifndef __wxConceptControl_h_INCLUDED_H__ 00002 #define __wxConceptControl_h_INCLUDED_H__ 00003 00004 00005 // ----------------------------------------------------------------------------------------------------------- 00006 // WX headers inclusion. 00007 // For compilers that support precompilation, includes <wx/wx.h>. 00008 // ----------------------------------------------------------------------------------------------------------- 00009 00010 #include <wx/wxprec.h> 00011 #ifdef __BORLANDC__ 00012 #pragma hdrstop 00013 #endif 00014 #ifndef WX_PRECOMP 00015 #include <wx/wx.h> 00016 #endif 00017 00018 00019 //------------------------------------------------------------------------------------------------------------ 00020 // Includes 00021 //------------------------------------------------------------------------------------------------------------ 00022 #include <iostream> 00023 #include <vector> 00024 00025 //------------------------------------------------------------------------------------------------------------ 00026 // Events declaration 00027 //------------------------------------------------------------------------------------------------------------ 00028 BEGIN_DECLARE_EVENT_TYPES() 00029 DECLARE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE, -1 ) 00030 END_DECLARE_EVENT_TYPES() 00031 00034 //------------------------------------------------------------------------------------------------------------ 00035 // Class definition 00036 //------------------------------------------------------------------------------------------------------------ 00037 00038 class wxConceptControl : public wxPanel { 00039 00040 public: 00041 00042 //------------------------------------------------------------------------------------------------------------ 00043 // Constructors & Destructors 00044 //------------------------------------------------------------------------------------------------------------ 00045 00046 wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV, int actualV, std::string &aConceptName, std::string elementsDef = ""); 00047 00048 ~wxConceptControl(); 00049 00050 //------------------------------------------------------------------------------------------------------------ 00051 // Methods for capturing events 00052 //------------------------------------------------------------------------------------------------------------ 00053 00054 void onUpdateUICheckBox(wxCommandEvent& event); 00055 00056 void OnCheckOrRadioBox(wxCommandEvent& event); 00057 00058 void onSliderTrack(wxScrollEvent& event); 00059 00060 void onSliderRelease(wxScrollEvent& event); 00061 00062 //------------------------------------------------------------------------------------------------------------ 00063 // Methods for sending events 00064 //------------------------------------------------------------------------------------------------------------ 00065 void sendEnvent( WXTYPE theEventType ); 00066 //------------------------------------------------------------------------------------------------------------ 00067 // Attributes getters and setters 00068 //------------------------------------------------------------------------------------------------------------ 00069 00070 std::string getName(); 00071 00072 int getMinShowedValue(); 00073 00074 int getMaxShowedValue(); 00075 00076 void setMinValue(int theMin); 00077 00078 int getMinValue(); 00079 00080 void setMaxValue(int theMax); 00081 00082 int getMaxValue(); 00083 00084 void setActualValue(int theActual); 00085 00086 int getActualValue(); 00087 00088 void setShowLables(bool ifShowCondition); 00089 00090 //------------------------------------------------------------------------------------------------------------ 00091 // Other functional methods 00092 //------------------------------------------------------------------------------------------------------------ 00093 00094 void clearCheckAt( int position ); 00095 00096 bool getIfChecked( int position ); 00097 00098 void setRange(int minShow, int maxShow); 00099 00100 void reset(); 00101 00102 int getNumCheckBox(); 00103 00104 private: 00105 //------------------------------------------------------------------------------------------------------------ 00106 // Private methods 00107 //------------------------------------------------------------------------------------------------------------ 00108 00109 //------------------------------------------------------------------------------------------------------------ 00110 // Creational and initialization methods 00111 //------------------------------------------------------------------------------------------------------------ 00112 00113 void createElements( wxSizer *sizer, std::string elementsDef ); 00114 00115 wxCheckBox * createCheckBoxAndAddToSizer(wxSizer *sizer, std::string label, wxWindowID id, int groupID); 00116 00117 00118 //------------------------------------------------------------------------------------------------------------ 00119 // Attributtes 00120 //------------------------------------------------------------------------------------------------------------ 00121 00122 wxSlider * conceptSlider; 00123 00124 //std::string conceptName; 00125 00126 wxStaticText * conceptName; 00127 00128 std::vector<wxTextCtrl *> textBoxes; 00129 00130 std::vector<wxCheckBox *> checkBoxes; 00131 00132 wxCheckBox * lastUpdate; 00133 00134 int minValue; 00135 00136 int maxValue; 00137 00138 bool showLabels; 00139 00140 int _numCheckBox; 00141 00142 00143 //DECLARE_CLASS(wxConceptControl) 00144 00145 00146 // any class wishing to process wxWindows events must use this macro 00147 // DECLARE_EVENT_TABLE() 00148 00149 }; 00150 #endif // __wxConceptControl__ 00151