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