bbEditor.cxx

Go to the documentation of this file.
00001 #ifdef _USE_WXWIDGETS_
00002 
00003 //==========================================================================
00004 // WITH WX
00005 //==========================================================================
00006 
00007 #include "bbtkwxGUIEditorGraphicBBS.h"
00008 
00009 #include <wx/cmdline.h>
00010 #include <wx/app.h>
00011 #include <wx/sysopt.h>
00012 
00013 class wxBBEditorApp : public wxApp
00014 {
00015 public:
00016   bool OnInit( );
00017   int  OnExit() { return true; }
00018 };
00019 
00020 IMPLEMENT_APP(wxBBEditorApp);
00021 
00022 
00023 
00024 // ----------------------------------------------------------------------------
00025 // The `main program' equivalent, creating the windows and returning the
00026 // main frame
00027 bool wxBBEditorApp::OnInit( )
00028 {
00029 #ifdef MACOSX
00030         /* assume this is OSX */
00031         wxSystemOptions::SetOption("mac.listctrl.always_use_generic", 1);
00032 #endif
00033 
00034         wxApp::OnInit();
00035 #ifdef __WXGTK__
00036   //See http://www.wxwindows.org/faqgtk.htm#locale
00037   setlocale(LC_NUMERIC, "C");
00038 #endif
00039 
00040         bbtk::wxGUIEditorGraphicBBS *iegbbs;
00041 printf("EED wxBBEditorApp::OnInit 0\n");
00042         iegbbs = new bbtk::wxGUIEditorGraphicBBS(NULL);
00043 printf("EED wxBBEditorApp::OnInit 1\n");
00044         SetTopWindow(iegbbs);
00045         iegbbs->Show(true);
00046 printf("EED wxBBEditorApp::OnInit 2\n");
00047 
00048         return true;
00049 }
00050 
00051 
00052 #if defined(_WIN32)
00053 
00054 //  How to have a Console and wxWidgets
00055 //  http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide
00056 //   In Visual C++ 6 (7 should be similar), to create an application that is both a console application
00057 //  (cout's to the console are visible) and has a wxWidgets GUI,
00058 //  you need to use the linker option "/subsystem:console" and the following code:
00059 int main(int argc, char* argv[])
00060 {
00061         return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
00062 }
00063 
00064 #endif // defined(_WIN32)
00065 
00066 
00067 #else
00068 //==========================================================================
00069 // WITHOUT WX
00070 //==========================================================================
00071 #include <iostream>
00072 int main(int argc, char* argv[])
00073 {
00074   std::cout << "bbStudio was not compiled with wxWidgets : ciao !" <<std::endl;
00075   return 0;
00076 }
00077 
00078 // EOF
00079 #endif //#ifdef _USE_WXWIDGETS_
00080 
00081 
00082 

Generated on Thu May 31 15:12:19 2012 for bbtkGEditor by  doxygen 1.5.7.1