]> Creatis software - bbtkGEditor.git/commitdiff
#3132 bbGEditor Feature New Normal - branch changeWx28to30 compilation with wxWidgets3
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 15:30:38 +0000 (17:30 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 15:30:38 +0000 (17:30 +0200)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx

index 8d57977bdddad8338abfda8f21e5a1c845e0ad81..b5355ea108a2b0c4456c7b1e938f5ddcb078174a 100644 (file)
@@ -691,7 +691,12 @@ void wxGUIEditorGraphicBBS::OpenBBS(std::string filePathName, std::string fileNa
 //=========================================================================
 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event) 
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"), wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxOPEN);
+#else
+       wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"), wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxFD_OPEN);
+#endif
 
        if (openFileDialog->ShowModal() == wxID_OK) 
        {
@@ -736,9 +741,18 @@ void wxGUIEditorGraphicBBS::SaveActualBBS(std::string filename) {
 }
 
 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event) {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * saveFileDialog = new wxFileDialog(this,
                        wxT("Save  actual BBS"), wxEmptyString, wxT("NewBBS"),
                        wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+       wxFileDialog * saveFileDialog = new wxFileDialog(this,
+                       wxT("Save  actual BBS"), wxEmptyString, wxT("NewBBS"),
+                       wxT("*.bbs"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
        if (saveFileDialog->ShowModal() == wxID_OK) {
                wxString fileName = saveFileDialog->GetPath();
                std::string filename = (const char*) (fileName.mb_str());
@@ -799,11 +813,21 @@ void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename) {
 
 //=========================================================================
 
-void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event) {
+void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event) 
+{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * saveFileDialog = new wxFileDialog(this,
                        wxT("Save Complex Box BBS"), wxEmptyString,
                        _T("ComplexBoxName"), wxT("*.bbs"), wxSAVE
                                        | wxOVERWRITE_PROMPT);
+#else
+       wxFileDialog * saveFileDialog = new wxFileDialog(this,
+                       wxT("Save Complex Box BBS"), wxEmptyString,
+                       _T("ComplexBoxName"), wxT("*.bbs"), wxFD_SAVE
+                                       | wxFD_OVERWRITE_PROMPT);
+#endif
+
        if (saveFileDialog->ShowModal() == wxID_OK) {
                wxString fileName = saveFileDialog->GetPath();
                std::string filename = (const char*) (fileName.mb_str());
@@ -858,10 +882,20 @@ void wxGUIEditorGraphicBBS::SaveTempActualDiagram(const std::string &action)
 
 //The following method allows to save the current diagram asking the filename
 //DFCH
-void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs() {
+void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs() 
+{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * saveFileDialog = new wxFileDialog(this,
                        wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
                        wxT("*.bbg"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+       wxFileDialog * saveFileDialog = new wxFileDialog(this,
+                       wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
+                       wxT("*.bbg"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
        if (saveFileDialog->ShowModal() == wxID_OK) {
                //_tabsMgr->SetNameTabPanel(saveFileDialog->GetFilename());
                wxString pathfileName = saveFileDialog->GetPath();
@@ -921,9 +955,17 @@ void wxGUIEditorGraphicBBS::OnSaveAsActualDiagram(wxCommandEvent& event) {
 //=========================================================================
 void wxGUIEditorGraphicBBS::OnExportConsoleExecCommand(wxCommandEvent& event)
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * saveFileDialog = new wxFileDialog(this,
                        wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
                        wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+       wxFileDialog * saveFileDialog = new wxFileDialog(this,
+                       wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
+                       wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
 
        if (saveFileDialog->ShowModal() == wxID_OK)
        {
@@ -1100,7 +1142,14 @@ void wxGUIEditorGraphicBBS::OpenDiagram(std::string filePathName, std::string fi
 
 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) 
 {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST);
+#else
+       wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), wxEmptyString, wxT(""), wxT("*.bbg"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
+#endif
+
        if (openFileDialog->ShowModal() == wxID_OK) 
        {
                wxString filePath = openFileDialog->GetPath();