]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfMainPanel.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.cxx
index 7d43990be32d4a103f11e4e1f2853d810bd07850..4c67ae203886dbfcf780602e50833104284b8c1c 100644 (file)
@@ -375,7 +375,31 @@ void interfMainPanel::showPanel(wxWindow* panel){
        infoPanel->Refresh();
        this->Layout();
        this->Refresh();
+}
+
+/**
+**     Hide the panel in the 
+**/
+void interfMainPanel::hidePanel( ){
+       wxContourMainFrame::getInstance()->showAxis(false);
+       wxSizer* sizer = infoPanel->GetSizer();
+
+       if(currentWindow != NULL){
+               currentWindow->Hide();
+               sizer->Remove(currentWindow);
+       }
+       wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+       sizer->Add(emptyPanel);
+    currentWindow = emptyPanel;
+       currentWindow->Show(true);
 
+       splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
+       splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
+
+       infoPanel->Layout();
+       infoPanel->Refresh();
+       this->Layout();
+       this->Refresh();
 }
 
 /**
@@ -700,9 +724,30 @@ void interfMainPanel::onMirrorPressed(){
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelMirror, wxEXPAND);
                mirrorPanel->Layout();
+
+               refLineShown=true;
+
+               showPanel(mirrorPanel);
+               wxContourMainFrame::getInstance()->referenceLine();
        }       
-       showPanel(mirrorPanel);
-       //hideAxis();
 
-       wxContourMainFrame::getInstance()->referenceLine();
+       else
+       {
+               if(refLineShown)
+               {
+                       wxContourMainFrame::getInstance()->refLineHide();
+                       refLineShown=false;
+
+                       hidePanel();
+               }
+
+               else if (!refLineShown)
+               {
+                       wxContourMainFrame::getInstance()->refLineShow();
+                       refLineShown=true;
+
+                       showPanel(mirrorPanel);
+               }
+       }
+
 }