]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbi/bbi.cxx
* Created an invisible frame child of WxConsole to be temporary parent of all widgets...
[bbtk.git] / kernel / appli / bbi / bbi.cxx
index 39fcc08b5026c5cb737886af15636ab42d95f9a0..5404d6ed728a4ba44742118a2cb544df780288f8 100644 (file)
@@ -14,6 +14,7 @@
 
 static const wxCmdLineEntryDesc cmdLineDesc[] =
 {
+  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Debug messages on (message All 9)") },
   { wxCMD_LINE_SWITCH, _T("c"), _T("command"), _T("turn to command line mode after file(s) processing") },
   { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet") },
   { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print help") },
@@ -41,6 +42,7 @@ public:
   int argc;
   std::vector<std::string> argv;
   bool command;
+  bool debug;
   bool quiet;
   bool help;
   bool graphical_dialog;
@@ -62,6 +64,7 @@ void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
 
 bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
 {
+  debug = ( parser.Found(_T("d")) );
   quiet = ( parser.Found(_T("q")) );
   help = ( parser.Found(_T("h")) );
   graphical_dialog = ( parser.Found(_T("g")) );
@@ -120,9 +123,12 @@ bool wxBBIApp::OnInit( )
   //See http://www.wxwindows.org/faqgtk.htm#locale
   setlocale(LC_NUMERIC, "C");
 #endif
+  
+  if (quiet) bbtk::MessageManager::SetMessageLevel("All",0);
+  if (debug) bbtk::MessageManager::SetMessageLevel("All",9);
+  
 
-  bbtk::WxConsole *I = new bbtk::WxConsole(0,_T("bbi"),wxSize(600,400));
+  bbtk::WxConsole *I = new bbtk::WxConsole(0,_T("bbi"),wxSize(800,600));
   SetTopWindow(I);  
   if (!no_command) I->Show(true);
 
@@ -138,8 +144,11 @@ bool wxBBIApp::OnInit( )
   for (i=input_file.begin(); i!=input_file.end(); ++i) I->InterpretFile(*i);
   I->SetNoExecMode(false);
 
-  if (help_on_script) bbtk::HelpBlackBox("workspace",false);
-
+  if (help_on_script) 
+    {
+      std::string package; 
+      I->GetInterpreter()->GetExecuter()->GetFactory()->HelpBlackBox("workspace",package,false);
+    }
   if (!(command || bbtk::Wx::IsSomeWindowShown() ))
     {
       I->Close();