Program: bbtk
Module: $RCSfile: bbtkWxGUIPackageBrowser.cxx,v $
Language: C++
- Date: $Date: 2008/03/28 13:42:18 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/28 15:04:10 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifdef _USE_WXWIDGETS_
+#define CHECKBOXVIEW 1
+
#include "bbtkWxGUIPackageBrowser.h"
#include "ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h"
#include "bbtkInterpreter.h"
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxStaticText* s = new wxStaticText(this,-1,
- std2wx(descr->GetTypeName()));
+ std2wx(descr->GetDescription()));
+ sizer->Add(s,1,wxGROW);
+ s = new wxStaticText(this,-1,
+ std2wx(descr->GetAuthor()));
+ sizer->Add(s,1,wxGROW);
+ s = new wxStaticText(this,-1,
+ std2wx(descr->GetCategory()));
sizer->Add(s,1,wxGROW);
mTree->SetCaptionFont(somefont);
mTree->SetSpacingY(1);
+ // mTree->SetCheckboxView(true);
SetSizer(sizer);
SetAutoLayout(true);
//================================================================
WxGUIPackageBrowser::~WxGUIPackageBrowser()
{
+ std::cout << "del interpreter" << std::endl;
if (mInterpreter) delete mInterpreter;
+ std::cout << "ok" << std::endl;
}
//================================================================
//================================================================
void WxGUIPackageBrowser::IncludeAll()
{
-#ifndef LINUX
- wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_CNT, 8, 0);
-#else
- wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_ALL, 8, 0);
-#endif
-
if (!mInterpreter) mInterpreter = new bbtk::Interpreter();
mInterpreter->SetCommandLine(true);
mInterpreter->InterpretLine("include *");
Factory* F = mInterpreter->GetExecuter()->GetFactory();
-
+ BuildFromFactory(F);
+ }
+ //================================================================
+ //================================================================
+
+ void WxGUIPackageBrowser::BuildFromFactory(Factory* F)
+ {
+#ifndef LINUX
+ wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_CNT, 8, 0);
+#else
+ wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_ALL, 8, 0);
+#endif
+ mTree->DeleteAllItems();
const Factory::PackageMapType& M = F->GetPackageMap();
Factory::PackageMapType::const_iterator i;
for (i=M.begin();i!=M.end();++i)
if (packname==_T("user")) continue;
wxTreeMultiItem pack = mTree->AddRoot(packname,packname);
+ wxString packinfo = std2wx(P->GetDescription());
+ packinfo += _T(" - by ")+ std2wx(P->GetAuthor());
+ packinfo += _T(" - v. ")+ std2wx(P->GetVersion());
+ mTree->AppendWindow(pack,
+ new wxStaticText(mTree,
+ -1,packinfo));
Package::BlackBoxMapType::iterator j;
for (j=P->GetBlackBoxMap().begin();
j!=P->GetBlackBoxMap().end();