#include <wx/cmdline.h>
#include <vector>
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_PARAM, NULL, NULL, _T("file1 [file2 [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Prints this help") },
+ { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Message all 9") },
+ { wxCMD_LINE_NONE }
+ };
+#else
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_PARAM, NULL, NULL, "file1 [file2 [...]]", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, "h", "help", "Prints this help" },
+ { wxCMD_LINE_SWITCH, "d", "debug", "Message all 9" },
+ { wxCMD_LINE_NONE }
+ };
+#endif
-static const wxCmdLineEntryDesc cmdLineDesc[] =
-{
- { wxCMD_LINE_PARAM, NULL, NULL, _T("file1 [file2 [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
- { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Prints this help") },
- { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Message all 9") },
- { wxCMD_LINE_NONE }
-};
#include <map>
//==========================================================================
-// Command line options definition
-static const wxCmdLineEntryDesc cmdLineDesc[] =
-{
- { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("print this help or help on the application defined in input bbs file if any") },
- { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"), _T("prompt the input parameter values using graphical dialog") },
- { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"), _T("prompt the input parameter values in text mode") },
- { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open bbi console") },
- { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"), _T("never open bbi console even on error") },
- { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"), _T("be quiet (='message max 0')") },
- { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("turn all messages on (='message all 9')") },
- { wxCMD_LINE_SWITCH, _T("D"), _T("Debug"), _T("memory debug on exit (='debug -D')") },
- { wxCMD_LINE_PARAM, NULL, NULL, _T("file [file [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
- { wxCMD_LINE_NONE }
-};
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ // Command line options definition
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("print this help or help on the application defined in input bbs file if any") },
+ { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"), _T("prompt the input parameter values using graphical dialog") },
+ { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"), _T("prompt the input parameter values in text mode") },
+ { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open bbi console") },
+ { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"), _T("never open bbi console even on error") },
+ { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"), _T("be quiet (='message max 0')") },
+ { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("turn all messages on (='message all 9')") },
+ { wxCMD_LINE_SWITCH, _T("D"), _T("Debug"), _T("memory debug on exit (='debug -D')") },
+ { wxCMD_LINE_PARAM, NULL, NULL, _T("file [file [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+ { wxCMD_LINE_NONE }
+ };
+#else
+ // Command line options definition
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_SWITCH, "h", "help", "print this help or help on the application defined in input bbs file if any" },
+ { wxCMD_LINE_SWITCH, "g", "graphical-dialog", "prompt the input parameter values using graphical dialog" },
+ { wxCMD_LINE_SWITCH, "t", "text-dialog", "prompt the input parameter values in text mode" },
+ { wxCMD_LINE_SWITCH, "c", "console", "open bbi console" },
+ { wxCMD_LINE_SWITCH, "N", "no-console", "never open bbi console even on error" },
+ { wxCMD_LINE_SWITCH, "q", "quiet", "be quiet (='message max 0')" },
+ { wxCMD_LINE_SWITCH, "d", "debug", "turn all messages on (='message all 9')" },
+ { wxCMD_LINE_SWITCH, "D", "Debug", "memory debug on exit (='debug -D')" },
+ { wxCMD_LINE_PARAM, NULL, NULL, "file [file [...]]", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+ { wxCMD_LINE_NONE }
+ };
+#endif
+
+
+
+
//==========================================================================
//==========================================================================
std::string stdDir = default_doc_dir+"/share/bbtk/bbs";
wxString defaultDir(stdDir.c_str(), wxConvUTF8);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(this, _T("Include file"),defaultDir, _T(""), _T("*.bbs"), wxOPEN );
+#else
+ wxFileDialog dialog(this, _T("Include file"),defaultDir, _T(""), _T("*.bbs"), wxFD_OPEN );
+#endif
+
if (dialog.ShowModal() == wxID_OK)
{
// std::string command(_T("include "));
// std::cout << "-------------- SAVE ---------------"<<std::endl;
if (mAskFilename)
{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
_T(""),std2wx(filter),
wxSAVE | wxOVERWRITE_PROMPT );
+#else
+ wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
+ _T(""),std2wx(filter),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
+#endif
+
int result_fd = fd->ShowModal();
// This line is need it by windows // EED
{
// std::cout << "-------------- OPEN ---------------"<<std::endl;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
_T(""),std2wx(mFileNameFilter),
wxOPEN | wxFILE_MUST_EXIST );
+#else
+ wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
+ _T(""),std2wx(mFileNameFilter),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST );
+#endif
int result_fd = fd->ShowModal();
// This line is need it by windows //EED
long style;
if (bbGetInputOpenSave()=="Save")
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
style = wxSAVE | wxOVERWRITE_PROMPT;
- }
- else
- {
+#else
+ style = wxFD_SAVE | wxFD_OVERWRITE_PROMPT;
+#endif
+ } else {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
style = wxOPEN | wxFILE_MUST_EXIST;
+#else
+ style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
+#endif
+
}
std::string wc(bbGetInputWildcard());
#endif //VTK_USE_COCOA
#endif //__WXCOCOA__
-#ifdef __WXGTK__
-# include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
-# include "gdk/gdkprivate.h"
-#if wxCHECK_VERSION(2, 8, 0)
-#ifdef __WXGTK20__
-#include <wx/gtk/win_gtk.h>
-#else
-#include <wx/gtk1/win_gtk.h>
-#endif
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ #ifdef __WXGTK__
+ #include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
+ #include "gdk/gdkprivate.h"
+ #if wxCHECK_VERSION(2, 8, 0)
+ #ifdef __WXGTK20__
+ #include <wx/gtk/win_gtk.h>
+ #else
+ #include <wx/gtk1/win_gtk.h>
+ #endif
+ #else
+ #include <wx/gtk/win_gtk.h>
+ #endif
+ #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
+ GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
+ GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+ #endif
#else
-#include <wx/gtk/win_gtk.h>
-#endif
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
- GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
- GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+ #ifdef __WXGTK__
+ #include <gdk/gdkx.h>
+ #include <gtk/gtk.h>
+ #endif
#endif
+
+
#ifdef __WXX11__
#include "wx/x11/privx.h"
#define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle())
// Find and return the actual X-Window.
#if defined(__WXGTK__) || defined(__WXX11__)
- return (long)GetXWindow(this);
+
+ //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+ #if wxMAJOR_VERSION <= 2
+ return (long)GetXWindow(this);
+ #else
+ GdkWindow* Win = gtk_widget_get_window( (GtkWidget *) GetHandle() );
+ return (long int)GDK_WINDOW_XDISPLAY(Win);
+ #endif
+
#endif
//#ifdef __WXMOTIF__