X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fwx%2Fsrc%2FbbwxSplit.cxx;h=e780ec10f7a6bb1fa70de9ed82c7eef7ccee1823;hb=c336eef9abedc5bcea1aa1ad8cb43d53ab2e3039;hp=ed661342d0940d49375858e223ba8623b7b180b2;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/packages/wx/src/bbwxSplit.cxx b/packages/wx/src/bbwxSplit.cxx index ed66134..e780ec1 100644 --- a/packages/wx/src/bbwxSplit.cxx +++ b/packages/wx/src/bbwxSplit.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxSplit.cxx,v $ Language: C++ - Date: $Date: 2008/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/05 18:05:32 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -31,72 +31,6 @@ namespace bbwx { BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,Split); - /* - //------------------------------------------------------------------------- - SplitWidget::SplitWidget(Split* box, - wxWindow *parent, - int orientation) - : - WxBlackBoxWidgetPanel(box,parent), - mOrientation(orientation) - //( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) - { - wxPanel *panel = this->GetPanel(); - mwxSplitterWindow = new wxSplitterWindow(panel,-1, - wxDefaultPosition, - wxDefaultSize, - wxSP_3D | - wxSP_LIVE_UPDATE ); - - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer -> Add(mwxSplitterWindow, 1, wxGROW, 0); -#if defined(_WIN32) - //mwxSplitterWindow -> SetMinimumPaneSize(25); -#else - mwxSplitterWindow -> SetMinimumPaneSize(25); -#endif // defined(_WIN32) - - panel -> SetSizer(sizer); - panel -> SetAutoLayout(true); - panel -> Layout(); - } - //------------------------------------------------------------------------- - - //------------------------------------------------------------------------- - void SplitWidget::SetChilds(wxWindow* child1,wxWindow* child2, - int prop) - { - if (mwxSplitterWindow->IsSplit()) return; - if (mOrientation==0) - { - int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01); - mwxSplitterWindow->SplitHorizontally( child1 , child2, sz); - } - else - { - int sz = (int)(GetParent()->GetSize().GetWidth() * prop * 0.01); - mwxSplitterWindow->SplitVertically( child1 , child2, sz ); - } - - - } - - SplitWidget::~SplitWidget() - { - } - - - //------------------------------------------------------------------------- - wxSplitterWindow *SplitWidget::GetWxSplitterWindow() - { - return mwxSplitterWindow; - } - - */ - //-------------------------------------------------------------------------- - //------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- BBTK_USER_BLACK_BOX_IMPLEMENTATION(Split,bbtk::WxBlackBox); @@ -104,91 +38,37 @@ namespace bbwx void Split::bbUserConstructor() { + bbSetInputWinTitle("Split"); bbSetInputOrientation(0); bbSetInputProportion(50); } void Split::Process() { - bbtkDebugMessageInc("Core",9,"Split::Process()"<SetInitialSize(wxSize(100,100)); - // int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01); - w1->Reparent(w); - w2->Reparent(w); - w->SplitHorizontally( w1, w2, 100); - //w->SetMinimumPaneSize(100); - // w->SetAutoLayout(true); - // w->Fit(); - // w->Layout(); - + } - bbSetOutputWidget( w ); - } + void Split::CreateWidget() + { + wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(), + -1, + wxDefaultPosition, + wxDefaultSize, + //wxSize(400,200), + wxSP_3D | + wxSP_LIVE_UPDATE ); + w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); + wxWindow* w1 = bbGetInputWidget1(); + wxWindow* w2 = bbGetInputWidget2(); + + w1->Reparent(w); + w2->Reparent(w); + w->SplitHorizontally( w1, w2, 100); + + + bbSetOutputWidget( w ); } - /** - * \brief Create wxWidget . - * - * - */ - /* - bbtk::WxBlackBoxWidget *Split::bbUserCreateWidget(wxWindow *parent) - { - //printf("EED Split::CreateWxWindow \n" ); - bbtkDebugMessageInc("Core",9,"Split::bbUserCreateWidget("<first=="WinChild") - { - const std::vector& C = i->second->GetConnectionVector(); - std::vector::const_iterator j; - j = C.begin(); - if (C.size()==2) - { - wxPanel *w1 = new wxPanel(wxwidgetsplit->GetWxSplitterWindow() ,-1 ); - wxPanel *w2 = new wxPanel(wxwidgetsplit->GetWxSplitterWindow() ,-1 ); - bbtkDebugMessage("Debug",1,"Creating panel for "<<(*j)->GetFullName()); - bbmOutputWinChild->AddToConnectionToWindowMap(*j,w1); - bbtkDebugMessage("Debug",1,"..OK"<GetFullName()); - bbmOutputWinChild->AddToConnectionToWindowMap(*j,w2); - - bbtkDebugMessage("Debug",1,"..OK"<SetChilds( w1 , w2, bbGetInputProportion() ); - } // if C - break; - }// if Child - }// if i - // - - - bbtkDebugDecTab("Core",9); - - return wxwidgetsplit; - - } - */ }//namespace bbtk