]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane_in_MPR.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxWidgetMesure2D_Plane_in_MPR.cxx
1 #include "wxWidgetMesure2D_Plane_in_MPR.h"
2
3 wxWidgetMesure2D_Plane_in_MPR::wxWidgetMesure2D_Plane_in_MPR(wxWindow *parent)
4 :wxWidgetMesure2D_Plane(parent)
5 {
6         _vtkplane2Dview=NULL;
7 }
8
9 //-------------------------------------------------------------------
10
11 wxWidgetMesure2D_Plane_in_MPR::~wxWidgetMesure2D_Plane_in_MPR()
12 {
13 }
14 //-------------------------------------------------------------------
15 void wxWidgetMesure2D_Plane_in_MPR::OnActiveLink(wxCommandEvent& event)
16 {
17         if (_vtkplane2Dview!=NULL)
18         {
19                 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
20                 _vtkplane2Dview->Refresh();
21                 _vtkplane2Dview->RefreshView();
22         }
23 }
24
25
26 //-------------------------------------------------------------------
27 void wxWidgetMesure2D_Plane_in_MPR::SetActiveLink(bool ok)
28 {
29         _cb_link->SetValue(ok);
30         if (_vtkplane2Dview!=NULL)
31         {
32                 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
33         }
34 }
35 //-------------------------------------------------------------------
36
37 void wxWidgetMesure2D_Plane_in_MPR::SetVtkPlane2DView(vtkPlane2DView *vtkplane2Dview)
38 {
39         _vtkplane2Dview = vtkplane2Dview;
40 }
41
42 //-------------------------------------------------------------------
43
44 wxWindow *wxWidgetMesure2D_Plane_in_MPR::CreateWin1a(wxWindow *parent) // virtual
45 {
46         wxPanel *panel = new wxPanel(parent,-1);
47
48         _cb_link                = new wxCheckBox(panel,-1,_T("LINK                    ")); 
49         _cb_link->SetValue(true);
50
51         wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
52
53         sizer->Add(_cb_link);
54
55         sizer->Add( wxWidgetMesure2D_Plane::CreateWin1a(panel) );
56
57         panel->SetAutoLayout(true);
58         panel->SetSizer(sizer);
59         panel->SetSize(400,30);
60         panel->Layout();
61
62 //EEDxx2.4
63 //      panel->FitInside();
64
65         Connect(_cb_link->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxWidgetMesure2D_Plane_in_MPR::OnActiveLink );
66
67         return panel;
68 }
69