From cfbdafc090592999f8d02e0c1412b0e15ac259d9 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 26 Apr 2013 11:51:53 +0200 Subject: [PATCH] Feature #2002 Static Box Widget Black Box A static box is a rectangle drawn around other panel items to denote a logical grouping of items. --- packages/wx/src/bbwxStaticBox.cxx | 84 +++++++++++++++++++++++++++++++ packages/wx/src/bbwxStaticBox.h | 50 ++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 packages/wx/src/bbwxStaticBox.cxx create mode 100644 packages/wx/src/bbwxStaticBox.h diff --git a/packages/wx/src/bbwxStaticBox.cxx b/packages/wx/src/bbwxStaticBox.cxx new file mode 100644 index 0000000..2809ed2 --- /dev/null +++ b/packages/wx/src/bbwxStaticBox.cxx @@ -0,0 +1,84 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifdef _USE_WXWIDGETS_ + +#include "bbwxStaticBox.h" +#include "bbwxPackage.h" +#include "bbtkUtilities.h" +namespace bbwx +{ + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,StaticBox) + BBTK_BLACK_BOX_IMPLEMENTATION(StaticBox,bbtk::WxBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + void StaticBox::Process() + { + + } +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + void StaticBox::CreateWidget(wxWindow* parent) + { + std::cout << "creating..." << std::endl; + wxPanel *w=new wxPanel( + parent, //bbGetWxParent(), + -1 + ); + + w->SetName(bbtk::std2wx(bbGetInputWinTitle())); + + wxStaticBoxSizer* boxSizer = new wxStaticBoxSizer( + wxVERTICAL, + w, + bbtk::std2wx(bbGetInputBoxTitle()) + ); + + wxWindow* content = bbCreateWidgetOfInput("BoxContent",w); + if (content == NULL) + { + content = new wxPanel(w); + } + + boxSizer->Add(content,1,wxEXPAND); + w->SetSizer(boxSizer); + boxSizer->Fit(w); + + bbSetOutputWidget(w); + } +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + void StaticBox::bbUserSetDefaultValues() + { + bbSetInputBoxTitle(""); + bbSetInputBoxContent(NULL); + std::cout << "initialized"< + +namespace bbwx +{ + + class bbwx_EXPORT StaticBox : public bbtk::WxBlackBox + { + BBTK_BLACK_BOX_INTERFACE(StaticBox,bbtk::WxBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(BoxTitle,std::string); + BBTK_DECLARE_INPUT(BoxContent,wxWindow*); + BBTK_PROCESS(Process); + void Process(); + BBTK_CREATE_WIDGET(CreateWidget); + void CreateWidget(wxWindow*); + BBTK_ON_SHOW_WIDGET(OnShowWidget); + void OnShowWidget(); + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + }; + + BBTK_BEGIN_DESCRIBE_BLACK_BOX(StaticBox,bbtk::WxBlackBox); + BBTK_NAME("StaticBox"); + BBTK_AUTHOR("daniel.gonzalez@creatis.insa-lyon.fr"); + BBTK_DESCRIPTION("A static box widget is a rectangle drawn around a widget to denote a logical grouping of items."); + // Already inserted for any WxBlackBox BBTK_CATEGORY("widget"); + BBTK_INPUT(StaticBox,BoxTitle,"Title assigned to the Static Box",std::string,""); + BBTK_INPUT(StaticBox,BoxContent,"Contained widget",wxWindow*,""); + BBTK_END_DESCRIBE_BLACK_BOX(StaticBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbwx + +#endif // __bbwxStaticBox_h_INCLUDED__ +#endif // _USE_WXWIDGETS_ + -- 2.45.1