X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=packages%2Fwx%2Fsrc%2FbbwxLayoutSplit.cxx;h=f588595dae4eaddab71ac71d08acf502e0f2ae14;hb=c1d78c47a2cb833842ceaecb9164b9d75fed9e99;hp=1c1e2655dcf70ec95a33fe1d5804787f0f4688ef;hpb=3ccde402d1eb179b3e940ec7ca3d1d2e9c96386c;p=bbtk.git diff --git a/packages/wx/src/bbwxLayoutSplit.cxx b/packages/wx/src/bbwxLayoutSplit.cxx index 1c1e265..f588595 100644 --- a/packages/wx/src/bbwxLayoutSplit.cxx +++ b/packages/wx/src/bbwxLayoutSplit.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbwxLayoutSplit.cxx,v $ Language: C++ - Date: $Date: 2008/10/21 08:37:09 $ - Version: $Revision: 1.6 $ + Date: $Date: 2009/05/28 08:12:17 $ + Version: $Revision: 1.12 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -46,21 +46,32 @@ namespace bbwx BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,LayoutSplit); BBTK_BLACK_BOX_IMPLEMENTATION(LayoutSplit,bbtk::WxBlackBox); - void LayoutSplit::bbUserConstructor() - { - bbSetInputOrientation("VERTICAL"); - bbSetInputProportion(50); - bbSetInputWidget1(NULL); - bbSetInputWidget2(NULL); - } - + //----------------------------------------------------------------- + void LayoutSplit::bbUserSetDefaultValues() + { + bbSetInputOrientation("VERTICAL"); + bbSetInputProportion(50); + bbSetInputWidget1(NULL); + bbSetInputWidget2(NULL); + } + + //----------------------------------------------------------------- + void LayoutSplit::bbUserInitializeProcessing() + { + } + + //----------------------------------------------------------------- + void LayoutSplit::bbUserFinalizeProcessing() + { + } + void LayoutSplit::Process() { } - void LayoutSplit::CreateWidget() + void LayoutSplit::CreateWidget(wxWindow* parent) { - wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(), + wxSplitterWindow* w = new wxSplitterWindow(parent, //bbGetWxParent(), -1, wxDefaultPosition, wxDefaultSize, @@ -68,30 +79,51 @@ namespace bbwx wxSP_3D | wxSP_LIVE_UPDATE ); w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); - wxWindow* w1 = bbGetInputWidget1(); + w->SetMinimumPaneSize(2); +/* + wxWindow* w1 = bbGetInputWidget1(); wxWindow* w2 = bbGetInputWidget2(); if (w1==NULL) { w1=new wxPanel(bbGetWxParent()); } if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); } w1->Reparent(w); w2->Reparent(w); - int orientation=0; + */ + + wxWindow* w1 = bbCreateWidgetOfInput("Widget1",w); + wxWindow* w2 = bbCreateWidgetOfInput("Widget2",w); + if (w1==NULL) { w1=new wxPanel(parent); } + if (w2==NULL) { w2=new wxPanel(parent); } + + int orientation=0; if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; } if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; } - if (orientation==1) { w->SplitHorizontally( w1, w2, 100); } + + if (orientation==1) { w->SplitHorizontally( w1, w2, 100); } else { w->SplitVertically( w1, w2, 100); } - + bbSetOutputWidget( w ); } // This callback is necessary to get actual processing of the view // when window is shown - void LayoutSplit::bbUserOnShow() + void LayoutSplit::OnShowWidget() { + // std::cout << "LayoutSplit::OnShowWidget()" << std::endl; + if (bbGetOutputWidget()==0) + { + return; + //bbtkError("LayoutSplit::OnShowWidget() : Output Widget == 0 !"); + } wxSplitterWindow* win = (wxSplitterWindow*)bbGetOutputWidget(); int w,h; + if (win==0) + { + return; + // bbtkError("LayoutSplit::OnShowWidget() : win == 0 !"); + } win->GetClientSize(&w,&h); int pos = 100; if (bbtk::Utilities::loosematch(bbGetInputOrientation(), @@ -106,8 +138,7 @@ namespace bbwx // std::cout << "pos = "<SetSashPosition(pos,true); - bbUserOnShowWidget("Widget1"); - bbUserOnShowWidget("Widget2"); + }