interfMirrorPanel::interfMirrorPanel(wxWindow* parent)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
- wxButton *axisShowBtn = new wxButton(this,wxID_ANY,_T("Show Axis"), wxDefaultPosition, wxSize(200,35) );
- wxButton *axisHideBtn = new wxButton(this,wxID_ANY,_T("Hide Axis"), wxDefaultPosition, wxSize(200,35) );
+ _axisStatus = true;
+
+ wxButton *axisShowBtn = new wxButton(this,wxID_ANY,_T("Show/Hide Axis"), wxDefaultPosition, wxSize(200,35) );
wxButton *mirrorGoBtn = new wxButton(this,wxID_ANY,_T("Mirror Contour"), wxDefaultPosition, wxSize(200,35) );
_thickness = new wxSlider(this, -1, 4, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
Connect( axisShowBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onAxisShow );
- Connect( axisHideBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onAxisHide );
Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
sizer -> Add( axisShowBtn, 1, wxGROW );
- sizer -> Add( axisHideBtn, 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1,_T("Thickness")) , 1, wxGROW );
sizer -> Add( _thickness, 1, wxGROW );
void interfMirrorPanel::onAxisShow(wxCommandEvent& event)
{
- interfMainPanel::getInstance()->onMirrorAxisShow();
-}
-
-void interfMirrorPanel::onAxisHide(wxCommandEvent& event)
-{
- interfMainPanel::getInstance()->onMirrorAxisHide();
+
+ if (!_axisStatus)
+ {
+ interfMainPanel::getInstance()->onMirrorAxisShow();
+ _axisStatus=true;
+ }
+ else
+ {
+ interfMainPanel::getInstance()->onMirrorAxisHide();
+ _axisStatus=false;
+ }
}
void interfMirrorPanel::onMirrorGo(wxCommandEvent& event)
{
- interfMainPanel::getInstance()->onMirror();
+ if (_axisStatus)
+ {
+ interfMainPanel::getInstance()->onMirror();
+ }
}
void interfMirrorPanel::onChangeWidth(wxScrollEvent& event)