From 6169c4084c0371bd7bf8d961b4bad3a1f58ba12b Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 6 Jan 2020 12:05:32 +0100 Subject: [PATCH] 3332 creaContours Feature New Normal - DialogBox confirmation for Delete All contours --- .../interfDeleteMenu.cxx | 15 ++++++++---- .../interfDeleteMenu.h | 5 +--- .../interfMainPanel.cxx | 23 +++++++++++++------ .../interfMainPanel.h | 2 +- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx b/lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx index 72935f2..20f99ce 100644 --- a/lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx @@ -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(); } diff --git a/lib/Interface_Icons_NDimensions/interfDeleteMenu.h b/lib/Interface_Icons_NDimensions/interfDeleteMenu.h index 73d4c11..d80b90c 100644 --- a/lib/Interface_Icons_NDimensions/interfDeleteMenu.h +++ b/lib/Interface_Icons_NDimensions/interfDeleteMenu.h @@ -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 diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index 4734ae0..4aeacae 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -23,8 +23,9 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ */ -#include "interfMainPanel.h" +#include +#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() diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.h b/lib/Interface_Icons_NDimensions/interfMainPanel.h index 8ac450a..25a0fda 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.h +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.h @@ -131,8 +131,8 @@ public: void onCreateContoursBullEye(wxPanel* panBull); ///////////////////////////////// - void onDeleteContour(); void onDeleteContoursActSlice(); + void onDeleteContour(); void onDeleteAllContours(); ///////////////////////// void onCopy(); -- 2.47.1