]> Creatis software - bbtk.git/blobdiff - packages/kw/src/bbkwLayoutSplit.cxx
#3506 LayoutSplit minimum size
[bbtk.git] / packages / kw / src / bbkwLayoutSplit.cxx
index 938ef982f0f268b5cd6ca5f0cc4aaac66d100ab8..70dbc6feac5c5d3a8c6c0a8aaea1c0f65c2d5485 100644 (file)
@@ -82,31 +82,25 @@ namespace bbkw
     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 '"<<bbGetInputOrientation()<<"' for input 'Orientation' of LayoutSplit "<<bbGetName()<<std::endl);
-      }
+    {
+        orientation = 0;
+    } else if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) {
+         orientation = 1;
+    } else {
+        bbtkWarning("Unrecognized value '"<<bbGetInputOrientation()<<"' for input 'Orientation' of LayoutSplit "<<bbGetName()<<std::endl);
+    }
 
     if (orientation==0)
-      {
-       splitframe->SetOrientationToHorizontal ();
-       width = width / 2;
-      }
-    else 
-      {
-       splitframe->SetOrientationToVertical ();
-       height = height / 2 ;   
-      }  
-
-   width = width - 5;
-   height = height - 5 ;
+    {
+        splitframe->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",
@@ -114,24 +108,13 @@ namespace bbkw
                                                  parent->GetWidth(),
                                                  parent->GetHeight() );
    */
-   bbGetOutputWidget()->GetApplication()->Script
-     ("pack %s -expand yes -fill both",
-      bbGetOutputWidget()->GetWidgetName());
-
-    splitframe->SetReliefToGroove();
-    splitframe->SetBorderWidth(2);
-
-
-    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()) ;
+   bbGetOutputWidget()->GetApplication()->Script("pack %s -expand yes -fill both", bbGetOutputWidget()->GetWidgetName());
+   splitframe->SetReliefToGroove();
+   splitframe->SetBorderWidth(2);
+   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()) ;
 
     /*
     splitframe->GetApplication()->Script("pack %s -expand yes -fill x -fill y",        w2->GetWidgetName());