]> Creatis software - creaMaracasVisu.git/blob - lib/GUI/Wx/SurfaceRenderer/wxMaracasSurfaceRenderingPanel.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / GUI / Wx / SurfaceRenderer / wxMaracasSurfaceRenderingPanel.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifndef WXMARACASSURFACERENDERINGPANEL_H_
27 #define WXMARACASSURFACERENDERINGPANEL_H_
28
29 #include "wx/wx.h"
30
31 class wxMaracasSurfaceRenderingPanel : public wxPanel{
32 public:
33         wxMaracasSurfaceRenderingPanel(wxWindow* parent, int propid, bool _isComplexBox, int _panID)
34                 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
35                         createPanel();
36                         isComplexBox = _isComplexBox;
37                         panID = _panID;
38                         _propid = propid;
39         }       
40         //virtual ~wxMaracasSurfaceRenderingPanel();
41         virtual void createPanel(){
42                 show = false;
43         /*wxBoxSizer* sizerButtons = new wxBoxSizer(wxVERTICAL);
44
45                 wxButton* b = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
46                                                                 wxDefaultValidator, wxString(_T("-"))); 
47                 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingPanel::onActionButtonPressedHide);
48                 wxButton* b1 = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
49                                                                 wxDefaultValidator, wxString(_T("x"))); 
50                 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingPanel::onActionButtonPressedEliminate);
51
52                 sizerButtons->Add(b, wxFIXED_MINSIZE);
53                 sizerButtons->Add(b1, wxFIXED_MINSIZE);*/
54
55                 sizercontrols = new wxBoxSizer(wxVERTICAL);
56
57                 wxBoxSizer* sizerpanel = new wxBoxSizer(wxHORIZONTAL);
58
59                 //sizerpanel->Add(sizerButtons,wxGROW);
60                 sizerpanel->Add(sizercontrols,wxGROW);
61         
62                 this->SetSizer(sizerpanel, true);               
63                 this->SetAutoLayout( true );
64         }
65
66         /**
67         **      Adds a new control to the panel (sizer, radiob, etc)
68         **/
69         virtual void addControl(wxWindow* win){
70                 if(sizercontrols!=NULL){
71                         sizercontrols->Add(win, wxGROW);
72                 }
73         }
74
75         /**
76         **      Adds a new control to the panel (sizer, radiob, etc)
77         **/
78         virtual void addControl(wxSizer* sizer){
79                 if(sizercontrols!=NULL){
80                         sizercontrols->Add(sizer, wxGROW);
81                 }
82         }
83
84         /**
85         **      Hides or show the controls in the panel
86         **/
87         virtual void onActionButtonPressedHide( wxCommandEvent& event ){
88         /// \TODO : fix deprecated : wxListBase::operator wxList&() const is deprecated  // JPR
89                 wxList list = sizercontrols->GetChildren();             
90                 int i;
91                 for(i=0; i<(int)list.size();i++){
92                         sizercontrols->Show(i,show);
93                 }
94                 show = !show;
95                 sizercontrols->Layout();
96                 this->Layout();
97         }
98
99     /**
100         **      The user must implement this function to remove the panel from the 
101         **/
102         //virtual void onActionButtonPressedEliminate( wxCommandEvent& event )=0;
103
104         /**
105         **      The user must implement this function to add the necessary controls to the panel
106         **/
107         virtual void createControls( )=0;
108         
109         /**
110         ** returns the id of the panel
111         **/
112         int getPropId(){
113                 return _propid;
114         }
115
116         /**
117         ** Returns the papnel id
118         **/
119         int getPanId(){
120                 return panID;
121         }
122
123         /**
124         ** Tells if the panel is used for a complex box
125         **/
126         bool isComplex(){
127                 return isComplexBox;
128         }
129
130 private:
131         wxBoxSizer* sizercontrols;
132         bool show;
133 protected:
134         int _propid;
135         
136         //-- Atributes added for complex box --//
137         bool isComplexBox;
138         int panID;
139 };
140
141 #endif /*WXMARACASSURFACERENDERINGPANEL_H_*/