]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingPanel.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSurfaceRenderingPanel.h
1 #ifndef WXMARACASSURFACERENDERINGPANEL_H_
2 #define WXMARACASSURFACERENDERINGPANEL_H_
3
4 #include "wx/wx.h"
5
6 class wxMaracasSurfaceRenderingPanel : public wxPanel{
7 public:
8         wxMaracasSurfaceRenderingPanel(wxWindow* parent, int propid, bool _isComplexBox, int _panID)
9                 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
10                         createPanel();
11                         isComplexBox = _isComplexBox;
12                         panID = _panID;
13                         _propid = propid;
14         }       
15         //virtual ~wxMaracasSurfaceRenderingPanel();
16         virtual void createPanel(){
17                 show = false;
18         /*wxBoxSizer* sizerButtons = new wxBoxSizer(wxVERTICAL);
19
20                 wxButton* b = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
21                                                                 wxDefaultValidator, wxString(_T("-"))); 
22                 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingPanel::onActionButtonPressedHide);
23                 wxButton* b1 = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
24                                                                 wxDefaultValidator, wxString(_T("x"))); 
25                 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingPanel::onActionButtonPressedEliminate);
26
27                 sizerButtons->Add(b, wxFIXED_MINSIZE);
28                 sizerButtons->Add(b1, wxFIXED_MINSIZE);*/
29
30                 sizercontrols = new wxBoxSizer(wxVERTICAL);
31
32                 wxBoxSizer* sizerpanel = new wxBoxSizer(wxHORIZONTAL);
33
34                 //sizerpanel->Add(sizerButtons,wxGROW);
35                 sizerpanel->Add(sizercontrols,wxGROW);
36         
37                 this->SetSizer(sizerpanel, true);               
38                 this->SetAutoLayout( true );
39         }
40
41         /**
42         **      Adds a new control to the panel (sizer, radiob, etc)
43         **/
44         virtual void addControl(wxWindow* win){
45                 if(sizercontrols!=NULL){
46                         sizercontrols->Add(win, wxGROW);
47                 }
48         }
49
50         /**
51         **      Adds a new control to the panel (sizer, radiob, etc)
52         **/
53         virtual void addControl(wxSizer* sizer){
54                 if(sizercontrols!=NULL){
55                         sizercontrols->Add(sizer, wxGROW);
56                 }
57         }
58
59         /**
60         **      Hides or show the controls in the panel
61         **/
62         virtual void onActionButtonPressedHide( wxCommandEvent& event ){
63                 wxList list = sizercontrols->GetChildren();             
64                 int i;
65                 for(i=0; i<list.size();i++){
66                         sizercontrols->Show(i,show);
67                 }
68                 show = !show;
69                 sizercontrols->Layout();
70                 this->Layout();
71         }
72
73     /**
74         **      The user must implement this function to remove the panel from the 
75         **/
76         //virtual void onActionButtonPressedEliminate( wxCommandEvent& event )=0;
77
78         /**
79         **      The user must implement this function to add the necessary controls to the panel
80         **/
81         virtual void createControls( )=0;
82         
83         /**
84         ** returns the id of the panel
85         **/
86         int getPropId(){
87                 return _propid;
88         }
89
90         /**
91         ** Returns the papnel id
92         **/
93         int getPanId(){
94                 return panID;
95         }
96
97         /**
98         ** Tells if the panel is used for a complex box
99         **/
100         bool isComplex(){
101                 return isComplexBox;
102         }
103
104 private:
105         wxBoxSizer* sizercontrols;
106         bool show;
107 protected:
108         int _propid;
109         
110         //-- Atributes added for complex box --//
111         bool isComplexBox;
112         int panID;
113 };
114
115 #endif /*WXMARACASSURFACERENDERINGPANEL_H_*/