00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00037 #ifdef _USE_WXWIDGETS_
00038
00039
00040 #include "bbwxLayoutTab.h"
00041 #include "bbwxPackage.h"
00042 #include "bbtkUtilities.h"
00043
00044
00045
00046
00047 namespace bbwx
00048 {
00049 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
00050
00051
00052 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
00053
00054 void LayoutTab::bbUserConstructor()
00055 {
00056 bbSetInputOrientation("TOP");
00057 bbSetInputWidget1(NULL);
00058 bbSetInputWidget2(NULL);
00059 bbSetInputWidget3(NULL);
00060 bbSetInputWidget4(NULL);
00061 bbSetInputWidget5(NULL);
00062 bbSetInputWidget6(NULL);
00063 bbSetInputWidget7(NULL);
00064 bbSetInputWidget8(NULL);
00065 bbSetInputWidget9(NULL);
00066 }
00067
00068 void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
00069 {
00070 wxWindow* w = bbCreateWidgetOfInput(input,book);
00071 if (w!=NULL)
00072 {
00073 book->AddPage(w,w->GetName());
00074 }
00075 }
00076
00077 void LayoutTab::Process()
00078 {
00079 }
00080
00081
00082 void LayoutTab::CreateWidget(wxWindow* parent)
00083 {
00084 long style = wxNB_TOP;
00085 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true)
00086 { style=wxNB_TOP; }
00087 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true)
00088 { style=wxNB_RIGHT; }
00089 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true)
00090 { style=wxNB_BOTTOM; }
00091 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
00092 { style=wxNB_LEFT; }
00093 wxNotebook *w = new wxNotebook(parent,
00094 -1,
00095 wxDefaultPosition,
00096 wxDefaultSize,
00097 style );
00098 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
00099
00100 TryInsertWindow(w,"Widget1");
00101 TryInsertWindow(w,"Widget2");
00102 TryInsertWindow(w,"Widget3");
00103 TryInsertWindow(w,"Widget4");
00104 TryInsertWindow(w,"Widget5");
00105 TryInsertWindow(w,"Widget6");
00106 TryInsertWindow(w,"Widget7");
00107 TryInsertWindow(w,"Widget8");
00108 TryInsertWindow(w,"Widget9");
00109
00110 bbSetOutputWidget( w );
00111 }
00112
00113
00114
00115
00116 void LayoutTab::OnShowWidget()
00117 {
00118
00119 wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
00120 if (w)
00121 {
00122 if (w->GetPageCount()>0)
00123 {
00124 w->SetSelection(0);
00125 for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();
00126 }
00127 bbUserOnShowWidget("Widget1");
00128 bbUserOnShowWidget("Widget2");
00129 bbUserOnShowWidget("Widget3");
00130 bbUserOnShowWidget("Widget4");
00131 bbUserOnShowWidget("Widget5");
00132 bbUserOnShowWidget("Widget6");
00133 bbUserOnShowWidget("Widget7");
00134 bbUserOnShowWidget("Widget8");
00135 bbUserOnShowWidget("Widget9");
00136 }
00137
00138
00139 }
00140
00141
00142 }
00143
00144 #endif
00145