1 /*=========================================================================
4 Module: $RCSfile: bbwxSplit.cxx,v $
6 Date: $Date: 2008/02/08 14:58:31 $
7 Version: $Revision: 1.5 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
24 #ifdef _USE_WXWIDGETS_
26 #include "bbwxSplit.h"
27 #include "bbwxPackage.h"
28 #include "bbtkUtilities.h"
35 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,Split);
38 BBTK_USER_BLACK_BOX_IMPLEMENTATION(Split,bbtk::WxBlackBox);
41 void Split::bbUserConstructor()
43 bbSetInputWinTitle("Split");
44 bbSetInputOrientation("HORIZONTAL");
45 bbSetInputProportion(50);
52 void Split::CreateWidget()
54 wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(),
61 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
62 wxWindow* w1 = bbGetInputWidget1();
63 wxWindow* w2 = bbGetInputWidget2();
68 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; }
69 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; }
70 if (orientation==0) { w->SplitHorizontally( w1, w2, 100); }
71 if (orientation==1) { w->SplitVertically( w1, w2, 100); }
74 bbSetOutputWidget( w );
81 #endif // _USE_WXWIDGETS_