#include <bbwxLayoutSplit.h>
Protected Member Functions | |
virtual void | bbUserConstructor () |
Private Member Functions | |
BBTK_BLACK_BOX_INTERFACE (LayoutSplit, bbtk::WxBlackBox) | |
BBTK_DECLARE_INPUT (Widget1, wxWindow *) | |
BBTK_DECLARE_INPUT (Widget2, wxWindow *) | |
BBTK_DECLARE_INPUT (Orientation, std::string) | |
BBTK_DECLARE_INPUT (Proportion, int) | |
BBTK_PROCESS (Process) | |
BBTK_CREATE_WIDGET (CreateWidget) | |
void | Process () |
void | CreateWidget () |
void | bbUserOnShow () |
Definition at line 61 of file bbwxLayoutSplit.h.
bbwx::LayoutSplit::BBTK_BLACK_BOX_INTERFACE | ( | LayoutSplit | , | |
bbtk::WxBlackBox | ||||
) | [private] |
bbwx::LayoutSplit::BBTK_DECLARE_INPUT | ( | Widget1 | , | |
wxWindow * | ||||
) | [private] |
bbwx::LayoutSplit::BBTK_DECLARE_INPUT | ( | Widget2 | , | |
wxWindow * | ||||
) | [private] |
bbwx::LayoutSplit::BBTK_DECLARE_INPUT | ( | Orientation | , | |
std::string | ||||
) | [private] |
bbwx::LayoutSplit::BBTK_DECLARE_INPUT | ( | Proportion | , | |
int | ||||
) | [private] |
bbwx::LayoutSplit::BBTK_PROCESS | ( | Process | ) | [private] |
bbwx::LayoutSplit::BBTK_CREATE_WIDGET | ( | CreateWidget | ) | [private] |
void bbwx::LayoutSplit::Process | ( | ) | [private] |
void bbwx::LayoutSplit::CreateWidget | ( | ) | [private] |
Definition at line 61 of file bbwxLayoutSplit.cxx.
00062 { 00063 wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(), 00064 -1, 00065 wxDefaultPosition, 00066 wxDefaultSize, 00067 //wxSize(400,200), 00068 wxSP_3D | 00069 wxSP_LIVE_UPDATE ); 00070 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); 00071 wxWindow* w1 = bbGetInputWidget1(); 00072 wxWindow* w2 = bbGetInputWidget2(); 00073 00074 if (w1==NULL) { w1=new wxPanel(bbGetWxParent()); } 00075 if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); } 00076 w1->Reparent(w); 00077 w2->Reparent(w); 00078 int orientation=0; 00079 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; } 00080 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; } 00081 00082 if (orientation==1) { w->SplitHorizontally( w1, w2, 100); } 00083 else { w->SplitVertically( w1, w2, 100); } 00084 00085 bbSetOutputWidget( w ); 00086 }
void bbwx::LayoutSplit::bbUserOnShow | ( | ) | [private] |
Definition at line 91 of file bbwxLayoutSplit.cxx.
00092 { 00093 wxSplitterWindow* win = (wxSplitterWindow*)bbGetOutputWidget(); 00094 int w,h; 00095 win->GetClientSize(&w,&h); 00096 int pos = 100; 00097 if (bbtk::Utilities::loosematch(bbGetInputOrientation(), 00098 "0|H|HORIZONTAL")==true) 00099 { 00100 pos = (int)(w * bbGetInputProportion() * 0.01); 00101 } 00102 else 00103 { 00104 pos = (int)(h * bbGetInputProportion() * 0.01); 00105 } 00106 // std::cout << "pos = "<<pos<<std::endl; 00107 00108 win->SetSashPosition(pos,true); 00109 bbUserOnShowWidget("Widget1"); 00110 bbUserOnShowWidget("Widget2"); 00111 }
void bbwx::LayoutSplit::bbUserConstructor | ( | ) | [protected, virtual] |
Definition at line 49 of file bbwxLayoutSplit.cxx.
00050 { 00051 bbSetInputOrientation("VERTICAL"); 00052 bbSetInputProportion(50); 00053 bbSetInputWidget1(NULL); 00054 bbSetInputWidget2(NULL); 00055 }