1 #include "wxWidgetMesure2D_Plane_in_MPR.h"
3 wxWidgetMesure2D_Plane_in_MPR::wxWidgetMesure2D_Plane_in_MPR(wxWindow *parent)
4 :wxWidgetMesure2D_Plane(parent)
9 //-------------------------------------------------------------------
11 wxWidgetMesure2D_Plane_in_MPR::~wxWidgetMesure2D_Plane_in_MPR()
14 //-------------------------------------------------------------------
15 void wxWidgetMesure2D_Plane_in_MPR::OnActiveLink(wxCommandEvent& event)
17 if (_vtkplane2Dview!=NULL)
19 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
20 _vtkplane2Dview->Refresh();
21 _vtkplane2Dview->RefreshView();
26 //-------------------------------------------------------------------
27 void wxWidgetMesure2D_Plane_in_MPR::SetActiveLink(bool ok)
29 _cb_link->SetValue(ok);
30 if (_vtkplane2Dview!=NULL)
32 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
35 //-------------------------------------------------------------------
37 void wxWidgetMesure2D_Plane_in_MPR::SetVtkPlane2DView(vtkPlane2DView *vtkplane2Dview)
39 _vtkplane2Dview = vtkplane2Dview;
42 //-------------------------------------------------------------------
44 wxWindow *wxWidgetMesure2D_Plane_in_MPR::CreateWin1a(wxWindow *parent) // virtual
46 wxPanel *panel = new wxPanel(parent,-1);
48 _cb_link = new wxCheckBox(panel,-1,_T("LINK "));
49 _cb_link->SetValue(true);
51 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
55 sizer->Add( wxWidgetMesure2D_Plane::CreateWin1a(panel) );
57 panel->SetAutoLayout(true);
58 panel->SetSizer(sizer);
59 panel->SetSize(400,30);
63 // panel->FitInside();
65 Connect(_cb_link->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxWidgetMesure2D_Plane_in_MPR::OnActiveLink );