]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
#3129 creaContours Feature New Normal - branch changeWx28to30 compilation with...
[creaContours.git] / lib / Interface_Icons_NDimensions / interfToolsPanels.cxx
index fc28256cfa42ac89005724d16cf095cfb52da10c..f59c2e20262870de974c22492878cc93331ad8df 100644 (file)
@@ -195,7 +195,15 @@ void interfSpreadPanel::appendStringSpread(std::string val){
        /* // if */
        wxString newstring;
        //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8));
+#else
+       newstring.append( _wxtextctrlSpread->GetValue() );
+#endif
+
+
        newstring.append(wxString(" ",wxConvUTF8));
        newstring.append(wxString(val.c_str(),wxConvUTF8));
        _wxtextctrlSpread->SetValue(newstring);
@@ -326,7 +334,12 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
 
        FillGridWithContoursInformation();
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2);
+#else
+       wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2);
+#endif
        sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: "))  , 1, wxGROW );
        sizerSave->Add( _XYZValues,    1, wxALL, 2 );
        sizerSave->Add( _statistics,   1, wxALL, 2 );
@@ -344,7 +357,12 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        sizerB->Add( showResultImagesBtn,         1, wxALL, 2 );
        sizerB->Add( saveResultsBtn,              1, wxALL, 2 );
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(1,8);
+#else
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(8);
+#endif
        sizer->Add( sizerA                     , 1, wxALL               , 0 );
        sizer->Add( new wxStaticText(this      ,-1,_T("Slice Range"))   , 1, wxALL , 0 );
        sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
@@ -409,7 +427,12 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){
 
 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
+#else
+       wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxFD_SAVE );
+#endif
        if (dialog.ShowModal() == wxID_OK)
        {
                onExtractInformation( event );
@@ -551,3 +574,55 @@ void interfCalibrationPanel::onCalibrate(wxCommandEvent& event)
 }
 //------------------------------------------------------------------------------------------------------------
 
+
+
+//////////////////////////////////////////////////////////////
+
+interfFlipPanel::interfFlipPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+       wxButton *buttonFlipX = new wxButton(this,wxID_ANY,_T("Flip Horizontally"), wxDefaultPosition, wxSize(200,35) );
+       wxButton *buttonFlipY = new wxButton(this,wxID_ANY,_T("Flip Vertically"), wxDefaultPosition, wxSize(200,35) );
+
+       wxString lstOptions[3];
+       lstOptions[0]=_T("Flip selected contours");
+       lstOptions[1]=_T("Flip all contours of actual slice");
+       lstOptions[2]=_T("Flip all contours");
+       _wichContoursRadioBox = new wxRadioBox(this, -1, _T("Transform"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions,  1, wxRA_SPECIFY_COLS);
+       _wichContoursRadioBox->SetSelection(2);
+
+       
+       Connect( buttonFlipX->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipXPressed );
+       Connect( buttonFlipY->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipYPressed ); 
+       
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       sizer -> Add( _wichContoursRadioBox, 1, wxGROW );
+       sizer -> Add( buttonFlipX, 1, wxGROW );
+       sizer -> Add( buttonFlipY, 1, wxGROW );
+
+       this->SetSizer( sizer );
+       this->SetAutoLayout( true );
+       this->Layout();
+}
+
+
+
+
+interfFlipPanel::~interfFlipPanel(){
+}
+
+void interfFlipPanel::onFlipXPressed(wxCommandEvent& event)
+{
+       std::cout << "interfToolsPanels.cxx  interfFlipPanel::onFlipXPressed     FlipX (btn)" << std::endl;
+       int typeContoursFlip = _wichContoursRadioBox->GetSelection(); 
+       interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 0 );  // type, direction
+}
+
+void interfFlipPanel::onFlipYPressed(wxCommandEvent& event)
+{
+       std::cout << "interfToolsPanels.cxx   interfFlipPanel::onFlipYPressed FlipY  (btn)" << std::endl;
+       int typeContoursFlip = _wichContoursRadioBox->GetSelection(); 
+       interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 1 );  // type, direction
+}
+
+