]> Creatis software - bbtkGEditor.git/blob - appli/bbEditor/bbEditor.cxx
hi ..
[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
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 // ----------------------------------------------------------------------------
27 // The `main program' equivalent, creating the windows and returning the
28 // main frame
29 bool wxBBEditorApp::OnInit( )
30 {
31   wxApp::OnInit();
32 #ifdef __WXGTK__
33   //See http://www.wxwindows.org/faqgtk.htm#locale
34   setlocale(LC_NUMERIC, "C");
35 #endif
36
37         bbtk::wxGUIEditorGraphicBBS *iegbbs; 
38         iegbbs = new bbtk::wxGUIEditorGraphicBBS(NULL);
39         SetTopWindow(iegbbs);  
40         iegbbs->Show(true);
41
42         return true;
43 }
44
45
46 #if defined(_WIN32) 
47
48 //  How to have a Console and wxWidgets
49 //  http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide
50 //   In Visual C++ 6 (7 should be similar), to create an application that is both a console application 
51 //  (cout's to the console are visible) and has a wxWidgets GUI, 
52 //  you need to use the linker option "/subsystem:console" and the following code:
53 int main(int argc, char* argv[])
54 {
55         return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
56 }
57
58 #endif // defined(_WIN32) 
59
60
61 #else
62 //==========================================================================
63 // WITHOUT WX
64 //==========================================================================
65 #include <iostream>
66 int main(int argc, char* argv[])
67 {  
68   std::cout << "bbStudio was not compiled with wxWidgets : ciao !" <<std::endl;
69   return 0;
70 }
71
72 // EOF
73 #endif //#ifdef _USE_WXWIDGETS_
74
75
76