]> Creatis software - bbtk.git/blobdiff - packages/wx/src/bbwxLayoutTab.cxx
#3073 BBTK Bug New Normal - message documentation in boxes
[bbtk.git] / packages / wx / src / bbwxLayoutTab.cxx
index a5be0dec3e40d220dae7049509a10c4b5d7d2d37..9bdcdaa46ed7cafc3da42e61eaf7cd0585041435 100644 (file)
@@ -45,7 +45,7 @@
 #include "bbwxLayoutTab.h"
 #include "bbwxPackage.h"
 #include "bbtkUtilities.h"
-
+#include "bbtkBlackBoxInputConnector.h"
 
 
 
@@ -81,19 +81,62 @@ namespace bbwx
        {
        }
        
-       
        //-----------------------------------------------------------------     
   void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
   {
     wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
     if (w!=NULL)
-      {
-       book->AddPage(w,w->GetName());
-      }
+    {
+               book->AddPage(w,w->GetName());
+    }
+  }
+
+
+  void LayoutTab::SetTitleTabs()
+  {
+
+       std::vector<std::string> vecTitle;
+       std::vector<std::string> vecInputNameWidget;
+       vecInputNameWidget.push_back("Widget1");        
+       vecInputNameWidget.push_back("Widget2");        
+       vecInputNameWidget.push_back("Widget3");        
+       vecInputNameWidget.push_back("Widget4");        
+       vecInputNameWidget.push_back("Widget5");        
+       vecInputNameWidget.push_back("Widget6");        
+       vecInputNameWidget.push_back("Widget7");        
+       vecInputNameWidget.push_back("Widget8");        
+       vecInputNameWidget.push_back("Widget9");        
+       int iWidget,sizeVecInputNameWidget= vecInputNameWidget.size();
+       for (iWidget=0; iWidget<sizeVecInputNameWidget; iWidget++)
+       {
+               bbtk::BlackBoxInputConnector* c = bbGetInputConnectorMap().find( vecInputNameWidget[iWidget] )->second ;
+       if ( c->IsConnected() )
+       {
+                       // Get black box from 
+                       BlackBox::Pointer from = c->GetConnection()->GetBlackBoxFrom();
+                       typename WidgetBlackBox<wxWindow>::Pointer wfrom 
+                               = boost::dynamic_pointer_cast<WidgetBlackBox<wxWindow> >(from);
+                       vecTitle.push_back( wfrom->bbGetInputWinTitle() );
+               } // if c
+       } // for iWidget
+
+
+       wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+       if (w!=NULL) 
+       {
+               int i,size=vecTitle.size();
+               for (i=0; i<size; i++)
+               {
+                       w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) ); 
+               } // for i
+       } //w
   }
 
+
   void LayoutTab::Process() 
   { 
+       PutWinTitle();
+       SetTitleTabs();
   }