X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fkw%2Fsrc%2FbbkwLayoutSplit.cxx;h=ecb942b15818d71fcd469e567a8c1b3bfb321b95;hb=d818d3773f70d1d68bf712ebae8edd8739bc3e17;hp=b35f7f1d8a10ea465cb16406965b322066734ae7;hpb=ba1cc70dcdd708b3de57e6e41b3263c1baa5ea58;p=bbtk.git diff --git a/packages/kw/src/bbkwLayoutSplit.cxx b/packages/kw/src/bbkwLayoutSplit.cxx index b35f7f1..ecb942b 100644 --- a/packages/kw/src/bbkwLayoutSplit.cxx +++ b/packages/kw/src/bbkwLayoutSplit.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbkwLayoutSplit.cxx,v $ Language: C++ - Date: $Date: 2008/12/02 10:21:42 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/12/18 11:54:57 $ + Version: $Revision: 1.4 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -60,36 +60,88 @@ namespace bbkw } - void LayoutSplit::CreateWidget(vtkKWWidget* parent) + void LayoutSplit::CreateWidget(vtkKWFrame* parent) { vtkKWSplitFrame *splitframe = vtkKWSplitFrame::New(); bbSetOutputWidget(splitframe); splitframe->SetParent(parent); splitframe->Create(); - splitframe->SetFrame1MinimumSize(5); splitframe->SetFrame2MinimumSize(5); + splitframe->SetExpandableFrameToBothFrames(); + + + int width = parent->GetWidth(); + int height = parent->GetHeight(); + int orientation = 0; + if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) + { + orientation = 0; + } + else if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) + { + orientation = 1; + } + else + { + bbtkWarning("Unrecognized value '"<SetOrientationToHorizontal (); + width = width / 2; + } + else + { + splitframe->SetOrientationToVertical (); + height = height / 2 ; + } + + width = width - 5; + height = height - 5 ; + + /* + bbGetOutputWidget()->GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d", + bbGetOutputWidget()->GetWidgetName(), + parent->GetWidth(), + parent->GetHeight() ); + */ + bbGetOutputWidget()->GetApplication()->Script + ("pack %s -expand yes -fill both", + bbGetOutputWidget()->GetWidgetName()); - splitframe->GetApplication()->Script("pack %s -side top -expand y", - splitframe->GetWidgetName()); - /* splitframe->SetReliefToGroove(); splitframe->SetBorderWidth(2); - splitframe->SetExpandableFrameToBothFrames(); - */ - bbCreateWidgetOfInput("Widget1",splitframe->GetFrame1()); - bbCreateWidgetOfInput("Widget2",splitframe->GetFrame2()); - /* - 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; } + + vtkKWWidget* w1 = bbCreateWidgetOfInput("Widget1",splitframe->GetFrame1()); + vtkKWWidget* w2 = bbCreateWidgetOfInput("Widget2",splitframe->GetFrame2()); + + splitframe->GetApplication()->Script + ("pack %s -expand yes -fill both", + w1->GetWidgetName()) ; + splitframe->GetApplication()->Script + ("pack %s -expand yes -fill both", + w2->GetWidgetName()) ; - if (orientation==1) { w->SplitHorizontally( w1, w2, 100); } - else { w->SplitVertically( w1, w2, 100); } + /* + splitframe->GetApplication()->Script("pack %s -expand yes -fill x -fill y", w2->GetWidgetName()); + */ + /* + splitframe->GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d", + w1->GetWidgetName(), + width, + height); + + splitframe->GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d", + w2->GetWidgetName(), + width, + height); */ + }