Permalink
Browse files

Merge pull request #258 from jackburridge/master

Added wxWrapSizer
  • Loading branch information...
2 parents e79a786 + 1e9a98c commit e769c8e0f86c32f26fe540fbe9b05e12a60893e0 @jhasse jhasse committed on GitHub Feb 8, 2017
@@ -50,6 +50,12 @@ Written by
<template name="construction">$name = new wxBoxSizer( $orient ); #nl</template>
</templates>
+ <templates class="wxWrapSizer">
+ <template name="declaration">wxWrapSizer* $name;</template>
+ <template name="include">@#include &lt;wx/wrapsizer.h&gt;</template>
+ <template name="construction">$name = new wxWrapSizer( $orient ); #nl</template>
+ </templates>
+
<templates class="wxStaticBoxSizer">
<template name="declaration">wxStaticBoxSizer* $name;</template>
<template name="include">
@@ -51,6 +51,10 @@ Lua code generation writen by
<template name="construction">#utbl$name = wx.wxBoxSizer( $orient ) #nl</template>
</templates>
+ <templates class="wxWrapSizer">
+ <template name="construction">#utbl$name = wx.wxWrapSizer( $orient ) #nl</template>
+ </templates>
+
<templates class="wxStaticBoxSizer">
<template name="construction">#utbl$name = wx.wxStaticBoxSizer( wx.wxStaticBox( #utbl#parentname, $id, $label ), $orient ) #nl</template>
<template name="evt_connect_OnUpdateUI">-- event #utbl$name:evt_connect_OnUpdateUI isn't currently supported by wxLua</template>
@@ -51,6 +51,10 @@ PHP code generation writen by
<template name="construction">@$$name = new wxBoxSizer( $orient ); #nl</template>
</templates>
+ <templates class="wxWrapSizer">
+ <template name="construction">@$$name = new wxWrapSizer( $orient ); #nl</template>
+ </templates>
+
<templates class="wxStaticBoxSizer">
<template name="construction">@$$name = new wxStaticBoxSizer( new wxStaticBox( #wxparent $name, $id, $label ), $orient ); #nl</template>
<template name="evt_connect_OnUpdateUI">$name->Connect( wxEVT_UPDATE_UI, #handler );</template>
@@ -51,6 +51,10 @@ Python code generation writen by
<template name="construction">$name = wx.BoxSizer( $orient ) #nl</template>
</templates>
+ <templates class="wxWrapSizer">
+ <template name="construction">$name = wx.WrapSizer( $orient ) #nl</template>
+ </templates>
+
<templates class="wxStaticBoxSizer">
<template name="construction">$name = wx.StaticBoxSizer( wx.StaticBox( #wxparent $name, $id, $label ), $orient ) #nl</template>
<template name="evt_connect_OnUpdateUI">$name.Bind( wx.EVT_UPDATE_UI, #handler )</template>
@@ -76,6 +76,14 @@ Written by
<option name="wxHORIZONTAL" help="Align items horizontally"/>wxVERTICAL</property>
</objectinfo>
+ <objectinfo class="wxWrapSizer" icon="sizer.xpm" type="sizer">
+ <inherits class="sizer" />
+ <property name="name" type="text" hidden="1">wSizer</property>
+ <property name="orient" type="option">
+ <option name="wxVERTICAL" help="Align items vertically"/>
+ <option name="wxHORIZONTAL" help="Align items horizontally"/>wxHORIZONTAL</property>
+ </objectinfo>
+
<objectinfo class="wxStaticBoxSizer" icon="staticbox_sizer.xpm" type="sizer">
<inherits class="sizer" />
<property name="name" type="text" hidden="1">sbSizer</property>
@@ -29,6 +29,7 @@
#include <ticpp.h>
#include <wx/tokenzr.h>
#include <wx/gbsizer.h>
+#include <wx/wrapsizer.h>
#include <map>
#ifdef __WX24__
@@ -204,6 +205,33 @@ class BoxSizerComponent : public ComponentBase
}
};
+class WrapSizerComponent : public ComponentBase
+{
+public:
+ wxObject* Create(IObject *obj, wxObject * /*parent*/)
+ {
+ wxWrapSizer *sizer = new wxWrapSizer(obj->GetPropertyAsInteger(_("orient")));
+ sizer->SetMinSize( obj->GetPropertyAsSize(_("minimum_size")) );
+ return sizer;
+ }
+
+ ticpp::Element* ExportToXrc(IObject *obj)
+ {
+ ObjectToXrcFilter xrc(obj, _("wxWrapSizer"));
+ if( obj->GetPropertyAsSize(_("minimum_size")) != wxDefaultSize ) xrc.AddProperty(_("minimum_size"), _("minsize"), XRC_TYPE_SIZE);
+ xrc.AddProperty(_("orient"), _("orient"), XRC_TYPE_TEXT);
+ return xrc.GetXrcObject();
+ }
+
+ ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj )
+ {
+ XrcToXfbFilter filter(xrcObj, _("wxWrapSizer"));
+ filter.AddProperty(_("minsize"), _("minsize"), XRC_TYPE_SIZE);
+ filter.AddProperty(_("orient"),_("orient"),XRC_TYPE_TEXT);
+ return filter.GetXfbObject();
+ }
+};
+
class StaticBoxSizerComponent : public ComponentBase
{
public:
@@ -743,6 +771,7 @@ ABSTRACT_COMPONENT("sizeritem",SizerItemComponent)
ABSTRACT_COMPONENT("gbsizeritem",GBSizerItemComponent)
SIZER_COMPONENT("wxBoxSizer",BoxSizerComponent)
+SIZER_COMPONENT("wxWrapSizer",WrapSizerComponent)
SIZER_COMPONENT("wxStaticBoxSizer",StaticBoxSizerComponent)
SIZER_COMPONENT("wxGridSizer",GridSizerComponent)
SIZER_COMPONENT("wxFlexGridSizer",FlexGridSizerComponent)

0 comments on commit e769c8e

Please sign in to comment.