]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Thu, 26 Jun 2008 06:35:36 +0000 (06:35 +0000)
committerguigues <guigues>
Thu, 26 Jun 2008 06:35:36 +0000 (06:35 +0000)
kernel/appli/CMakeLists.txt
kernel/appli/bbPackageBrowser/CMakeLists.txt [new file with mode: 0644]
kernel/appli/bbPackageBrowser/bbPackageBrowser.cxx [new file with mode: 0644]
kernel/doc/bbtkWebSite/menu.html

index 44c49a70b9b3a8cb66bfe7823292e1c49ba89395..fa74e8d8c2397784c101600b0e1f4203fb7511ac 100644 (file)
@@ -1,5 +1,5 @@
 
-# Replace strings in a file 
+# Replace strings in a file (sed for windows)
 SUBDIRS(bbSed)
 
 # The BlackBox Interpreter
@@ -19,10 +19,13 @@ SUBDIRS(bbCreatePackage)
 # Utility that creates a new user black box 
 SUBDIRS(bbCreateBlackBox) 
 
+# The black box script developer
 SUBDIRS(bbed)
 
-SUBDIRS(bbhelp)
+# The black box package browser
+SUBDIRS(bbPackageBrowser)
 
+#
 SUBDIRS(bbs2cpp)
 
 SUBDIRS(bbc)
diff --git a/kernel/appli/bbPackageBrowser/CMakeLists.txt b/kernel/appli/bbPackageBrowser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ff5e69
--- /dev/null
@@ -0,0 +1,14 @@
+
+SET(SOURCES bbPackageBrowser )
+
+
+IF(BBTK_USE_WXWIDGETS AND WIN32)
+  ADD_EXECUTABLE(bbPackageBrowser WIN32 ${SOURCES})  
+#  SET_TARGET_PROPERTIES(bbPackageBrowser PROPERTIES LINK_FLAGS /subsystem:console )
+ELSE(BBTK_USE_WXWIDGETS AND WIN32)
+  ADD_EXECUTABLE(bbPackageBrowser ${SOURCES})  
+ENDIF(BBTK_USE_WXWIDGETS AND WIN32)
+
+
+TARGET_LINK_LIBRARIES(bbPackageBrowser bbtk)
+INSTALL_TARGETS(/bin/ bbPackageBrowser)
diff --git a/kernel/appli/bbPackageBrowser/bbPackageBrowser.cxx b/kernel/appli/bbPackageBrowser/bbPackageBrowser.cxx
new file mode 100644 (file)
index 0000000..d7e5d44
--- /dev/null
@@ -0,0 +1,197 @@
+#ifdef _USE_WXWIDGETS_
+
+
+
+//==========================================================================
+// WITH WX
+//==========================================================================
+#include "bbtkInterpreter.h"
+#include "bbtkWxGUIHtmlBrowser.h" 
+#include "bbtkWxGUIPackageBrowser2.h" 
+
+#include "../../src/icons/cc_run.xpm"
+#include "../../src/icons/cc_exit.xpm"
+
+using namespace bbtk;
+
+class /*BBTK_EXPORT*/ WxGUIHelp : public wxFrame
+//                                            public InterpreterUser
+{
+public:
+  WxGUIHelp( wxWindow *parent, wxString title, wxSize size );
+  ~WxGUIHelp();
+  void OnButtonRun(wxCommandEvent& WXUNUSED(event));
+  void OnButtonQuit(wxCommandEvent& WXUNUSED(event));
+
+  //  WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
+  WxGUIPackageBrowser2* mWxGUIPackageBrowser;
+  //  wxButton* mwxButtonRun;
+  wxButton* mwxButtonQuit;
+
+//  bool InterpreterUserHasOwnHtmlPageViewer() { return false; }
+//  void InterpreterUserViewHtmlPage(const std::string&) {} 
+
+  DECLARE_EVENT_TABLE(); 
+};
+
+enum
+  {
+    ID_Button_Run,
+    ID_Button_Quit
+  };
+
+WxGUIHelp::WxGUIHelp( wxWindow *parent, wxString title, wxSize size )
+  : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size)
+//                                         InterpreterUser()  
+{ 
+  wxBoxSizer *helpsizer = new wxBoxSizer(wxVERTICAL);
+  // mWxGUIHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0));
+  //  helpsizer->Add (mWxGUIHtmlBrowser,1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5  );
+  mWxGUIPackageBrowser = new WxGUIPackageBrowser2(this);
+  helpsizer->Add (mWxGUIPackageBrowser,1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5  );
+
+  wxBoxSizer *btnsizer = new wxBoxSizer(wxHORIZONTAL);
+  /*
+  wxBitmap bmp_run(cc_run_xpm);
+  mwxButtonRun = new wxBitmapButton(this,ID_Button_Run,bmp_run);
+  btnsizer->Add( mwxButtonRun, 0, wxALL, 5  );
+  */
+  wxBitmap bmp_quit(cc_exit_xpm);
+  mwxButtonQuit = new wxBitmapButton(this,ID_Button_Quit,bmp_quit);
+  btnsizer->Add( mwxButtonQuit, 0, wxALL, 5  );
+
+  helpsizer->Add( btnsizer );
+
+  // Creates and sets the parent window of all bbtk windows
+  /*
+  wxWindow* top = new wxPanel(this,-1);//,_T("top"));
+  top->Hide();
+  Wx::SetTopWindow(top);
+  */
+
+  SetSizer(helpsizer);
+  SetAutoLayout(true);
+  Layout();
+
+  // mWxGUIHtmlBrowser->GoHome();
+  mWxGUIPackageBrowser->IncludeAll();
+}
+
+WxGUIHelp::~WxGUIHelp() {}
+
+/*
+void WxGUIHelp::OnButtonRun(wxCommandEvent& WXUNUSED(event))
+{  
+  //std::string filename = wx2std(mWxGUIHtmlBrowser->GetCurrentPage());
+  std::string filename = mWxGUIHtmlBrowser->GetCurrentPage();
+  size_t s = filename.length();
+  
+  Interpreter::Pointer I = Interpreter::New();
+  I->SetThrow(true);
+
+  if ((s>3) && (filename[s-1]=='s')
+      && (filename[s-2]=='b')
+      && (filename[s-3]=='b')
+      && (filename[s-4]=='.'))
+    {
+      try 
+       {
+         I->InterpretFile(filename);
+       }
+      catch (QuitException e) 
+       {
+         std::cout << "QuitException caught"<<std::endl;
+       }
+      catch (Exception e)
+       {
+         wxString mess;
+         mess += std2wx ( e.GetMessage() );
+         wxMessageBox(mess,_T("Error"),wxOK | wxICON_ERROR);
+       }
+      catch (...)
+       {         
+         wxMessageBox(_T("Undefined error during script execution"),
+                      _T("Error"),wxOK | wxICON_ERROR);
+
+       }
+    }
+  else
+    {
+      wxMessageBox(_T("You can only execute .bbs script files (click on [source] in the field 'To use it' of a box) !"),_T("Warning"),wxOK | wxICON_ERROR);
+    }
+  
+  //delete I;
+}
+*/
+
+void WxGUIHelp::OnButtonQuit(wxCommandEvent& WXUNUSED(event))
+{
+  Close();
+}
+
+//================================================================  
+BEGIN_EVENT_TABLE(WxGUIHelp, wxFrame)
+//  EVT_BUTTON(ID_Button_Run, WxGUIHelp::OnButtonRun )
+  EVT_BUTTON(ID_Button_Quit, WxGUIHelp::OnButtonQuit )
+END_EVENT_TABLE()
+//================================================================
+
+
+
+class myApp : public wxApp
+{
+public:
+  bool OnInit( );
+  int  OnExit() { return true; }
+};
+
+IMPLEMENT_APP(myApp);
+
+
+bool myApp::OnInit( )
+{       
+  wxApp::OnInit();
+#ifdef __WXGTK__
+  //See http://www.wxwindows.org/faqgtk.htm#locale
+  setlocale(LC_NUMERIC, "C");
+#endif
+   wxInitAllImageHandlers();
+   
+   //  WxGUIHelp *I = new WxGUIHelp(0,_T("BBTK help browser"),wxSize(800,600));
+   
+   WxGUIPackageBrowser2Window*  I = 
+     new WxGUIPackageBrowser2Window(0,_T("bbtk help"),wxSize(1000,800));
+  SetTopWindow(I);  
+  I->Show(true);
+  return true;
+}
+
+/*
+#if defined(_WIN32) 
+
+//  How to have a Console and wxWidgets
+//  http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide
+//   In Visual C++ 6 (7 should be similar), to create an application that is both a console application 
+//  (cout's to the console are visible) and has a wxWidgets GUI, 
+//  you need to use the linker option "/subsystem:console" and the following code:
+int main(int argc, char* argv[])
+{
+       return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
+}
+#endif // defined(_WIN32) 
+*/
+       
+#else
+//==========================================================================
+// WITHOUT WX
+//==========================================================================
+int main(int argc, char* argv[])
+{  
+  return 0;
+}
+        
+// EOF
+#endif //#ifdef _USE_WXWIDGETS_
+
+
+
index c65d13e65bd3b73f16311843f3b33ad461318035..dee961fabd216391670a9716d159b38943b6e21d 100644 (file)
@@ -14,6 +14,9 @@ License<br>
 bbtk <a target="information"
  href="http://www.creatis.insa-lyon.fr/mywiki/Informatique/bbtk">Wiki</a>
 <br>
+<a target="information"
+ href="http://www.creatis.insa-lyon.fr/mailman/listinfo/bbtk-users">bbtk users mailing list</a>
+<br>
 </small><font size="2"><a target="information"
  href="../bbdoc/index-category.html#demo">Demos</a></font><br>
 <font size="2"><a target="information"