namespace bbkw
{
-
-
-
-
class LayoutSplit : public bbtk::KWBlackBox
{
-
BBTK_BLACK_BOX_INTERFACE(LayoutSplit,bbtk::KWBlackBox);
BBTK_DECLARE_INPUT(Widget1,vtkKWWidget*);
BBTK_DECLARE_INPUT(Widget2,vtkKWWidget*);
BBTK_DECLARE_INPUT(Proportion,int);
BBTK_PROCESS(Process);
BBTK_CREATE_KWWIDGET(CreateWidget);
- void CreateWidget(vtkKWFrame*);
-
- void Process();
+ void CreateWidget(vtkKWFrame*);
+ void Process();
protected:
- virtual void bbUserConstructor();
-
+ virtual void bbUserConstructor();
};
-
//=================================================================
// BlackBox description
BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutSplit,bbtk::KWBlackBox);
BBTK_INPUT(LayoutSplit,Widget1,"Upper or left widget",vtkKWWidget*,"");
BBTK_INPUT(LayoutSplit,Widget2,"Lower or right widget",vtkKWWidget*,"");
BBTK_INPUT(LayoutSplit,Orientation,"Orientation (default H), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
- BBTK_INPUT(LayoutSplit,Proportion,"Proportion (in percent) of the first children in the window",int,"");
+ BBTK_INPUT(LayoutSplit,Proportion,"Proportion (in percent) of the first children in the window",int,"");
BBTK_END_DESCRIBE_BLACK_BOX(LayoutSplit);
//=================================================================
}
void LayoutLine::CreateWidget(wxWindow* parent)
{
wxBoxSizer *sizer;
- wxPanel *w=new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
+ wxPanel *w = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
int style=0;
{
style=wxVERTICAL;
} // if
-
sizer = new wxBoxSizer(style);
-
wxWindow* cw;
//
// when window is shown
void LayoutLine::OnShowWidget()
{
+ if (bbGetOutputWidget()!=NULL)
+ {
+ bbGetOutputWidget()->Layout();
+ } // if bbGetOutputWidget
}
}//namespace bbwx
if (w1==NULL) { w1=new wxPanel(splitterWindowPanel); }
if (w2==NULL) { w2=new wxPanel(splitterWindowPanel); }
int orientation=0;
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|h|horizontal|Horizontal|HORIZONTAL")==true) { orientation=0; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|v|vertical|Vertical|VERTICAL")==true) { orientation=1; }
-
-
- if (orientation==1)
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|h|horizontal|Horizontal|HORIZONTAL")==true)
+ {
+ orientation=0;
+ }
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|v|vertical|Vertical|VERTICAL")==true)
+ {
+ orientation=1;
+ } // ig
+ if (orientation==1)
{
w->SplitHorizontally( w1, w2, 100);
} else {
//RaC Nov2012 Correctly resize internal panels with the window resize event
w->SetSashGravity(0.5);
}
+
}//namespace bbwx
#endif // _USE_WXWIDGETS_
TryInsertWindow(w,"Widget7");
TryInsertWindow(w,"Widget8");
TryInsertWindow(w,"Widget9");
+ w->SetAutoLayout(true);
w->Layout();
+ tabwidget->Layout();
//EED2020-04-06
// bbSetOutputWidget( w );
bbSetOutputWidget( tabwidget );
- }
-
-
- // This callback is necessary to get actual processing of the view
+}
+
+// This callback is necessary to get actual processing of the view
// when window is shown
void LayoutTab::OnShowWidget()
{
//EED2020-04-06
// wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
wxNotebook* w = ((TabWidget*)bbGetOutputWidget())->GetmwxNotebook();
- if (w)
+ if (w!=NULL)
{
if (w->GetPageCount()>0)
{
w->AdvanceSelection();
} // for
} // if PageCount
- } // if w
+ } // if w
+ if (bbGetOutputWidget()!=NULL)
+ {
+ bbGetOutputWidget()->Layout();
+ } // if bbGetOutputWidget
}
-
}//namespace bbwx
#endif