]> Creatis software - bbtkGEditor.git/blob - appli/bbEditor/bbEditor.cxx
This commit was manufactured by cvs2svn to create tag
[bbtkGEditor.git] / appli / bbEditor / bbEditor.cxx
1 #ifdef _USE_WXWIDGETS_
2
3 //==========================================================================
4 // WITH WX
5 //==========================================================================
6
7 #include "bbtkwxGUIEditorGraphicBBS.h"
8
9 #include <wx/cmdline.h> 
10 #include <wx/app.h>
11 #include <wx/sysopt.h>
12  
13 class wxBBEditorApp : public wxApp
14 {
15 public:
16   bool OnInit( ); 
17   int  OnExit() { return true; }
18
19 };
20   
21 IMPLEMENT_APP(wxBBEditorApp);
22  
23  
24
25 // ----------------------------------------------------------------------------
26 // The `main program' equivalent, creating the windows and returning the
27 // main frame
28 bool wxBBEditorApp::OnInit( )
29 {
30 #ifdef MACOSX
31         /* assume this is OSX */
32         wxSystemOptions::SetOption("mac.listctrl.always_use_generic", 1);
33 #endif
34
35         wxApp::OnInit();
36 #ifdef __WXGTK__
37   //See http://www.wxwindows.org/faqgtk.htm#locale
38   setlocale(LC_NUMERIC, "C");
39 #endif
40
41         bbtk::wxGUIEditorGraphicBBS *iegbbs; 
42         iegbbs = new bbtk::wxGUIEditorGraphicBBS(NULL);
43         SetTopWindow(iegbbs);  
44         iegbbs->Show(true);
45
46         return true;
47 }
48
49
50 #if defined(_WIN32) 
51
52 //  How to have a Console and wxWidgets
53 //  http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide
54 //   In Visual C++ 6 (7 should be similar), to create an application that is both a console application 
55 //  (cout's to the console are visible) and has a wxWidgets GUI, 
56 //  you need to use the linker option "/subsystem:console" and the following code:
57 int main(int argc, char* argv[])
58 {
59         return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
60 }
61
62 #endif // defined(_WIN32) 
63
64
65 #else
66 //==========================================================================
67 // WITHOUT WX
68 //==========================================================================
69 #include <iostream>
70 int main(int argc, char* argv[])
71 {  
72   std::cout << "bbStudio was not compiled with wxWidgets : ciao !" <<std::endl;
73   return 0;
74 }
75
76 // EOF
77 #endif //#ifdef _USE_WXWIDGETS_
78
79
80