]> Creatis software - creaContours.git/commitdiff
3332 creaContours Feature New Normal - DialogBox confirmation for Delete All contours
authorEduardo DAVILA <davila@localhost.localdomain>
Mon, 6 Jan 2020 11:05:32 +0000 (12:05 +0100)
committerEduardo DAVILA <davila@localhost.localdomain>
Mon, 6 Jan 2020 11:05:32 +0000 (12:05 +0100)
lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx
lib/Interface_Icons_NDimensions/interfDeleteMenu.h
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.h

index 72935f23a8c991bbceafafe95a22c395ecc15466..20f99ce54371982f617eebc51c49926ffd8f01de 100644 (file)
@@ -61,13 +61,18 @@ interfDeleteMenu::~interfDeleteMenu()
 }
 
 
-void interfDeleteMenu::onDeleteContour(wxCommandEvent& event){
-       interfMainPanel::getInstance()->onDeleteContour();
-}
-void interfDeleteMenu::onDeleteContoursActSlice(wxCommandEvent& event){
+void interfDeleteMenu::onDeleteContoursActSlice(wxCommandEvent& event)
+{
        interfMainPanel::getInstance()->onDeleteContoursActSlice();
 }
-void interfDeleteMenu::onDeleteAllContours(wxCommandEvent& event){
+
+void interfDeleteMenu::onDeleteContour(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onDeleteContour();
+}
+
+void interfDeleteMenu::onDeleteAllContours(wxCommandEvent& event)
+{
        interfMainPanel::getInstance()->onDeleteAllContours();
 }
 
index 73d4c119d5395a2c8e3278e5e7b1b03235ba8f6c..d80b90ce07450f94d1f9cf0084d9e0c16b4e61db 100644 (file)
@@ -36,18 +36,15 @@ class interfDeleteMenu
 public:
        interfDeleteMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir = "data/Icons");          
        ~interfDeleteMenu();
-
     virtual void initButtons(wxEvtHandler* evtHandler) ;
-
 private:
        /**
        **  This methods are in charge of responding to the events of button click by the delete panel
        **  @params wxCommandEvent& the event that call the function
        **/
-       void onDeleteContour(wxCommandEvent& event);
        void onDeleteContoursActSlice(wxCommandEvent& event);
+       void onDeleteContour(wxCommandEvent& event);
        void onDeleteAllContours(wxCommandEvent& event);
-       
 };
 
 #endif
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()
index 8ac450a520c5732e5027a1ad7f854f4e27cb0120..25a0fdacadcf299a639fedfb6cdc905709d33f34 100644 (file)
@@ -131,8 +131,8 @@ public:
 
        void onCreateContoursBullEye(wxPanel* panBull);
        /////////////////////////////////
-       void onDeleteContour();
        void onDeleteContoursActSlice();
+       void onDeleteContour();
        void onDeleteAllContours();
        /////////////////////////
        void onCopy();