#include <bbtkWxGUIPackageBrowser2.h>
Definition at line 196 of file bbtkWxGUIPackageBrowser2.h.
bbtk::WxGUIPackageBrowser2::WxGUIPackageBrowser2 | ( | wxWindow * | parent, | |
WxGUIPackageBrowser2User * | user = 0 | |||
) |
Definition at line 799 of file bbtkWxGUIPackageBrowser2.cxx.
References _actualSelected, _T, bbtk::id_f1, bbtk::id_f2, bbtk::id_f3, bbtk::id_f4, bbtk::id_f5, bbtk::id_f6, bbtk::id_f7, bbtk::id_f8, bbtk::id_fc1, bbtk::id_fc2, bbtk::id_fc3, LIST_CTRL, m_mgr, mBoxInfo, mBoxList, mCategoryFilter, mDescriptionFilter, mInputNatureFilter, mInputTypeFilter, mNameFilter, mOutputNatureFilter, mOutputTypeFilter, mPackageFilter, mShowAdaptorsFilter, mShowGUIsFilter, mShowWidgetsFilter, and bbtk::WxGUIBlackBoxList::SetUser().
00801 : wxPanel(parent, -1), 00802 mUser(user), 00803 mInterpreter() 00804 { 00805 _actualSelected=NULL; 00806 m_mgr.SetManagedWindow(this); 00807 00808 // wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); 00809 mBoxList = new WxGUIBlackBoxList(this, LIST_CTRL, 00810 wxDefaultPosition, 00811 wxDefaultSize, 00812 wxLC_REPORT //wxLC_LIST 00813 | wxSUNKEN_BORDER); 00814 mBoxList->SetUser(this); 00815 mBoxList->SetBackgroundColour(*wxWHITE); 00816 00817 00818 // JGRR & CM DISABLED CLOSE BUTTON 00819 m_mgr.AddPane(mBoxList, 00820 wxAuiPaneInfo().Name(wxT("BoxList")) 00821 .Caption(wxT("Black Boxes")) 00822 .MinimizeButton(true) 00823 .MaximizeButton(true) 00824 .Center() 00825 .MinSize(wxSize(100,100)) 00826 .CloseButton(false) 00827 ); 00828 // sizer->Add(mBoxList,5,wxGROW); 00829 00830 mBoxInfo = new WxGUIBlackBoxInfo(this); 00831 // sizer->Add(mBoxInfo,3,wxGROW); 00832 00833 // JGRR & CM DISABLED CLOSE BUTTON 00834 m_mgr.AddPane(mBoxInfo, 00835 wxAuiPaneInfo().Name(wxT("Box")) 00836 .Caption(wxT("")) 00837 .MinimizeButton(true) 00838 .MaximizeButton(true) 00839 .Bottom() 00840 .MinSize(wxSize(100,200)) 00841 .CloseButton(false) 00842 ); 00843 00844 wxPanel* filters = new wxPanel(this,-1); 00845 wxBoxSizer *fsizer = new wxBoxSizer(wxVERTICAL ); 00846 wxBoxSizer *fpack = 00847 new wxStaticBoxSizer 00848 ( new wxStaticBox(filters, wxID_ANY, _T("Package")), wxHORIZONTAL ); 00849 mPackageFilter = new wxTextCtrl(filters,id_f1,_T(""), 00850 wxDefaultPosition, 00851 wxDefaultSize, 00852 wxTE_PROCESS_ENTER); 00853 fpack->Add(mPackageFilter,1,wxGROW); 00854 fsizer->Add(fpack,0,wxGROW); 00855 wxBoxSizer *fname = 00856 new wxStaticBoxSizer 00857 ( new wxStaticBox(filters, wxID_ANY, _T("Name")), wxHORIZONTAL ); 00858 mNameFilter = new wxTextCtrl(filters,id_f2,_T(""), 00859 wxDefaultPosition, 00860 wxDefaultSize, 00861 wxTE_PROCESS_ENTER); 00862 fname->Add(mNameFilter,1,wxGROW); 00863 fsizer->Add(fname,0,wxGROW); 00864 wxBoxSizer *fdescr = 00865 new wxStaticBoxSizer 00866 ( new wxStaticBox(filters, wxID_ANY, _T("Description")), wxHORIZONTAL ); 00867 mDescriptionFilter = new wxTextCtrl(filters,id_f3,_T(""), 00868 wxDefaultPosition, 00869 wxDefaultSize, 00870 wxTE_PROCESS_ENTER); 00871 fdescr->Add(mDescriptionFilter,1,wxGROW); 00872 fsizer->Add(fdescr,0,wxGROW); 00873 wxBoxSizer *fcat = 00874 new wxStaticBoxSizer 00875 ( new wxStaticBox(filters, wxID_ANY, _T("Category")), wxHORIZONTAL ); 00876 mCategoryFilter = new wxTextCtrl(filters,id_f4,_T(""), 00877 wxDefaultPosition, 00878 wxDefaultSize, 00879 wxTE_PROCESS_ENTER); 00880 fcat->Add(mCategoryFilter,1,wxGROW); 00881 fsizer->Add(fcat,0,wxGROW); 00882 wxBoxSizer *fintype = 00883 new wxStaticBoxSizer 00884 ( new wxStaticBox(filters, wxID_ANY, _T("Input type")), wxHORIZONTAL ); 00885 mInputTypeFilter = new wxTextCtrl(filters,id_f5,_T(""), 00886 wxDefaultPosition, 00887 wxDefaultSize, 00888 wxTE_PROCESS_ENTER); 00889 fintype->Add(mInputTypeFilter,1,wxGROW); 00890 fsizer->Add(fintype,0,wxGROW); 00891 wxBoxSizer *fouttype = 00892 new wxStaticBoxSizer 00893 ( new wxStaticBox(filters, wxID_ANY, _T("Output type")), wxHORIZONTAL ); 00894 mOutputTypeFilter = new wxTextCtrl(filters,id_f6,_T(""), 00895 wxDefaultPosition, 00896 wxDefaultSize, 00897 wxTE_PROCESS_ENTER); 00898 fouttype->Add(mOutputTypeFilter,1,wxGROW); 00899 fsizer->Add(fouttype,0,wxGROW); 00900 wxBoxSizer *finnat = 00901 new wxStaticBoxSizer 00902 ( new wxStaticBox(filters, wxID_ANY, _T("Input nature")),wxHORIZONTAL ); 00903 mInputNatureFilter = new wxTextCtrl(filters,id_f7,_T(""), 00904 wxDefaultPosition, 00905 wxDefaultSize, 00906 wxTE_PROCESS_ENTER); 00907 finnat->Add(mInputNatureFilter,1,wxGROW); 00908 fsizer->Add(finnat,0,wxGROW); 00909 wxBoxSizer *foutnat = 00910 new wxStaticBoxSizer 00911 ( new wxStaticBox(filters, wxID_ANY,_T("Output nature")),wxHORIZONTAL ); 00912 mOutputNatureFilter = new wxTextCtrl(filters,id_f8,_T(""), 00913 wxDefaultPosition, 00914 wxDefaultSize, 00915 wxTE_PROCESS_ENTER); 00916 foutnat->Add(mOutputNatureFilter,1,wxGROW); 00917 fsizer->Add(foutnat,0,wxGROW); 00918 00919 mShowWidgetsFilter = new wxCheckBox(filters,id_fc1,_T("Show widgets")); 00920 mShowWidgetsFilter->SetValue(true); 00921 fsizer->Add(mShowWidgetsFilter,0,wxGROW); 00922 00923 mShowAdaptorsFilter = new wxCheckBox(filters,id_fc2,_T("Show adaptors")); 00924 mShowAdaptorsFilter->SetValue(false); 00925 fsizer->Add(mShowAdaptorsFilter,0,wxGROW); 00926 00927 mShowGUIsFilter = new wxCheckBox(filters,id_fc3,_T("Show GUIs")); 00928 mShowGUIsFilter->SetValue(false); 00929 fsizer->Add(mShowGUIsFilter,0,wxGROW); 00930 00931 filters->SetSizer(fsizer); 00932 00933 // JGRR & CM DISABLED CLOSE BUTTON 00934 m_mgr.AddPane(filters, 00935 wxAuiPaneInfo().Name(wxT("Filter")) 00936 .Caption(wxT("Filter")) 00937 .MinimizeButton(true) 00938 .MaximizeButton(true) 00939 .Left() 00940 .MinSize(wxSize(100,100)) 00941 .CloseButton(false) 00942 ); 00943 00944 // sizer->Add(fsizer,1,wxGROW); 00945 m_mgr.Update(); 00946 00947 // SetSizer(sizer); 00948 SetAutoLayout(true); 00949 Layout(); 00950 00951 }
bbtk::WxGUIPackageBrowser2::~WxGUIPackageBrowser2 | ( | ) |
Definition at line 994 of file bbtkWxGUIPackageBrowser2.cxx.
References m_mgr, mFactory, and mInterpreter.
00995 { 00996 mFactory.reset(); 00997 mInterpreter.reset(); 00998 // Object::PrintObjectListInfo(""); 00999 m_mgr.UnInit(); 01000 }
void bbtk::WxGUIPackageBrowser2::BuildFromFactory | ( | Factory::Pointer | f | ) |
Definition at line 1020 of file bbtkWxGUIPackageBrowser2.cxx.
References mFactory, and RebuildList().
Referenced by IncludeAll().
01021 { 01022 mFactory = F; 01023 RebuildList(); 01024 }
bool bbtk::WxGUIPackageBrowser2::findnpos | ( | const std::string & | strA, | |
const std::string & | strB | |||
) | [private] |
Definition at line 1055 of file bbtkWxGUIPackageBrowser2.cxx.
References bbtk::i.
Referenced by IsVisible().
01056 { 01057 if ((strB=="") || (strA=="") ) 01058 { 01059 return false; 01060 } 01061 01062 bool ok=false; 01063 int i,size; 01064 std::string strAA=strA; 01065 std::string strBB=strB; 01066 01067 01068 size=strAA.length(); 01069 for (i=0;i<size;i++) 01070 { 01071 if ((strAA[i]>='A')&&(strAA[i]<='Z')) 01072 { 01073 strAA[i]=strAA[i]+32; 01074 } 01075 } 01076 01077 size=strBB.length(); 01078 for (i=0;i<size;i++) 01079 { 01080 if ((strBB[i]>='A')&&(strBB[i]<='Z')) 01081 { 01082 strBB[i]=strBB[i]+32; 01083 } 01084 } 01085 01086 01087 if ( strAA.find(strBB) == std::string::npos ) 01088 { 01089 ok=true; 01090 } 01091 01092 return ok; 01093 }
BlackBoxDescriptor * bbtk::WxGUIPackageBrowser2::GetActualSelected | ( | ) |
Definition at line 986 of file bbtkWxGUIPackageBrowser2.cxx.
References _actualSelected.
00987 { 00988 return _actualSelected; 00989 }
Factory::Pointer bbtk::WxGUIPackageBrowser2::GetFactory | ( | ) |
Definition at line 954 of file bbtkWxGUIPackageBrowser2.cxx.
References mFactory.
00955 { 00956 return mFactory; 00957 }
void bbtk::WxGUIPackageBrowser2::IncludeAll | ( | ) |
Definition at line 1004 of file bbtkWxGUIPackageBrowser2.cxx.
References BuildFromFactory(), mInterpreter, and bbtk::InterpreterVirtual::New().
Referenced by WxGUIHelp::WxGUIHelp().
01005 { 01006 if (!mInterpreter) mInterpreter =bbtk::Interpreter::New(); 01007 mInterpreter->SetCommandLine(true); 01008 std::stringstream* buf = new std::stringstream; 01009 *buf << "exec freeze_no_error" << std::endl; 01010 *buf << "message max 0" << std::endl; 01011 *buf << "include *" << std::endl; 01012 mInterpreter->InterpretBuffer(buf); 01013 01014 Factory::Pointer F = mInterpreter->GetExecuter()->GetFactory(); 01015 BuildFromFactory(F); 01016 }
bool bbtk::WxGUIPackageBrowser2::IsVisible | ( | BlackBoxDescriptor::Pointer | d | ) |
Definition at line 1096 of file bbtkWxGUIPackageBrowser2.cxx.
References bbtk::BlackBoxDescriptor::ADAPTOR, bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR, bbtk::BlackBoxDescriptor::DEFAULT_GUI, findnpos(), bbtk::BlackBoxDescriptor::GUI, mCategoryFilter, mDescriptionFilter, mInputNatureFilter, mInputTypeFilter, mNameFilter, mOutputNatureFilter, mOutputTypeFilter, mPackageFilter, mShowAdaptorsFilter, mShowGUIsFilter, mShowWidgetsFilter, and bbtk::wx2std().
Referenced by RebuildList().
01097 { 01098 // std::cout << " '" << wx2std(mPackageFilter->GetValue())<<"'"<<std::endl; 01099 // std::cout << "vs '" << d->GetPackage()->GetName() << "'"<<std::endl; 01100 if ((!mShowAdaptorsFilter->IsChecked())&& 01101 ((d->GetKind()==BlackBoxDescriptor::ADAPTOR)|| 01102 (d->GetKind()==BlackBoxDescriptor::DEFAULT_ADAPTOR))) 01103 { 01104 return false; 01105 } 01106 01107 if ((!mShowGUIsFilter->IsChecked())&& 01108 ((d->GetKind()==BlackBoxDescriptor::GUI)|| 01109 (d->GetKind()==BlackBoxDescriptor::DEFAULT_GUI))) 01110 { 01111 return false; 01112 } 01113 01114 //EED if (d->GetPackage()->GetName().find( wx2std(mPackageFilter->GetValue()) ) == std::string::npos ) 01115 if ( findnpos(d->GetPackage()->GetName(),wx2std(mPackageFilter->GetValue())) == true ) 01116 { 01117 return false; 01118 } 01119 01120 //EED if (d->GetTypeName().find( wx2std(mNameFilter->GetValue()) ) == std::string::npos ) 01121 if ( findnpos(d->GetTypeName(),wx2std(mNameFilter->GetValue())) == true ) 01122 { 01123 return false; 01124 } 01125 01126 //EED if (d->GetDescription().find( wx2std(mDescriptionFilter->GetValue()) ) == std::string::npos ) 01127 if ( findnpos(d->GetDescription(),wx2std(mDescriptionFilter->GetValue())) == true ) 01128 { 01129 return false; 01130 } 01131 01132 //EED if (d->GetCategory().find( wx2std(mCategoryFilter->GetValue()) ) == std::string::npos ) 01133 if ( findnpos(d->GetCategory(),wx2std(mCategoryFilter->GetValue())) == true ) 01134 { 01135 return false; 01136 } 01137 01138 if (!mShowWidgetsFilter->IsChecked()) 01139 { 01140 bool found = false; 01141 const BlackBoxDescriptor::OutputDescriptorMapType& imap = d->GetOutputDescriptorMap(); 01142 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator in; 01143 for ( in = imap.begin(); in != imap.end(); ++in ) 01144 { 01145 if (in->second->GetName() == "Widget" ) 01146 { 01147 found = true; 01148 break; 01149 } 01150 } 01151 if (found) 01152 { 01153 return false; 01154 } 01155 } 01156 01157 if (mInputTypeFilter->GetValue().size()>0) 01158 { 01159 std::string s = wx2std(mInputTypeFilter->GetValue()); 01160 bool found = false; 01161 const BlackBoxDescriptor::InputDescriptorMapType& imap = d->GetInputDescriptorMap(); 01162 BlackBoxDescriptor::InputDescriptorMapType::const_iterator in; 01163 for ( in = imap.begin(); in != imap.end(); ++in ) 01164 { 01165 //EED if (in->second->GetTypeName().find(s)!=std::string::npos) 01166 if ( findnpos( in->second->GetTypeName() , s ) == true ) 01167 { 01168 found = true; 01169 break; 01170 } 01171 } 01172 if (!found) 01173 { 01174 return false; 01175 } 01176 } 01177 01178 if (mOutputTypeFilter->GetValue().size()>0) 01179 { 01180 std::string s = wx2std(mOutputTypeFilter->GetValue()); 01181 bool found = false; 01182 const BlackBoxDescriptor::OutputDescriptorMapType& imap = d->GetOutputDescriptorMap(); 01183 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator in; 01184 for ( in = imap.begin(); in != imap.end(); ++in ) 01185 { 01186 //EED if (in->second->GetTypeName().find(s)!=std::string::npos) 01187 if ( findnpos( in->second->GetTypeName() , s ) == true ) 01188 { 01189 found = true; 01190 break; 01191 } 01192 } 01193 if (!found) 01194 { 01195 return false; 01196 } 01197 } 01198 01199 if (mInputNatureFilter->GetValue().size()>0) 01200 { 01201 std::string s = wx2std(mInputNatureFilter->GetValue()); 01202 bool found = false; 01203 const BlackBoxDescriptor::InputDescriptorMapType& imap = d->GetInputDescriptorMap(); 01204 BlackBoxDescriptor::InputDescriptorMapType::const_iterator in; 01205 for ( in = imap.begin(); in != imap.end(); ++in ) 01206 { 01207 //EED if (in->second->GetNature().find(s)!=std::string::npos) 01208 if ( findnpos( in->second->GetNature() , s ) == true ) 01209 { 01210 found = true; 01211 break; 01212 } 01213 } 01214 if (!found) 01215 { 01216 return false; 01217 } 01218 } 01219 01220 if (mOutputNatureFilter->GetValue().size()>0) 01221 { 01222 std::string s = wx2std(mOutputNatureFilter->GetValue()); 01223 bool found = false; 01224 const BlackBoxDescriptor::OutputDescriptorMapType& imap = d->GetOutputDescriptorMap(); 01225 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator in; 01226 for ( in = imap.begin(); in != imap.end(); ++in ) 01227 { 01228 //EED if (in->second->GetNature().find(s)!=std::string::npos) 01229 if ( findnpos( in->second->GetNature() , s ) == true ) 01230 { 01231 found = true; 01232 break; 01233 } 01234 } 01235 if (!found) 01236 { 01237 return false; 01238 } 01239 } 01240 01241 return true; 01242 01243 }
void bbtk::WxGUIPackageBrowser2::OnFilter | ( | wxCommandEvent & | ) |
Definition at line 963 of file bbtkWxGUIPackageBrowser2.cxx.
References RebuildList().
00964 { 00965 RebuildList(); 00966 }
void bbtk::WxGUIPackageBrowser2::RebuildList | ( | ) |
Definition at line 1029 of file bbtkWxGUIPackageBrowser2.cxx.
References bbtk::i, bbtk::WxGUIBlackBoxList::Insert(), IsVisible(), mBoxList, and mFactory.
Referenced by BuildFromFactory(), and OnFilter().
01030 { 01031 mBoxList->Hide(); 01032 mBoxList->ClearAll(); 01033 01034 const Factory::PackageMapType& M = mFactory->GetPackageMap(); 01035 Factory::PackageMapType::const_iterator i; 01036 for (i=M.begin();i!=M.end();++i) 01037 { 01038 Package::Pointer P = i->second; 01039 if (P->GetName() == "user") continue; 01040 01041 Package::DescriptorMapType::iterator j; 01042 for (j=P->GetDescriptorMap().begin(); 01043 j!=P->GetDescriptorMap().end(); 01044 ++j) 01045 { 01046 // std::cout << "Insert "<<j->second->GetTypeName()<<std::endl; 01047 if (IsVisible(j->second)) 01048 mBoxList->Insert(j->second); 01049 }// for Descriptor 01050 }// for package 01051 mBoxList->Show(); 01052 }
void bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected | ( | BlackBoxDescriptor * | d | ) | [virtual] |
Reimplemented from bbtk::WxGUIBlackBoxListUser.
Definition at line 972 of file bbtkWxGUIPackageBrowser2.cxx.
References bbtk::BlackBoxDescriptor::GetPackage(), bbtk::BlackBoxDescriptor::GetTypeName(), and bbtk::std2wx().
00973 { 00974 //RaC 00975 _actualSelected=d; 00976 00977 mBoxInfo->UpdateInfo(d); 00978 std::string title = d->GetPackage()->GetName()+"::"+d->GetTypeName(); 00979 m_mgr.GetPane(mBoxInfo).Caption(std2wx(title)); 00980 m_mgr.Update(); 00981 }
Definition at line 240 of file bbtkWxGUIPackageBrowser2.h.
Referenced by GetActualSelected(), and WxGUIPackageBrowser2().
wxAuiManager bbtk::WxGUIPackageBrowser2::m_mgr [private] |
Definition at line 219 of file bbtkWxGUIPackageBrowser2.h.
Referenced by WxGUIPackageBrowser2(), and ~WxGUIPackageBrowser2().
Definition at line 223 of file bbtkWxGUIPackageBrowser2.h.
Referenced by RebuildList(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mCategoryFilter [private] |
Definition at line 229 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mDescriptionFilter [private] |
Definition at line 228 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
Definition at line 222 of file bbtkWxGUIPackageBrowser2.h.
Referenced by BuildFromFactory(), GetFactory(), RebuildList(), and ~WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mInputNatureFilter [private] |
Definition at line 232 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mInputTypeFilter [private] |
Definition at line 230 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
Definition at line 221 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IncludeAll(), and ~WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mNameFilter [private] |
Definition at line 227 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mOutputNatureFilter [private] |
Definition at line 233 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mOutputTypeFilter [private] |
Definition at line 231 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxTextCtrl* bbtk::WxGUIPackageBrowser2::mPackageFilter [private] |
Definition at line 226 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxCheckBox* bbtk::WxGUIPackageBrowser2::mShowAdaptorsFilter [private] |
Definition at line 236 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxCheckBox* bbtk::WxGUIPackageBrowser2::mShowGUIsFilter [private] |
Definition at line 237 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
wxCheckBox* bbtk::WxGUIPackageBrowser2::mShowWidgetsFilter [private] |
Definition at line 235 of file bbtkWxGUIPackageBrowser2.h.
Referenced by IsVisible(), and WxGUIPackageBrowser2().
Definition at line 220 of file bbtkWxGUIPackageBrowser2.h.