bbtk::WxGUIBlackBoxInfo Class Reference

#include <bbtkWxGUIPackageBrowser2.h>

List of all members.

Public Member Functions

 WxGUIBlackBoxInfo (wxWindow *parent)
 ~WxGUIBlackBoxInfo ()
void UpdateInfo (BlackBoxDescriptor *descr)
void InsertInputOutput (wxListCtrl *l, BlackBoxInputOutputDescriptor *i)

Private Attributes

BlackBoxDescriptormDescriptor
wxStaticText * mName
wxStaticText * mDescription
wxStaticText * mAuthor
wxStaticText * mCategory
wxListCtrl * mInputList
wxListCtrl * mOutputList


Detailed Description

Definition at line 91 of file bbtkWxGUIPackageBrowser2.h.


Constructor & Destructor Documentation

bbtk::WxGUIBlackBoxInfo::WxGUIBlackBoxInfo ( wxWindow *  parent  ) 

Definition at line 573 of file bbtkWxGUIPackageBrowser2.cxx.

References _T, mAuthor, mCategory, mDescription, mInputList, and mOutputList.

00574     :
00575     wxPanel(parent, -1),
00576     mDescriptor()
00577   {
00578     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
00579     
00580     //    mName = new wxStaticText(this,-1,_T(""));
00581     //    sizer->Add(mName,0,wxGROW);
00582     mDescription = new wxStaticText(this,-1,_T(""));
00583     sizer->Add(mDescription,0,wxGROW);
00584     mAuthor = new wxStaticText(this,-1,_T(""));
00585     sizer->Add(mAuthor,0,wxGROW);
00586     mCategory = new wxStaticText(this,-1,_T(""));
00587     sizer->Add(mCategory,0,wxGROW);
00588 
00589 
00590     wxBoxSizer *inputs = 
00591       new wxStaticBoxSizer
00592       ( new wxStaticBox(this, wxID_ANY, _T("Inputs")), wxVERTICAL );    
00593     mInputList = new wxListCtrl(this, -1,
00594                                 wxDefaultPosition,
00595                                 wxDefaultSize,
00596                                 wxLC_REPORT //wxLC_LIST
00597                                 | wxSUNKEN_BORDER);
00598     
00599     
00600     inputs->Add(mInputList,1,wxGROW);
00601     sizer->Add(inputs,1,wxGROW);
00602 
00603     wxBoxSizer *outputs = 
00604       new wxStaticBoxSizer
00605       ( new wxStaticBox(this, wxID_ANY, _T("Outputs")), wxVERTICAL );    
00606     mOutputList = new wxListCtrl(this, -1,
00607                                  wxDefaultPosition,
00608                                  wxDefaultSize,
00609                                  wxLC_REPORT //wxLC_LIST
00610                                  | wxSUNKEN_BORDER);
00611     
00612     outputs->Add(mOutputList,1,wxGROW);
00613     sizer->Add(outputs,1,wxGROW);
00614     
00615     
00616     SetSizer(sizer);
00617     SetAutoLayout(true);
00618     Layout();
00619   }
  //================================================================

bbtk::WxGUIBlackBoxInfo::~WxGUIBlackBoxInfo (  ) 

Definition at line 755 of file bbtkWxGUIPackageBrowser2.cxx.

00756   {
00757   }


Member Function Documentation

void bbtk::WxGUIBlackBoxInfo::UpdateInfo ( BlackBoxDescriptor descr  ) 

Definition at line 624 of file bbtkWxGUIPackageBrowser2.cxx.

References bbtk::BlackBoxDescriptor::GetAuthor(), bbtk::BlackBoxDescriptor::GetCategory(), bbtk::BlackBoxDescriptor::GetDescription(), bbtk::BlackBoxDescriptor::GetInputDescriptorMap(), bbtk::BlackBoxDescriptor::GetOutputDescriptorMap(), InsertInputOutput(), mAuthor, mCategory, mDescription, mInputList, mOutputList, and bbtk::std2wx().

Referenced by bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected().

00625   {
00626 
00627     //    mName->SetLabel(std2wx(descr->GetTypeName()));
00628     mDescription->SetLabel(std2wx(descr->GetDescription()));
00629     mAuthor->SetLabel(std2wx(descr->GetAuthor()));
00630     mCategory->SetLabel(std2wx(descr->GetCategory()));
00631     
00632     mInputList->ClearAll();
00633     mInputList->InsertColumn( 0, _("Name"), 
00634                                wxLIST_FORMAT_LEFT, 80  ); 
00635     mInputList->InsertColumn( 1, _("Type"), 
00636                                wxLIST_FORMAT_LEFT, 100 ); 
00637     mInputList->InsertColumn( 2, _("Nature"), 
00638                                wxLIST_FORMAT_LEFT, 100  ); 
00639     mInputList->InsertColumn( 3, _("Description"), 
00640                                wxLIST_FORMAT_LEFT, 500  ); 
00641 
00642     mOutputList->ClearAll();
00643     mOutputList->InsertColumn( 0, _("Name"), 
00644                                wxLIST_FORMAT_LEFT, 80  ); 
00645     mOutputList->InsertColumn( 1, _("Type"), 
00646                                wxLIST_FORMAT_LEFT, 100 ); 
00647     mOutputList->InsertColumn( 2, _("Nature"), 
00648                                wxLIST_FORMAT_LEFT, 100  ); 
00649     mOutputList->InsertColumn( 3, _("Description"), 
00650                                wxLIST_FORMAT_LEFT, 500  ); 
00651     
00652 
00653     std::vector<BlackBoxInputOutputDescriptor*> user_defined;
00654     std::vector<BlackBoxInputOutputDescriptor*> ubb_defined;
00655     std::vector<BlackBoxInputOutputDescriptor*> wxbb_defined;
00656     
00657     const BlackBoxDescriptor::InputDescriptorMapType& imap = 
00658       descr->GetInputDescriptorMap();
00659     BlackBoxDescriptor::InputDescriptorMapType::const_iterator in;
00660     for ( in = imap.begin();  in != imap.end(); ++in ) 
00661       {
00662         int iotype = 0;
00663         if (in->second->GetCreatorTypeInfo() == 
00664             typeid(AtomicBlackBoxDescriptor))
00665           {
00666             iotype = 1;
00667           }
00668         else if (in->second->GetCreatorTypeInfo() == 
00669                  typeid(WxBlackBoxDescriptor))
00670           {
00671             iotype = 2;
00672           }
00673         if (iotype==0) user_defined.push_back(in->second);
00674         else if (iotype==1) ubb_defined.push_back(in->second);
00675         else if (iotype==2) wxbb_defined.push_back(in->second);
00676         
00677       }
00678 
00679     std::vector<BlackBoxInputOutputDescriptor*>::iterator hi;
00680     for (hi=user_defined.begin();hi!=user_defined.end();++hi) 
00681       {
00682         InsertInputOutput(mInputList,*hi);
00683       }
00684     for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) 
00685       {
00686         InsertInputOutput(mInputList,*hi);
00687       }
00688     for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) 
00689       {
00690         InsertInputOutput(mInputList,*hi);
00691       }
00692     
00693     // Outputs
00694     user_defined.clear();
00695     ubb_defined.clear();
00696     wxbb_defined.clear();
00697     const BlackBoxDescriptor::OutputDescriptorMapType& omap = 
00698       descr->GetOutputDescriptorMap();
00699     BlackBoxDescriptor::OutputDescriptorMapType::const_iterator out;
00700     for ( out = omap.begin();  out != omap.end(); ++out ) 
00701       {
00702         int iotype = 0;
00703         if (out->second->GetCreatorTypeInfo() == 
00704             typeid(AtomicBlackBoxDescriptor))
00705           {
00706             iotype = 1;
00707           }
00708         else if (out->second->GetCreatorTypeInfo() == 
00709                  typeid(WxBlackBoxDescriptor))
00710           {
00711             iotype = 2;
00712           }
00713        
00714         if (iotype==0) user_defined.push_back(out->second);
00715         else if (iotype==1) ubb_defined.push_back(out->second);
00716         else if (iotype==2) wxbb_defined.push_back(out->second);
00717 
00718       }
00719     for (hi=user_defined.begin();hi!=user_defined.end();++hi) 
00720       {
00721         InsertInputOutput(mOutputList,*hi);
00722       }
00723     for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) 
00724       {
00725         InsertInputOutput(mOutputList,*hi);
00726       }
00727     for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) 
00728       {
00729         InsertInputOutput(mOutputList,*hi);
00730       }
00731   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::WxGUIBlackBoxInfo::InsertInputOutput ( wxListCtrl *  l,
BlackBoxInputOutputDescriptor i 
)

Definition at line 736 of file bbtkWxGUIPackageBrowser2.cxx.

References bbtk::BlackBoxInputOutputDescriptor::GetDescription(), bbtk::BlackBoxInputOutputDescriptor::GetName(), bbtk::BlackBoxInputOutputDescriptor::GetNature(), bbtk::BlackBoxInputOutputDescriptor::GetTypeName(), and bbtk::std2wx().

Referenced by UpdateInfo().

00738   {
00739     wxListItem kNewItem;
00740     kNewItem.SetAlign(wxLIST_FORMAT_LEFT);
00741     int nID = l->GetItemCount();
00742     //    std::cout << nID << std::endl;
00743     kNewItem.SetId(nID);
00744     //    kNewItem.SetMask(wxLIST_MASK_DATA);
00745     //    kNewItem.SetData(d);  
00746     l->InsertItem(kNewItem);
00747     l->SetItem(nID, 0, std2wx(d->GetName()) );
00748     l->SetItem(nID, 1, std2wx(d->GetTypeName()) );
00749     l->SetItem(nID, 2, std2wx(d->GetNature()) );
00750     l->SetItem(nID, 3, std2wx(d->GetDescription()) );
00751   }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

BlackBoxDescriptor* bbtk::WxGUIBlackBoxInfo::mDescriptor [private]

Definition at line 100 of file bbtkWxGUIPackageBrowser2.h.

wxStaticText* bbtk::WxGUIBlackBoxInfo::mName [private]

Definition at line 101 of file bbtkWxGUIPackageBrowser2.h.

wxStaticText* bbtk::WxGUIBlackBoxInfo::mDescription [private]

Definition at line 102 of file bbtkWxGUIPackageBrowser2.h.

Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().

wxStaticText* bbtk::WxGUIBlackBoxInfo::mAuthor [private]

Definition at line 103 of file bbtkWxGUIPackageBrowser2.h.

Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().

wxStaticText* bbtk::WxGUIBlackBoxInfo::mCategory [private]

Definition at line 104 of file bbtkWxGUIPackageBrowser2.h.

Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().

wxListCtrl* bbtk::WxGUIBlackBoxInfo::mInputList [private]

Definition at line 106 of file bbtkWxGUIPackageBrowser2.h.

Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().

wxListCtrl* bbtk::WxGUIBlackBoxInfo::mOutputList [private]

Definition at line 107 of file bbtkWxGUIPackageBrowser2.h.

Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().


The documentation for this class was generated from the following files:

Generated on Wed Nov 12 11:38:58 2008 for BBTK by  doxygen 1.5.6