#include <bbtkWxGUIPackageBrowser2.h>
Public Member Functions | |
WxGUIBlackBoxInfo (wxWindow *parent) | |
~WxGUIBlackBoxInfo () | |
void | UpdateInfo (BlackBoxDescriptor *descr) |
void | InsertInputOutput (wxListCtrl *l, BlackBoxInputOutputDescriptor *i) |
Private Attributes | |
BlackBoxDescriptor * | mDescriptor |
wxStaticText * | mName |
wxStaticText * | mDescription |
wxStaticText * | mAuthor |
wxStaticText * | mCategory |
wxListCtrl * | mInputList |
wxListCtrl * | mOutputList |
Definition at line 94 of file bbtkWxGUIPackageBrowser2.h.
bbtk::WxGUIBlackBoxInfo::WxGUIBlackBoxInfo | ( | wxWindow * | parent | ) |
Definition at line 598 of file bbtkWxGUIPackageBrowser2.cxx.
References _T, mAuthor, mCategory, mDescription, mInputList, and mOutputList.
00599 : 00600 wxPanel(parent, -1), 00601 mDescriptor() 00602 { 00603 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); 00604 00605 // mName = new wxStaticText(this,-1,_T("")); 00606 // sizer->Add(mName,0,wxGROW); 00607 mDescription = new wxStaticText(this,-1,_T("")); 00608 sizer->Add(mDescription,0,wxGROW); 00609 mAuthor = new wxStaticText(this,-1,_T("")); 00610 sizer->Add(mAuthor,0,wxGROW); 00611 mCategory = new wxStaticText(this,-1,_T("")); 00612 sizer->Add(mCategory,0,wxGROW); 00613 00614 wxBoxSizer *inputs = 00615 new wxStaticBoxSizer 00616 ( new wxStaticBox(this, wxID_ANY, _T("Inputs")), wxVERTICAL ); 00617 mInputList = new wxListCtrl(this, -1, 00618 wxDefaultPosition, 00619 wxDefaultSize, 00620 wxLC_REPORT //wxLC_LIST 00621 | wxSUNKEN_BORDER); 00622 00623 inputs->Add(mInputList,1,wxGROW); 00624 sizer->Add(inputs,1,wxGROW); 00625 00626 wxBoxSizer *outputs = 00627 new wxStaticBoxSizer 00628 ( new wxStaticBox(this, wxID_ANY, _T("Outputs")), wxVERTICAL ); 00629 mOutputList = new wxListCtrl(this, -1, 00630 wxDefaultPosition, 00631 wxDefaultSize, 00632 wxLC_REPORT //wxLC_LIST 00633 | wxSUNKEN_BORDER); 00634 00635 outputs->Add(mOutputList,1,wxGROW); 00636 sizer->Add(outputs,1,wxGROW); 00637 00638 SetSizer(sizer); 00639 SetAutoLayout(true); 00640 Layout(); 00641 } //================================================================
bbtk::WxGUIBlackBoxInfo::~WxGUIBlackBoxInfo | ( | ) |
void bbtk::WxGUIBlackBoxInfo::InsertInputOutput | ( | wxListCtrl * | l, | |
BlackBoxInputOutputDescriptor * | i | |||
) |
Definition at line 758 of file bbtkWxGUIPackageBrowser2.cxx.
References bbtk::BlackBoxInputOutputDescriptor::GetDescription(), bbtk::BlackBoxInputOutputDescriptor::GetName(), bbtk::BlackBoxInputOutputDescriptor::GetNature(), bbtk::BlackBoxInputOutputDescriptor::GetTypeName(), and bbtk::std2wx().
Referenced by UpdateInfo().
00760 { 00761 wxListItem kNewItem; 00762 kNewItem.SetAlign(wxLIST_FORMAT_LEFT); 00763 int nID = l->GetItemCount(); 00764 // std::cout << nID << std::endl; 00765 kNewItem.SetId(nID); 00766 // kNewItem.SetMask(wxLIST_MASK_DATA); 00767 // kNewItem.SetData(d); 00768 l->InsertItem(kNewItem); 00769 l->SetItem(nID, 0, std2wx(d->GetName()) ); 00770 l->SetItem(nID, 1, std2wx(d->GetTypeName()) ); 00771 l->SetItem(nID, 2, std2wx(d->GetNature()) ); 00772 l->SetItem(nID, 3, std2wx(d->GetDescription()) ); 00773 }
void bbtk::WxGUIBlackBoxInfo::UpdateInfo | ( | BlackBoxDescriptor * | descr | ) |
Definition at line 646 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().
00647 { 00648 00649 // mName->SetLabel(std2wx(descr->GetTypeName())); 00650 mDescription->SetLabel(std2wx(descr->GetDescription())); 00651 mAuthor->SetLabel(std2wx(descr->GetAuthor())); 00652 mCategory->SetLabel(std2wx(descr->GetCategory())); 00653 00654 mInputList->ClearAll(); 00655 mInputList->InsertColumn( 0, _("Name"), 00656 wxLIST_FORMAT_LEFT, 80 ); 00657 mInputList->InsertColumn( 1, _("Type"), 00658 wxLIST_FORMAT_LEFT, 100 ); 00659 mInputList->InsertColumn( 2, _("Nature"), 00660 wxLIST_FORMAT_LEFT, 100 ); 00661 mInputList->InsertColumn( 3, _("Description"), 00662 wxLIST_FORMAT_LEFT, 500 ); 00663 00664 mOutputList->ClearAll(); 00665 mOutputList->InsertColumn( 0, _("Name"), 00666 wxLIST_FORMAT_LEFT, 80 ); 00667 mOutputList->InsertColumn( 1, _("Type"), 00668 wxLIST_FORMAT_LEFT, 100 ); 00669 mOutputList->InsertColumn( 2, _("Nature"), 00670 wxLIST_FORMAT_LEFT, 100 ); 00671 mOutputList->InsertColumn( 3, _("Description"), 00672 wxLIST_FORMAT_LEFT, 500 ); 00673 00674 00675 std::vector<BlackBoxInputOutputDescriptor*> user_defined; 00676 std::vector<BlackBoxInputOutputDescriptor*> ubb_defined; 00677 std::vector<BlackBoxInputOutputDescriptor*> wxbb_defined; 00678 00679 const BlackBoxDescriptor::InputDescriptorMapType& imap = 00680 descr->GetInputDescriptorMap(); 00681 BlackBoxDescriptor::InputDescriptorMapType::const_iterator in; 00682 for ( in = imap.begin(); in != imap.end(); ++in ) 00683 { 00684 int iotype = 0; 00685 if (in->second->GetCreatorTypeInfo() == 00686 typeid(AtomicBlackBoxDescriptor)) 00687 { 00688 iotype = 1; 00689 } 00690 else if (in->second->GetCreatorTypeInfo() == 00691 typeid(WxBlackBoxDescriptor)) 00692 { 00693 iotype = 2; 00694 } 00695 if (iotype==0) user_defined.push_back(in->second); 00696 else if (iotype==1) ubb_defined.push_back(in->second); 00697 else if (iotype==2) wxbb_defined.push_back(in->second); 00698 00699 } 00700 00701 std::vector<BlackBoxInputOutputDescriptor*>::iterator hi; 00702 for (hi=user_defined.begin();hi!=user_defined.end();++hi) 00703 { 00704 InsertInputOutput(mInputList,*hi); 00705 } 00706 for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) 00707 { 00708 InsertInputOutput(mInputList,*hi); 00709 } 00710 for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) 00711 { 00712 InsertInputOutput(mInputList,*hi); 00713 } 00714 00715 // Outputs 00716 user_defined.clear(); 00717 ubb_defined.clear(); 00718 wxbb_defined.clear(); 00719 const BlackBoxDescriptor::OutputDescriptorMapType& omap = 00720 descr->GetOutputDescriptorMap(); 00721 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator out; 00722 for ( out = omap.begin(); out != omap.end(); ++out ) 00723 { 00724 int iotype = 0; 00725 if (out->second->GetCreatorTypeInfo() == 00726 typeid(AtomicBlackBoxDescriptor)) 00727 { 00728 iotype = 1; 00729 } 00730 else if (out->second->GetCreatorTypeInfo() == 00731 typeid(WxBlackBoxDescriptor)) 00732 { 00733 iotype = 2; 00734 } 00735 00736 if (iotype==0) user_defined.push_back(out->second); 00737 else if (iotype==1) ubb_defined.push_back(out->second); 00738 else if (iotype==2) wxbb_defined.push_back(out->second); 00739 00740 } 00741 for (hi=user_defined.begin();hi!=user_defined.end();++hi) 00742 { 00743 InsertInputOutput(mOutputList,*hi); 00744 } 00745 for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) 00746 { 00747 InsertInputOutput(mOutputList,*hi); 00748 } 00749 for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) 00750 { 00751 InsertInputOutput(mOutputList,*hi); 00752 } 00753 }
wxStaticText* bbtk::WxGUIBlackBoxInfo::mAuthor [private] |
Definition at line 106 of file bbtkWxGUIPackageBrowser2.h.
Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().
wxStaticText* bbtk::WxGUIBlackBoxInfo::mCategory [private] |
Definition at line 107 of file bbtkWxGUIPackageBrowser2.h.
Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().
wxStaticText* bbtk::WxGUIBlackBoxInfo::mDescription [private] |
Definition at line 105 of file bbtkWxGUIPackageBrowser2.h.
Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().
Definition at line 103 of file bbtkWxGUIPackageBrowser2.h.
wxListCtrl* bbtk::WxGUIBlackBoxInfo::mInputList [private] |
Definition at line 109 of file bbtkWxGUIPackageBrowser2.h.
Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().
wxStaticText* bbtk::WxGUIBlackBoxInfo::mName [private] |
Definition at line 104 of file bbtkWxGUIPackageBrowser2.h.
wxListCtrl* bbtk::WxGUIBlackBoxInfo::mOutputList [private] |
Definition at line 110 of file bbtkWxGUIPackageBrowser2.h.
Referenced by UpdateInfo(), and WxGUIBlackBoxInfo().