Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2008/06/19 09:46:46 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/10/14 10:11:15 $
+ 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
//wxSize(400,200),
wxSP_3D |
wxSP_LIVE_UPDATE );
- w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+ w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
wxWindow* w1 = bbGetInputWidget1();
wxWindow* w2 = bbGetInputWidget2();
w1->Reparent(w);
w2->Reparent(w);
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); }
- else { w->SplitVertically( w1, w2, 100); }
-
+ 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); }
+ else { w->SplitVertically( w1, w2, 100); }
+
bbSetOutputWidget( w );
}
// when window is shown
void LayoutSplit::bbUserOnShow()
{
- bbUserOnShowWidget("Widget1");
- bbUserOnShowWidget("Widget2");
+ wxSplitterWindow* win = (wxSplitterWindow*)bbGetOutputWidget();
+ int w,h;
+ win->GetClientSize(&w,&h);
+ int pos = 100;
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+ "0|H|HORIZONTAL")==true)
+ {
+ pos = (int)(w * bbGetInputProportion() * 0.01);
+ }
+ else
+ {
+ pos = (int)(h * bbGetInputProportion() * 0.01);
+ }
+
+ win->SetSashPosition(pos,true);
+ bbUserOnShowWidget("Widget1");
+ bbUserOnShowWidget("Widget2");
}