]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 12 Feb 2008 12:55:15 +0000 (12:55 +0000)
committerguigues <guigues>
Tue, 12 Feb 2008 12:55:15 +0000 (12:55 +0000)
17 files changed:
kernel/cmake/BBTKConfigurePackage.cmake
kernel/cmake/BBTKConfigurePackage_src.cmake
kernel/cmake/bbPackage.cxx.in
kernel/doc/bbtkUsersGuide/bbi-gui.png [new file with mode: 0644]
kernel/doc/bbtkUsersGuide/bbtkUsersGuide.tex
kernel/install/gnome/bbi-icon.png [new file with mode: 0644]
kernel/install/gnome/bbi.desktop.in [new file with mode: 0644]
kernel/install/gnome/bbs.xml [new file with mode: 0644]
kernel/install/gnome/install-gnome.sh [new file with mode: 0755]
kernel/src/bbtkFactory.cxx
kernel/src/bbtkFactory.h
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkPackage.cxx
kernel/src/bbtkWxBrowser.cxx
kernel/src/bbtkWxConsole.cxx
kernel/src/bbtkWxConsole.h

index 2cea2fc52b3cb14cfb78afc79bff0e2a9f1f2dd1..e529b0aca57f79de4bdc982d5ca082204d0de7e2 100644 (file)
@@ -40,6 +40,19 @@ ENDIF(UNIX)
 IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
   #---------------------------------------------------------------------------
 
+
+  #----------------------------------------------------------------------------
+  # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
+  SET(BBTK_PACKAGE_AUTHOR        "${${BBTK_PACKAGE_NAME}_AUTHOR}")
+  SET(BBTK_PACKAGE_DESCRIPTION   "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
+  SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
+  SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
+  SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
+  SET(BBTK_PACKAGE_VERSION 
+    "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
+  #----------------------------------------------------------------------------
+  
+  
   #---------------------------------------------------------------------------
   # If package deps not in global deps : add them
   IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
index 967fbde369c8fb42e6377287c64b274c030938b1..1f33f21d0eb7cca742d9f425cd872a769d7d9aeb 100644 (file)
@@ -14,16 +14,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} )
 INCLUDE_DIRECTORIES(../${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
 #----------------------------------------------------------------------------
 
-#----------------------------------------------------------------------------
-# VARS CONFIGURED IN bbPackage.h 
-SET(BBTK_PACKAGE_AUTHOR        "\"${${BBTK_PACKAGE_NAME}_AUTHOR}\"")
-SET(BBTK_PACKAGE_DESCRIPTION   "\"${${BBTK_PACKAGE_NAME}_DESCRIPTION}\"")
-SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
-SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
-SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
-SET(BBTK_PACKAGE_VERSION 
-  "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
-#----------------------------------------------------------------------------
 
 #----------------------------------------------------------------------------
 
index e64aaad38e910f50ebb1402f1e6ad7e0929b0e1c..8e8fde5478d03488eff60832645fd5cb752e6bb0 100644 (file)
@@ -1,6 +1,6 @@
 #include "bb@BBTK_PACKAGE_NAME@Package.h"
 
 BBTK_IMPLEMENT_PACKAGE(@BBTK_PACKAGE_NAME@,
-       @BBTK_PACKAGE_AUTHOR@,
-       @BBTK_PACKAGE_DESCRIPTION@,
+       "@BBTK_PACKAGE_AUTHOR@",
+       "@BBTK_PACKAGE_DESCRIPTION@",
        @BBTK_PACKAGE_VERSION@)
diff --git a/kernel/doc/bbtkUsersGuide/bbi-gui.png b/kernel/doc/bbtkUsersGuide/bbi-gui.png
new file mode 100644 (file)
index 0000000..be00d84
Binary files /dev/null and b/kernel/doc/bbtkUsersGuide/bbi-gui.png differ
index fb6e13161236760470746ba57c7ba194b4a66e70..5cd9e8dfeb930230e97a0553583141168273a4ae 100644 (file)
@@ -34,6 +34,14 @@ defines a {\bf black box} as
 \emph{``any component in a system in which only the input and output 
 characteristics are of interest, without regard to its internal mechanism 
 or structure''}. 
+I would add something very important to this definition : 
+not only the inputs and outputs are of interest but also 
+\emph{what the box does} !
+Hence, I would say that a black box is any \emph{\bf documented} 
+component of a system, letting know the user 
+\emph{\bf what} the box is supposed to do and 
+\emph{\bf how to use it}
+but not \emph{\bf how it does it}.
 
 \BBTK provides a systematic framework 
 to encapsulate (or ``wrap'') any 
@@ -46,7 +54,7 @@ for all boxes. Hence one does not need to know which particular
 method allows, say, to set a particular input or 
 get a particular output of the box. 
 One can use a black box in a purely abstract way. 
-\item{\bf symbolic} means a particular 
+\item{\bf symbolic} means that a particular 
 input or output is referenced by a 'name', that is by a symbol 
 which identifies the input or output. 
 It also means that symbolic information (text!) is 
@@ -82,13 +90,13 @@ which allows to manipulate packages and boxes very easily in symbolic way.
 \BBTK provides one: \bbi (the Black Box Interpreter). 
 \item {\bf Automatic documentation} of existing packages. 
 \texttt{html} documentation of packages is proposed by 
-the \bbdoc application.
+\bbi.
 \end{itemize}
 
 Finally, these different components allow {\bf efficient}:
 
 \begin{itemize}
-\item {\bf capitalization and reuse} of existing processings, 
+\item {\bf capitalization and reuse} of existing processing units, 
 including {\bf documentation} 
 \item {\bf testing, prototyping} in a very simple script language
 \item {\bf inter-operability} between atomic processings which 
@@ -119,10 +127,11 @@ processing chains by connecting various black boxes of the already loaded packag
 \begin{itemize}
 \item \bbfy generates the \CPP code of a black box from a 
 description file written in \texttt{xml}.
-\item \bbdoc generates the html documentation of a black box package 
-(author, description, description of its black boxes: 
-author, description, inputs, outputs, and so on).
-\item \bbCreatePackage creates a directory on disk which contains the basic files to start the development of a new black box package.
+%\item \bbdoc generates the html documentation of a black box package 
+%(author, description, description of its black boxes: 
+%author, description, inputs, outputs, and so on).
+\item \bbCreatePackage allows to create the basic file architecture 
+to start the development of a new black box package.
 \end{itemize} 
 \end{itemize}
 
@@ -208,14 +217,26 @@ Use it as a reference.
 To run the black box interpreter, 
 open a console and type \texttt{bbi} 
 or double click on the application icon.
-You get a message and a prompt:
-\begin{verbatim}
-$$ bbi
-BBI (Black Box Interpreter) - bbtk "1.0.0" - (c) Creatis 2007
->
-\end{verbatim}
+You get a window which looks like the one in figure 
+\ref{bbi-fig-bbi-gui} 
+(the exact appearance of \bbi is system and \bbtk version dependent)
+\footnote{If you compiled \bbtk without \wx then \bbi does not have a 
+graphical interface but a simple prompt).
+
+\begin{figure}[!ht]
+\caption{\label{bbi-fig-bbi-gui}The black box interpreter interface}
+\begin{center}
+\includegraphics[width=0.7\textwidth]{bbi-gui.png}
+\end{center}
+\end{figure}
+
+The 'Command' tab is subdivided into two parts : 
+one single line zone at the bottom in which you can enter your commands and 
+one multiple line zone in which \bbi prints out the result of your commands.
 
-If you type:
+
+Try typing in the input zone (in this manual, 
+the commands entered by the user will be preceded by a prompt '>') :
 \begin{verbatim}
 > help 
 \end{verbatim}
@@ -224,21 +245,25 @@ you get the list of the commands of the interpreter:
 \begin{verbatim}
 Available commands:
  author
+ category
  config
  connect
  define
  delete
  description
  endefine
+ endpackage
  exec
  graph
  help
  include
+ index
  input
  load
  message
  new
  output
+ package
  print
  quit
  reset
@@ -313,6 +338,7 @@ If you type \texttt{'help workspace'}, you get:
 Complex Black Box <user::workspace>
  User's workspace
  By: bbi (internal)
+ Category(s) : complex box;
  * No inputs
  * No outputs
  * No boxes
@@ -333,7 +359,7 @@ which contains basic useful black boxes.
 
 To load it, type:
 \begin{verbatim}
-> load std
+> include std
 \end{verbatim}
 
 Then if you type:
@@ -364,13 +390,16 @@ You get:
 \begin{verbatim}
 Black Box <std::Add>
  Adds its inputs
- By: laurent.guigues@creatis.insa-lyon.fr
+ By: laurent.guigues at creatis.insa-lyon.fr
+ Categories : atomic box;math;
  * Inputs: 
-   'In1'         <double>: First number to add
-   'In2'         <double>: Second number to add
-   'ProcessMode' <int>   : Set the process mode of the box (0=Pipeline | 1=Always | 2=Reactive)
- * Outputs: 
-   'Out'          <double>: Result
+    'BoxExecute'     <bbtk::Void> : Any signal received by this input executes the box
+    'BoxProcessMode' <String>     : Sets the processing mode of the box (Pipeline | Always | Reactive)
+    'In1'            <Double>     : First number to add
+    'In2'            <Double>     : Second number to add
+  * Outputs : 
+    'BoxChange'      <bbtk::Void> : Signal modifications of the box
+    'Out'            <Double>     : Result'In1'         <double>: First number to add
 \end{verbatim}
 
 Like previously, 
@@ -379,11 +408,12 @@ means that the box \texttt{Add}
 belongs to the \texttt{std} package. 
 Then comes a description 
 (the one which was provided by the author of the box), 
-the author(s) of the box (usually e-mail adress(es)). 
+the author(s) of the box (usually e-mail adress(es)) and 
+the categories to which the box belong. 
 Finally comes the lists of inputs and outputs of the box.
 For each input or output, \bbi provides 
 its \emph{name} (between quotes, e.g. \texttt{'ProcessMode'}), 
-its \emph{type} (between \texttt{<>}, e.g. \texttt{<int>})
+its \emph{type} (between \texttt{<>}, e.g. \texttt{<Int>})
 and a description.    
 Remark that the box \texttt{Add} is not a 'complex' black box 
 but an 'atomic' box, hence its help does not 
@@ -418,6 +448,7 @@ you get:
 Complex Black Box <user::workspace>
  User's workspace
  By: bbi (internal)
+ Category(s) : complex box;
  * No inputs
  * No outputs
  * Boxes: 
@@ -465,11 +496,11 @@ To process this special substrings, \bbi does:
 Box processing is needed if:
 \begin{itemize}
 \item at least input has changed since last processing or
-\item the input \texttt{'ProcessMode'} of the box is set to 
-\texttt{1}, which forces box reprocessing. 
+\item the input \texttt{'BoxProcessMode'} of the box is set to 
+\texttt{'Always'}, which forces box reprocessing. 
 \end{itemize}
 
-Note that all boxes have the input \texttt{'ProcessMode'}. 
+Note that all boxes have the input \texttt{'BoxProcessMode'}. 
 
 Another way to process the box \texttt{a} is to issue the command:
 \begin{verbatim}
@@ -494,7 +525,7 @@ Good bye !
 \paragraph{Summary}
 %\hrule
 \begin{itemize}
-\item The \texttt{load} command allows to load a package.
+\item The \texttt{include} command allows to load a package.
 \item \texttt{help} gives help on:
 \begin{itemize} 
 \item Available commands if you just type \texttt{help}.
@@ -521,6 +552,8 @@ The same syntax holds for outputs.
 \label{bbi-connecting-black-boxes}
 % ==========================================
 
+LG : THE GUIDE IS UP TO DATE UNTIL HERE
+
 \BBTK allows to create 
 and execute processing chains, 
 also called \emph{pipelines}, 
@@ -531,9 +564,7 @@ more information on pipeline processing.
 
 First start \bbi and load the package \texttt{std}:
 \begin{verbatim}
-$$ bbi
-BBI (Black Box Interpreter) - bbtk "1.0.0" - (c) Creatis 2007
-> load std
+> include std
 \end{verbatim}
 
 Assume you want to compute $1+2+3$. You can do it by 
diff --git a/kernel/install/gnome/bbi-icon.png b/kernel/install/gnome/bbi-icon.png
new file mode 100644 (file)
index 0000000..f83315e
Binary files /dev/null and b/kernel/install/gnome/bbi-icon.png differ
diff --git a/kernel/install/gnome/bbi.desktop.in b/kernel/install/gnome/bbi.desktop.in
new file mode 100644 (file)
index 0000000..1817ab4
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Name=bbi
+MimeType=text/bbs;
+Exec=BBI -c %f
+Type=Application
+Terminal=false
+NoDisplay=false
+GenericName[en_US]="The Black Box Interpreter (bbi)"
+Icon=HOME/.local/share/applications/bbi-icon.png
diff --git a/kernel/install/gnome/bbs.xml b/kernel/install/gnome/bbs.xml
new file mode 100644 (file)
index 0000000..0d3144d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+
+<mime-type type="text/bbs">
+    <sub-class-of type="text/plain"/>
+    <comment>Black Box Script</comment>
+    <comment xml:lang="en_US">Black Box Script</comment>
+    <glob pattern="*.bbs"/>
+  </mime-type>
+
+</mime-info>
diff --git a/kernel/install/gnome/install-gnome.sh b/kernel/install/gnome/install-gnome.sh
new file mode 100755 (executable)
index 0000000..c34e564
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+echo "***** Installing bbi on gnome desktop *****"
+
+BBI=$(which bbi)
+echo "* bbi path = ${BBI}"
+
+# The desktop launcher & its icon
+echo "* Creating bbi launcher on desktop (${HOME}/Desktop/bbi.desktop)"
+sed s,HOME,${HOME},g bbi.desktop.in > bbi.desktop.tmp
+sed s,BBI,${BBI},g bbi.desktop.tmp > bbi.desktop.tmp2
+cp bbi.desktop.tmp2 ${HOME}/Desktop 
+
+echo "* Copying 'bbi-icon.png' in ${HOME}/.local/share/applications/"
+cp bbi-icon.png ${HOME}/.local/share/applications/
+
+# add the type 'text/bbs' to mime database
+echo "* Adding mime-type 'test/bbs' to mime database (${HOME}/.local/share/mime/packages/bbs.xml)"
+if [ ! -d ${HOME}/.local/share/mime ] 
+    then
+    mkdir  ${HOME}/.local/share/mime
+    if [ ! -d ${HOME}/.local/share/mime/packages ]
+       then
+       mkdir  ${HOME}/.local/share/mime/packages
+    fi 
+fi 
+cp bbs.xml ${HOME}/.local/share/mime/packages/
+update-mime-database ${HOME}/.local/share/mime
+nautilus --quit 
+nautilus &
+
+# associate 'text/bbs' to the desktop launcher
+# add the line 'text/bbs=bbi.desktop' 
+# in file ${HOME}/.local/share/applications/defaults.list
+line="text/bbs=bbi.desktop"
+file="${HOME}/.local/share/applications/defaults.list"
+if grep -q ${line} ${file} 
+then
+    echo "* Mime-type 'text/bbs' already present in '${file}' : nothing to do"
+else
+    echo "* Associating mime-type 'text/bbs' to 'bbi.desktop' (${file})"
+    echo ${line} | cat >> ${file}
+fi
index 48963f21558658cca8ec5c79aa42a29342a5e3dc..ab82b885600f5583cb2f412fb7c77492f2785bb1 100644 (file)
@@ -4,8 +4,8 @@ Program:   bbtk
 Module:    $RCSfile: bbtkFactory.cxx,v $
 Language:  C++
 
-Date:      $Date: 2008/02/08 07:39:49 $
-Version:   $Revision: 1.17 $
+Date:      $Date: 2008/02/12 12:55:16 $
+Version:   $Revision: 1.18 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -582,8 +582,11 @@ namespace bbtk
   //===================================================================
 
   //===================================================================
-  /// Prints help on the black box of type <name>
-  void Factory::HelpBlackBox(const std::string& name, bool full) const
+  /// Prints help on the black box of type <name> 
+  /// Returns the package to which it belongs
+  void Factory::HelpBlackBox(const std::string& name, 
+                            std::string& package,
+                            bool full) const
   {
     bbtkDebugMessageInc("Kernel",9,"Factory::HelpBlackBox(\""<<name<<"\")"
                         <<std::endl);
@@ -595,6 +598,7 @@ namespace bbtk
       if (i->second.mPackage->ContainsBlackBox(name)) 
         {
           i->second.mPackage->HelpBlackBox(name,full);
+         package = i->second.mPackage->GetName();
           found = true;
         }
       }
index 9b2aab1949b1dca36878bcabc87a498ab6e7d7fc..0a7f39e6f2f0a1adca70e8a842cc671b20862bfd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkFactory.h,v $
   Language:  C++
-  Date:      $Date: 2008/02/05 11:39:32 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -49,7 +49,8 @@ namespace bbtk
     void UnLoadPackage( const std::string& name );
     void PrintPackages(bool details = true, bool adaptors = false) const;
     void HelpPackage(const std::string& name, bool adaptors = false) const;
-    void HelpBlackBox(const std::string& name, bool full=true) const;
+    void HelpBlackBox(const std::string& name, std::string& package,
+                     bool full=true ) const;
     void ShowGraphTypes(const std::string& name) const;
     void InsertPackage( Package* );
     void RemovePackage( Package* );
@@ -163,7 +164,15 @@ namespace bbtk
   
   inline void HelpBlackBox(const std::string& name, bool full=true) 
   {
-    GetGlobalFactory()->HelpBlackBox(name,full);
+    std::string package; 
+    GetGlobalFactory()->HelpBlackBox(name, package, full);
+  }
+
+  inline void HelpBlackBox(const std::string& name, std::string& package,
+                          bool full=true
+                          ) 
+  {
+    GetGlobalFactory()->HelpBlackBox(name, package, full);
   }
 
 
index 5b0c26e81faa4f9e18fe6f8c0ed279241de2b0e2..f0617c087e76bd851916bbfabb8d9032e4264f32 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/06 10:53:02 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.29 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1083,26 +1083,50 @@ void Interpreter::Help(const std::vector<std::string>& words)
          try 
          {
             HelpPackage(words[1]);
+#ifdef _USE_WXWIDGETS_
+           if ( WxConsole::GetInstance() != 0 )
+             {
+               std::string url = ConfigurationFile::GetInstance().Get_url();
+               url += "/bbdoc/" + words[1] + "/index.html";
+               if (Utilities::FileExists(url)) 
+                 {
+                   WxConsole::GetInstance()->ShowHtmlPage(url);
+                 }
+             }
+#endif     
          }
          catch (bbtk::Exception f) 
          {
             try 
             {
-               HelpBlackBox(words[1]);
-            }
-           catch (bbtk::Exception g) 
-           {
-              try
-              {
-                 this->mExecuter->ShowRelations(words[1],"0","9999");
-              }
-              catch (bbtk::Exception h){
-                bbtkError("\""<<words[1].c_str()
-                          <<"\" is not a known command, package, black box type or black box name");
-              }
-           }
+             std::string package;
+             HelpBlackBox(words[1],package);
+#ifdef _USE_WXWIDGETS_
+              if ( WxConsole::GetInstance() != 0 )
+                {
+                  std::string url = ConfigurationFile::GetInstance().Get_url();
+                  url += "/bbdoc/" + package + "/index.html";
+                  if (Utilities::FileExists(url)) 
+                    {
+                      url += "#" + words[1];
+                      WxConsole::GetInstance()->ShowHtmlPage(url);
+                    }
+                }
+#endif     
+           }
+           catch (bbtk::Exception g) 
+             {
+               try
+                 {
+                   this->mExecuter->ShowRelations(words[1],"0","9999");
+                 }
+               catch (bbtk::Exception h){
+                 bbtkError("\""<<words[1].c_str()
+                           <<"\" is not a known command, package, black box type or black box name");
+               }
+             }
          }
-       }
+      }
     }
     else if (nbarg==2) 
     {
index 66caed7ba5e2a90aa15234347954d4cdfd807c23..0cd00f3fc237960b3a2628ac6ea39704a1273d99 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/06 09:27:52 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.11 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -36,6 +36,8 @@
 
 namespace bbtk
 {
+
+
   class BBTK_EXPORT Interpreter
   {
 
@@ -167,6 +169,7 @@ namespace bbtk
     /// Sets the bool that indicates wether we are in command line context
     void SetCommandLine(bool v = true) { mCommandLine = v; }
 
+
   private:
 
     /// Opens the file fullPathScriptName 
index 5fd8cce424c9b726b72dd34bac9c7ae90cab2e10..558d0b28e5977b684ce99dc05401d536516c96ac 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/08 07:39:49 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -625,8 +625,9 @@ namespace bbtk
     ptm = gmtime ( &rawtime );
 
     s << "<p><hr>\n";
-    s << "Automatically generated by <b>"<<caller<<"</b> from <b>"
-      <<source<<"</b> on "
+    s << "Automatically generated by <b>"<<caller<<"</b> "//from <b>"
+      //      <<source<<"</b>
+      <<"on "
       << ptm->tm_mday << "/" << ptm->tm_mon << "/" << ptm->tm_year+1900 
       << " - " << ptm->tm_hour << ":" << ptm->tm_min << " GMT\n";
     s << "</body></html>\n"; 
index 3776e1f4f949c60680025516d6cb1de3a05d387c..5a24a95b5d18b48f7db7955c101e240e566bcafa 100644 (file)
@@ -4,6 +4,7 @@
 #include "bbtkWxBlackBox.h"
 
 #include "bbtkConfigurationFile.h"
+#include "bbtkUtilities.h"
 
 namespace bbtk
 {  
@@ -194,7 +195,14 @@ namespace bbtk
   {
     std::string url = ConfigurationFile::GetInstance().Get_url();
     url += "/bbtkWebSite/menu.html";
-    GoTo(url);
+    if (Utilities::FileExists(url)) 
+      {
+       GoTo(url);
+      }
+    else 
+      {
+       // what ?
+      }
   }
   //========================================================================
 
index a29cfb1f2cc981520c2d4c6b4464a89cd3092388..d0e862269969f191f2204b1790b97ec8d782498a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/08 10:05:38 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -220,7 +220,9 @@ namespace bbtk
     // Command page 
 
     mwxTextHistory = 
-      new wxTextCtrl(mwxPageCommand,0,_T(""),wxDefaultPosition,
+      new wxTextCtrl(mwxPageCommand,
+                    ID_Text_History,
+                    _T(""),wxDefaultPosition,
                     wxDefaultSize, //HistorySize,
                     wxTE_READONLY |
                     wxTE_MULTILINE );
@@ -234,13 +236,14 @@ namespace bbtk
    mwxTextHistoryAttr = new wxTextAttr;
    mwxTextHistoryAttr->SetFont(*FixedFont);
    mwxTextCommand = 
-     new wxTextCtrl(mwxPageCommand,0,_T(""),wxDefaultPosition,
-                   wxDefaultSize,//CommandSize,
-                   
+     new wxTextCtrl(mwxPageCommand,
+                   ID_Text_Command,
+                   _T(""),wxDefaultPosition,
+                   wxDefaultSize,
                    wxTE_PROCESS_ENTER
-                       | 
-                   wxTE_PROCESS_TAB | wxWANTS_CHARS 
-//                     |  wxTAB_TRAVERSAL
+                   | wxTE_PROCESS_TAB 
+                   | wxWANTS_CHARS 
+                   //| wxTAB_TRAVERSAL
                    );
    
 
@@ -265,6 +268,7 @@ namespace bbtk
     // Events connection
     // COMMAND
     // ENTER
+    /*
     Connect( mwxTextCommand->GetId(),
             wxEVT_COMMAND_TEXT_ENTER,
             (wxObjectEventFunction)& WxConsole::OnCommandEnter );
@@ -272,6 +276,7 @@ namespace bbtk
             wxEVT_CHAR,
             //wxEVT_COMMAND_TEXT_UPDATED,
             (wxObjectEventFunction)& WxConsole::OnCommandChar );
+    */
     // MENU
     //    Connect ( 
 
@@ -401,7 +406,11 @@ namespace bbtk
   void WxConsole::ShowHtmlPage(std::string& page)
   {
     //  std::cout << "WxConsole::ShowHtmlPage('"<<page<<"')"<<std::endl;
-    if (!mwxHtmlWindow->GoTo(page)) 
+    if (mwxHtmlWindow->GoTo(page)) 
+      {
+       mwxNotebook->ChangeSelection(1);
+      }
+    else 
       {
        //      std::cout << "ERROR html"<<std::endl;
       }
@@ -411,6 +420,8 @@ namespace bbtk
   BEGIN_EVENT_TABLE(WxConsole, wxFrame)
     EVT_MENU(WxConsole::ID_Menu_Quit, WxConsole::OnMenuQuit)
     EVT_MENU(WxConsole::ID_Menu_About, WxConsole::OnMenuAbout)
+    EVT_TEXT_ENTER(WxConsole::ID_Text_Command, WxConsole::OnCommandEnter)
+  //    EVT_CHAR(WxConsole::ID_Text_Command, WxConsole::OnCommandChar)
     END_EVENT_TABLE()
   //================================================================
 
index 407e5d13d6f9bb16a9377651a9d0a2ba29fa53ce..d45758931ca472cead8f6151ae5d263606f25f02 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.h,v $
   Language:  C++
-  Date:      $Date: 2008/02/05 08:25:23 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/02/12 12:55:16 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -101,6 +101,9 @@ namespace bbtk
     {
       ID_Menu_Quit = 1,
       ID_Menu_About,
+      ID_Text_Command,
+      ID_Text_History,
+
     };
     
     DECLARE_EVENT_TABLE()