]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfMainPanel.cxx
3332 creaContours Feature New Normal - DialogBox confirmation for Delete All contours
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.cxx
index 4734ae083a43b83defb06227c25abad91bf54615..4aeacae0a2034e9e341c9cd3ab4c7e5ed30b3f27 100644 (file)
@@ -23,8 +23,9 @@
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-#include "interfMainPanel.h"
+#include <wx/msgdlg.h>
 
+#include "interfMainPanel.h"
 
 interfMainPanel        *interfMainPanel::interfmainpanel       = NULL;
 wxFrame                        *interfMainPanel::_newframe                     = NULL;
@@ -405,22 +406,30 @@ void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull)
        wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
 }
 
-void interfMainPanel::onDeleteContour()
+void interfMainPanel::onDeleteContoursActSlice()
 {
        wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteContour();
+       wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
 }
 
-void interfMainPanel::onDeleteContoursActSlice()
+void interfMainPanel::onDeleteContour()
 {
        wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
+       wxContourMainFrame::getInstance()->onDeleteContour();
 }
 
 void interfMainPanel::onDeleteAllContours()
 {
-       wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteAllContours();
+    wxMessageDialog *dial;
+       dial=new wxMessageDialog(       NULL,
+                                                               wxT("Delete all contours of the system?"), 
+                                                               wxT("Warnning!"), 
+                                                               wxOK | wxCANCEL | wxICON_QUESTION   );
+       if (dial->ShowModal()==wxID_OK)
+       {
+               wxContourMainFrame::getInstance()->showAxis(false);
+               wxContourMainFrame::getInstance()->onDeleteAllContours();
+       } // if OK
 }
 
 void interfMainPanel::onCopy()