]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBoxDescriptor.cxx
Removed useless close buttons on 3 bbEditor left panels.
[bbtk.git] / kernel / src / bbtkBlackBoxDescriptor.cxx
index 4fba9436ad38f520bd92adda727cbed642a514f2..18dfcd181546f43e8ca8e4f4a3279ede30f958ae 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:12 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2009/12/08 14:10:36 $
+  Version:   $Revision: 1.22 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -45,6 +45,10 @@ namespace bbtk
 
   typedef Package::Pointer PackagePointer;
 
+#define bbtkDMessage(key,level,mess) \
+  bbtkMessage(key,level,"["<<GetFullTypeName()<<"] "<<mess)
+#define bbtkDDebugMessage(key,level,mess)      \
+  bbtkDebugMessage(key,level,"["<<GetFullTypeName()<<"] "<<mess)
 
 
   //=========================================================================
@@ -57,10 +61,10 @@ namespace bbtk
       mKind(STANDARD),
       mPackage()
   {
-    bbtkDebugMessage("object",4,
-                    "==> BlackBoxDescriptor::BlackBoxDescriptor()"<<std::endl);
-   bbtkDebugMessage("object",4,
-                    "<== BlackBoxDescriptor::BlackBoxDescriptor()"<<std::endl);
+    bbtkDDebugMessage("object",4,
+                    "==> BlackBoxDescriptor()"<<std::endl);
+    bbtkDDebugMessage("object",4,
+                    "<== BlackBoxDescriptor()"<<std::endl);
   }
   //=========================================================================
 
@@ -73,9 +77,9 @@ namespace bbtk
   /// Dtor
   BlackBoxDescriptor::~BlackBoxDescriptor()
   {
-    bbtkDebugMessage("object",4,
-                    "==> BlackBoxDescriptor::~BlackBoxDescriptor() ["
-                    <<mTypeName<<"]"<<std::endl);
+    bbtkDDebugMessage("object",4,
+                    "==> ~BlackBoxDescriptor()"
+                    <<std::endl);
 
     // deletes all I/O descriptors
     InputDescriptorMapType::iterator i;
@@ -83,9 +87,9 @@ namespace bbtk
     OutputDescriptorMapType::iterator o;
     for (o=mOutput.begin(); o!=mOutput.end(); ++o) delete o->second;
 
-    bbtkDebugMessage("object",4,
-                    "<== BlackBoxDescriptor::~BlackBoxDescriptor() ["
-                    <<mTypeName<<"]"<<std::endl);
+    bbtkDDebugMessage("object",4,
+                     "<== ~BlackBoxDescriptor()"
+                     <<std::endl);
   }
   //=========================================================================
 
@@ -122,13 +126,13 @@ namespace bbtk
   /// Dtor
   void BlackBoxDescriptor::UnReference()
   {
-    bbtkDebugMessageInc("Kernel",1,
+    bbtkDDebugMessageInc("kernel",1,
                        "BlackBoxDescriptor::UnReference() ["
                        <<mTypeName<<"] #"<<mRefCount-1<<std::endl);
     mRefCount--;
     if (mRefCount<=0) 
       {
-       bbtkDebugMessage("Kernel",1,"--> Destructing BlackBoxDescriptor ["<<mTypeName<<"]"<<std::endl);
+       bbtkDDebugMessage("kernel",1,"--> Destructing BlackBoxDescriptor ["<<mTypeName<<"]"<<std::endl);
        delete this;
       }
   }
@@ -146,8 +150,8 @@ namespace bbtk
   /// Adds the string to the BlackBox description
   void BlackBoxDescriptor::AddToDescription( const std::string& s, bool clear)
   {
-    bbtkDebugMessage("Kernel",9,"BlackBoxDescriptor::AddToDescription(\""<<s<<
-                    "\") ["<<GetFullTypeName()<<"]"<<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToDescription(\""
+                     <<s<<"\")"<<std::endl);
     if (clear) mDescription = s; 
     else mDescription += s;
    }
@@ -157,8 +161,9 @@ namespace bbtk
   /// Adds the string to the BlackBox author list
   void BlackBoxDescriptor::AddToAuthor( const std::string& s, bool clear)
   {
-    bbtkDebugMessage("Kernel",9,"BlackBoxDescriptor::AddToAuthor(\""<<s<<"\") ["
-                    <<GetFullTypeName()<<"]"<<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToAuthor(\""
+                     <<s<<"\")"
+                     <<std::endl);
     if (clear) mAuthor = s;
     else mAuthor += s;
   }
@@ -168,8 +173,9 @@ namespace bbtk
   /// Adds the string to the BlackBox category list
   void BlackBoxDescriptor::AddToCategory( const std::string& s, bool clear)
   {
-    bbtkDebugMessage("Kernel",9,"BlackBoxDescriptor::AddToCategory(\""<<s<<"\") ["
-                    <<GetFullTypeName()<<"]"<<std::endl);  
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToCategory(\""
+                     <<s<<"\")"
+                     <<std::endl);  
     if (clear) mCategory = s;
     else mCategory += s;
     mCategory += ";";
@@ -180,8 +186,8 @@ namespace bbtk
   const BlackBoxDescriptor::InputDescriptor* 
   BlackBoxDescriptor::GetInputDescriptor(const std::string & name) const
   {
-    bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::GetInputDescriptor('"
-                       <<name<<"') ["<<GetFullTypeName()<<"]"<<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetInputDescriptor('"
+                     <<name<<"')"<<std::endl);
 
     InputDescriptorMapType::const_iterator i;
     i = mInput.find(name);
@@ -189,7 +195,7 @@ namespace bbtk
     {
            bbtkError("input '"<<name<<"' does not exist");
     }
-    bbtkDebugDecTab("Kernel",9);
+
     return i->second;
   }
   //=========================================================================
@@ -198,16 +204,16 @@ namespace bbtk
   const BlackBoxDescriptor::OutputDescriptor* 
   BlackBoxDescriptor::GetOutputDescriptor(const std::string & name) const
   {
-    bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::GetOutputDescriptor('"
-                       <<name<<"') ["<<GetFullTypeName()<<"]"<<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetOutputDescriptor('"
+                     <<name<<"')"<<std::endl);
 
     OutputDescriptorMapType::const_iterator i;
     i = mOutput.find(name);
     if ( i == mOutput.end() ) 
     {
-           bbtkError("output '"<<name<<"' does not exist");
+      bbtkError("output '"<<name<<"' does not exist");
     }
-    bbtkDebugDecTab("Kernel",9);
+
     return i->second;
   }
   //=========================================================================
@@ -215,16 +221,17 @@ namespace bbtk
   //=========================================================================
   void BlackBoxDescriptor::GetHelp(bool full) const
   {
-    bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::GetHelp() ["<<GetFullTypeName()<<"]"<<std::endl);
-
-    bbtkMessage("Help",1,"Black Box <"<<GetFullTypeName()<<">"<<std::endl);
-    bbtkMessage("Help",1," "              <<GetDescription()<<std::endl);
-    bbtkMessage("Help",1," By : "         <<GetAuthor()     <<std::endl);
-    bbtkMessage("Help",1," Categories : " <<GetCategory()    <<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetHelp()"
+                     <<std::endl);
+    
+    bbtkMessage("help",1,"Black Box <"<<GetFullTypeName()<<">"<<std::endl);
+    bbtkMessage("help",1," "              <<GetDescription()<<std::endl);
+    bbtkMessage("help",1," By : "         <<GetAuthor()     <<std::endl);
+    bbtkMessage("help",1," Categories : " <<GetCategory()    <<std::endl);
     if (mInput.size()) 
-      bbtkMessage("Help",1," * Inputs : "<<std::endl);
+      bbtkMessage("help",1," * Inputs : "<<std::endl);
     else 
-      bbtkMessage("Help",1," * No inputs"<<std::endl);
+      bbtkMessage("help",1," * No inputs"<<std::endl);
     InputDescriptorMapType::const_iterator i;
     unsigned int namelmax = 0;
     unsigned int typelmax = 0;
@@ -260,16 +267,16 @@ namespace bbtk
           std::string nature(i->second->GetNature());
           nature += "]";
           nature.append(1+natlmax-nature.size(),' ');
-          bbtkMessage("Help",1,
+          bbtkMessage("help",1,
                       "    '"<<name
                       <<" <"<<type
                       <<" ["<<nature
                       <<" : "<<i->second->GetDescription()<<std::endl);
     }
     if (mOutput.size()) 
-      bbtkMessage("Help",1," * Outputs : "<<std::endl);
+      bbtkMessage("help",1," * Outputs : "<<std::endl);
     else 
-      bbtkMessage("Help",1," * No outputs"<<std::endl);
+      bbtkMessage("help",1," * No outputs"<<std::endl);
     for ( o = mOutput.begin();  o != mOutput.end(); ++o ) 
     {
           std::string name(o->second->GetName());
@@ -281,16 +288,14 @@ namespace bbtk
           std::string nature(o->second->GetNature());
           nature += "]";
           nature.append(1+natlmax-nature.size(),' ');
-          bbtkMessage("Help",1,
+          bbtkMessage("help",1,
                    "    '"<<name
                       <<" <"<<type
                       <<" ["<<nature
                       <<" : "<<o->second->GetDescription()<<std::endl);
       }
    
-     bbtkDebugDecTab("Kernel",9);
   
-
   }
   //=========================================================================
    
@@ -309,7 +314,8 @@ namespace bbtk
                                            const std::string& output_dir,
                                            bool relative_link )
   {
-    bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::InsertHtmlHelp() ["<<GetFullTypeName()<<"]"<<std::endl);
+    bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::InsertHtmlHelp()"
+                     <<std::endl);
     
     //-------------
     // General info 
@@ -390,12 +396,14 @@ namespace bbtk
          col = ubbcol; 
          iotype = 1;
        }
+#ifdef USE_WXWIDGETS
       else if (in->second->GetCreatorTypeInfo() == 
               typeid(WxBlackBoxDescriptor))
        {
          col = wxbbcol; 
          iotype = 2;
        }
+#endif
 
       std::string name(in->second->GetName());
       Utilities::html_format(name);
@@ -407,7 +415,8 @@ namespace bbtk
       
       std::string descr(in->second->GetDescription());
       //Utilities::html_format(descr);
-      
+
+/*EED 10/11/2009
       std::string out = 
        "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
        +"\"><B><PRE> "+name+" </PRE></B></TD>"
@@ -415,7 +424,16 @@ namespace bbtk
        +"\"><I><PRE> "+type+" </PRE></I></TD>"
        + "<TD style='vertical-align: top;' bgcolor=\""+col
        +"\">"+descr+"</TD></TR>\n";
-      
+*/      
+
+      std::string out = 
+       "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
+       +"\"><B><PRE> "+name+" </PRE></B></TD>"
+       + "<TD style='vertical-align: top;' bgcolor=\""+col
+       +"\"><I><PRE> "+descr+" </PRE></I></TD>"
+       + "<TD style='vertical-align: top;' bgcolor=\""+col
+       +"\">"+type+"</TD></TR>\n";
+
       if (iotype==0) user_defined.push_back(out);
       else if (iotype==1) ubb_defined.push_back(out);
       else if (iotype==2) wxbb_defined.push_back(out);
@@ -453,12 +471,14 @@ namespace bbtk
            col = ubbcol; 
            iotype = 1;
          }
+#ifdef USE_WXWIDGETS
        else if (o->second->GetCreatorTypeInfo() == 
                 typeid(WxBlackBoxDescriptor))
          {
            col = wxbbcol; 
            iotype = 2;
          }
+#endif
        
        std::string name(o->second->GetName());
        Utilities::html_format(name);
@@ -471,6 +491,7 @@ namespace bbtk
        std::string descr(o->second->GetDescription());
        //Utilities::html_format(descr);
        
+/*EED 10/11/2009
        std::string out = 
          "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
          +"\"><B><PRE> "+name+" </PRE></B></TD>"
@@ -478,7 +499,15 @@ namespace bbtk
          +"\"><I><PRE> "+type+" </PRE></I></TD>"
          + "<TD style='vertical-align: top;' bgcolor=\""+col
          +"\">"+descr+"</TD></TR>\n";
-       
+*/
+       std::string out = 
+         "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
+         +"\"><B><PRE> "+name+" </PRE></B></TD>"
+         + "<TD style='vertical-align: top;' bgcolor=\""+col
+         +"\"><I><PRE> "+descr+" </PRE></I></TD>"
+         + "<TD style='vertical-align: top;' bgcolor=\""+col
+         +"\">"+type+"</TD></TR>\n";
+
        if (iotype==0) user_defined.push_back(out);
        else if (iotype==1) ubb_defined.push_back(out);
        else if (iotype==2) wxbb_defined.push_back(out);
@@ -494,7 +523,7 @@ namespace bbtk
     //------------
     // End
 
-    bbtkDebugDecTab("Kernel",9);
+
    }
   //=========================================================================