Permalink
Browse files

fixes some stuff in wxProperty

  • Loading branch information...
1 parent 080900a commit 06bb149946d615ad10cc677ea57d6d7d66aede3d @Hanmac committed Mar 14, 2013
Showing with 47 additions and 15 deletions.
  1. +13 −0 ext/rwx.cpp
  2. +16 −0 ext/wxProperty.cpp
  3. +0 −8 ext/wxProperty.hpp
  4. +9 −3 ext/wxPropertyGridInterface.cpp
  5. +9 −4 tests/propertygrid.rb
View
@@ -73,6 +73,12 @@
#include "wxGauge.hpp"
+#include "wxListBox.hpp"
+#include "wxCheckListBox.hpp"
+
+#include "wxRearrangeList.hpp"
+#include "wxRearrangeCtrl.hpp"
+#include "wxRearrangeDialog.hpp"
#include "wxCheckBox.hpp"
#include "wxRadioButton.hpp"
@@ -246,6 +252,13 @@ extern "C" void Init_rwx()
Init_WXInfoBar(rb_mWX);
Init_WXInfoBarGeneric(rb_mWX);
+ Init_WXListBox(rb_mWX);
+ Init_WXCheckListBox(rb_mWX);
+
+ Init_WXRearrangeList(rb_mWX);
+ Init_WXRearrangeCtrl(rb_mWX);
+ Init_WXRearrangeDialog(rb_mWX);
+
Init_WXDataView(rb_mWX);
Init_WXDataViewList(rb_mWX);
View
@@ -16,6 +16,19 @@ VALUE rb_cWXProperty;
#include <wx/propgrid/props.h>
#include <wx/propgrid/advprops.h>
+template<typename T>
+void registerProperty(VALUE mod,const char* name,const char* parent = NULL)
+{
+ VALUE pc = rb_cWXProperty;
+
+ if(parent)
+ pc = rb_const_get(mod,rb_intern(parent));
+
+ VALUE klass = rb_define_class_under(mod,name,pc);
+ registerInfo<T>(klass);
+}
+
+
#define _self unwrap<wxPGProperty*>(self)
namespace RubyWX {
@@ -179,6 +192,9 @@ DLL_LOCAL void Init_WXProperty(VALUE rb_mWX)
registerProperty<wxEnumProperty>(rb_mWX,"EnumProperty");
+ registerProperty<wxSystemColourProperty>(rb_mWX,"SystemColorProperty","EnumProperty");
+ registerProperty<wxCursorProperty>(rb_mWX,"CursorProperty","EnumProperty");
+
#endif
}
View
@@ -13,12 +13,4 @@
extern VALUE rb_cWXProperty;
DLL_LOCAL void Init_WXProperty(VALUE rb_mWX);
-template<typename T>
-void registerProperty(VALUE mod,const char* name)
-{
- VALUE klass = rb_define_class_under(mod,name,rb_cWXProperty);
- registerInfo<T>(klass);
-}
-
-
#endif /* WXPROPERTY_HPP_ */
@@ -29,9 +29,15 @@ wxPropertyGridInterface* unwrap< wxPropertyGridInterface* >(const VALUE &obj)
namespace RubyWX {
namespace PropertyGridInterface {
-VALUE _append(VALUE self,VALUE val)
+VALUE _append(int argc,VALUE *argv,VALUE self)
{
- return wrap(_self->Append(unwrap<wxPGProperty*>(val)));
+ VALUE val,hash;
+ rb_scan_args(argc, argv, "11",&val,&hash);
+
+ VALUE result = wrap(_self->Append(unwrap<wxPGProperty*>(val)));
+ if(rb_block_given_p())
+ rb_yield(result);
+ return result;
}
}
@@ -44,7 +50,7 @@ DLL_LOCAL void Init_WXPropertyGridInterface(VALUE rb_mWX)
using namespace RubyWX::PropertyGridInterface;
rb_mWXPropertyGridInterface = rb_define_module_under(rb_mWX,"PropertyGridInterface");
- rb_define_method(rb_mWXPropertyGridInterface,"append",RUBY_METHOD_FUNC(_append),1);
+ rb_define_method(rb_mWXPropertyGridInterface,"append",RUBY_METHOD_FUNC(_append),-1);
wxPropertyGrid::InitAllTypeHandlers();
#endif
View
@@ -1,7 +1,7 @@
#Encoding: UTF-8
require "../ext/rwx"
-STDERR.reopen("file.log","w")
+#STDERR.reopen("file.log","w")
class A < WX::App
@@ -19,13 +19,18 @@ def on_init
:extra_style => WX::PropertyGridManager::EX_MODE_BUTTONS
)
- fp = pg.append(WX::FontProperty)
- fp.value_image = "ruby32x32.png"
+# pg = WX::PropertyGrid.new(@frame)
+
+
+ p WX::CursorProperty.ancestors
+
+ fp = pg.append(WX::SystemColorProperty)
+ #fp.value_image = "ruby32x32.png"
p fp.value
p fp.each_attributes.to_a
- exit
+ #exit
p fp.each_child.map {|pr| pr.class}
p fp.each_child.map {|pr| pr.type}

0 comments on commit 06bb149

Please sign in to comment.