rwx 0.0.1.dev → 0.0.1.1.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rspec +2 -0
- data/Rakefile +8 -0
- data/VERSION +1 -1
- data/ext/extconf.rb +5 -1
- data/ext/main.cpp +3 -3
- data/ext/main.hpp +34 -1
- data/ext/rwx.cpp +17 -0
- data/ext/wxAnyButton.cpp +7 -6
- data/ext/wxApp.cpp +1 -1
- data/ext/wxApp.hpp +1 -1
- data/ext/wxAuiBook.cpp +5 -1
- data/ext/wxAuiPane.cpp +7 -6
- data/ext/wxBitmap.cpp +42 -6
- data/ext/wxBitmapButton.cpp +3 -2
- data/ext/wxBitmapComboBox.cpp +25 -11
- data/ext/wxBitmapToggleButton.cpp +4 -2
- data/ext/wxBookCtrl.cpp +13 -13
- data/ext/wxBrush.cpp +69 -12
- data/ext/wxBrush.hpp +6 -0
- data/ext/wxButton.cpp +3 -2
- data/ext/wxCalendarCtrl.cpp +7 -6
- data/ext/wxCalendarCtrlBase.cpp +4 -2
- data/ext/wxCalendarCtrlGeneric.cpp +10 -9
- data/ext/wxCheckBox.cpp +10 -5
- data/ext/wxCheckListBox.cpp +10 -9
- data/ext/wxChoice.cpp +10 -9
- data/ext/wxChoiceBook.cpp +5 -1
- data/ext/wxCollapsiblePane.cpp +8 -5
- data/ext/wxColor.cpp +69 -25
- data/ext/wxColor.hpp +3 -0
- data/ext/wxColorPicker.cpp +11 -5
- data/ext/wxColorPickerWidget.cpp +10 -8
- data/ext/wxComboBox.cpp +3 -3
- data/ext/wxComboCtrl.cpp +220 -0
- data/ext/wxComboCtrl.hpp +22 -0
- data/ext/wxControl.cpp +2 -2
- data/ext/wxDC.cpp +5 -4
- data/ext/wxDatePicker.cpp +10 -7
- data/ext/wxDirCtrl.cpp +161 -0
- data/ext/wxDirCtrl.hpp +21 -0
- data/ext/wxDirPicker.cpp +5 -5
- data/ext/wxDirPickerWidget.cpp +10 -8
- data/ext/wxFileCtrl.cpp +5 -2
- data/ext/wxFileCtrlBase.cpp +31 -7
- data/ext/wxFileCtrlGeneric.cpp +5 -2
- data/ext/wxFileDialog.cpp +20 -25
- data/ext/wxFileDirPicker.cpp +6 -6
- data/ext/wxFilePicker.cpp +6 -6
- data/ext/wxFilePickerWidget.cpp +10 -9
- data/ext/wxFont.cpp +6 -5
- data/ext/wxFontDialog.cpp +11 -22
- data/ext/wxFontPicker.cpp +17 -5
- data/ext/wxFontPickerWidget.cpp +10 -9
- data/ext/wxFrame.cpp +6 -4
- data/ext/wxGauge.cpp +9 -5
- data/ext/wxGrid.cpp +7 -5
- data/ext/wxGridCellAttr.cpp +6 -6
- data/ext/wxHyperLink.cpp +12 -11
- data/ext/wxImage.cpp +15 -10
- data/ext/wxInfoBar.cpp +2 -1
- data/ext/wxInfoBarGeneric.cpp +2 -1
- data/ext/wxItemContainer.cpp +5 -0
- data/ext/wxListBook.cpp +5 -2
- data/ext/wxListBox.cpp +10 -8
- data/ext/wxMenu.cpp +5 -4
- data/ext/wxMenuItem.cpp +9 -7
- data/ext/wxMultiChoiceDialog.cpp +5 -3
- data/ext/wxNoteBook.cpp +4 -2
- data/ext/wxOwnerDrawnComboBox.cpp +223 -0
- data/ext/wxOwnerDrawnComboBox.hpp +22 -0
- data/ext/wxPalette.cpp +1 -1
- data/ext/wxPanel.cpp +4 -3
- data/ext/wxPasswordEntryDialog.cpp +1 -1
- data/ext/wxPen.cpp +49 -10
- data/ext/wxPoint.cpp +6 -6
- data/ext/wxPreferences.cpp +21 -6
- data/ext/wxProperty.cpp +5 -7
- data/ext/wxPropertyCell.cpp +5 -4
- data/ext/wxPropertyGrid.cpp +26 -27
- data/ext/wxPropertyGridManager.cpp +13 -5
- data/ext/wxRadioBox.cpp +14 -11
- data/ext/wxRadioButton.cpp +9 -3
- data/ext/wxRearrangeCtrl.cpp +5 -1
- data/ext/wxRearrangeList.cpp +5 -2
- data/ext/wxRect.cpp +8 -7
- data/ext/wxRichTextCtrl.cpp +12 -6
- data/ext/wxRichTextStyle.cpp +5 -5
- data/ext/wxRichTextStyleSheet.cpp +7 -5
- data/ext/wxSTC.cpp +5 -1
- data/ext/wxSearchCtrl.cpp +12 -10
- data/ext/wxSimpleBook.cpp +5 -1
- data/ext/wxSingleChoiceDialog.cpp +4 -2
- data/ext/wxSize.cpp +8 -7
- data/ext/wxSlider.cpp +12 -7
- data/ext/wxSpinButton.cpp +14 -11
- data/ext/wxSpinButton.hpp +1 -1
- data/ext/wxSpinCtrl.cpp +18 -11
- data/ext/wxSpinCtrlDouble.cpp +161 -0
- data/ext/wxSpinCtrlDouble.hpp +21 -0
- data/ext/wxStaticBitmap.cpp +3 -1
- data/ext/wxStaticBitmapBase.cpp +4 -2
- data/ext/wxStaticBitmapGeneric.cpp +3 -1
- data/ext/wxStaticBox.cpp +7 -6
- data/ext/wxStaticLine.cpp +5 -1
- data/ext/wxStaticText.cpp +5 -1
- data/ext/wxStatusBar.cpp +12 -10
- data/ext/wxTaskBar.cpp +6 -4
- data/ext/wxTextCtrl.cpp +9 -3
- data/ext/wxTextEntry.cpp +8 -3
- data/ext/wxTimePicker.cpp +11 -8
- data/ext/wxTimer.cpp +4 -2
- data/ext/wxToggleButton.cpp +3 -1
- data/ext/wxToolBar.cpp +5 -1
- data/ext/wxToolBarTool.cpp +9 -8
- data/ext/wxToolBook.cpp +5 -2
- data/ext/wxTreeBook.cpp +5 -1
- data/ext/wxTreeCtrl.cpp +8 -7
- data/ext/wxWindow.cpp +3 -1
- data/ext/wxWizard.cpp +10 -10
- data/ext/wxWizardPage.cpp +11 -9
- data/rwx.gemspec +4 -2
- data/samples/controls/controls.rb +0 -5
- data/samples/dialog/dialog_sample.rb +0 -3
- data/spec/color_spec.rb +55 -0
- data/spec/spec_helper.rb +12 -0
- metadata +28 -3
@@ -0,0 +1,22 @@
|
|
1
|
+
/*
|
2
|
+
* wxOwnerDrawnComboBox.hpp
|
3
|
+
*
|
4
|
+
* Created on: 14.10.2014
|
5
|
+
* Author: hanmac
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef WXOWNERDRAWNCOMBOBOX_HPP_
|
9
|
+
#define WXOWNERDRAWNCOMBOBOX_HPP_
|
10
|
+
|
11
|
+
#include "main.hpp"
|
12
|
+
|
13
|
+
extern VALUE rb_cWXOwnerDrawnComboBox;
|
14
|
+
|
15
|
+
void Init_WXOwnerDrawnComboBox(VALUE rb_mWX);
|
16
|
+
|
17
|
+
#if wxUSE_ODCOMBOBOX
|
18
|
+
#include <wx/odcombo.h>
|
19
|
+
#endif
|
20
|
+
|
21
|
+
|
22
|
+
#endif /* WXOWNERDRAWNCOMBOBOX_HPP_ */
|
data/ext/wxPalette.cpp
CHANGED
@@ -204,7 +204,7 @@ DLL_LOCAL void Init_WXPalette(VALUE rb_mWX)
|
|
204
204
|
rb_define_method(rb_cWXPalette,"each",RUBY_METHOD_FUNC(_each),0);
|
205
205
|
|
206
206
|
rb_define_method(rb_cWXPalette,"marshal_dump",RUBY_METHOD_FUNC(_marshal_dump),0);
|
207
|
-
rb_define_method(rb_cWXPalette,"marshal_load",RUBY_METHOD_FUNC(_marshal_load)
|
207
|
+
rb_define_method(rb_cWXPalette,"marshal_load",RUBY_METHOD_FUNC(_marshal_load),-2);
|
208
208
|
|
209
209
|
registerInfo<wxPalette>(rb_cWXPalette);
|
210
210
|
#endif
|
data/ext/wxPanel.cpp
CHANGED
@@ -43,9 +43,10 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
43
43
|
set_hash_option(hash,"style",style);
|
44
44
|
}
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
if(nil_check(parent))
|
47
|
+
_self->Create(unwrap<wxWindow*>(parent),id,
|
48
|
+
wxDefaultPosition,wxDefaultSize,style
|
49
|
+
);
|
49
50
|
|
50
51
|
}
|
51
52
|
rb_call_super(argc,argv);
|
data/ext/wxPen.cpp
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
#include "wxPen.hpp"
|
9
9
|
#include "wxColor.hpp"
|
10
10
|
#include "wxBitmap.hpp"
|
11
|
+
#include "wxApp.hpp"
|
11
12
|
|
12
13
|
#define _self unwrap<wxPen*>(self)
|
13
14
|
|
@@ -43,14 +44,18 @@ wxPen* unwrap< wxPen* >(const VALUE &vbitmap)
|
|
43
44
|
template <>
|
44
45
|
wxPen unwrap< wxPen >(const VALUE &vbitmap)
|
45
46
|
{
|
46
|
-
|
47
|
+
if(NIL_P(vbitmap))
|
48
|
+
return wxNullPen;
|
49
|
+
if(is_wrapable<wxColor>(vbitmap))
|
50
|
+
return wxPen(unwrap<wxColor>(vbitmap));
|
51
|
+
return *unwrap< wxPen* >(vbitmap);
|
47
52
|
}
|
48
53
|
|
49
54
|
|
50
55
|
namespace RubyWX {
|
51
56
|
namespace Pen {
|
52
57
|
DLL_LOCAL VALUE _alloc(VALUE self) {
|
53
|
-
return
|
58
|
+
return wrapTypedPtr(new wxPen, self);
|
54
59
|
}
|
55
60
|
|
56
61
|
macro_attr(Width,int)
|
@@ -61,6 +66,11 @@ macro_attr(Stipple,wxBitmap)
|
|
61
66
|
|
62
67
|
void define_const()
|
63
68
|
{
|
69
|
+
#if 0
|
70
|
+
rb_mWX = rb_define_module("WX");
|
71
|
+
rb_cWXPen = rb_define_class_under(rb_mWX,"Pen",rb_cObject);
|
72
|
+
#endif
|
73
|
+
|
64
74
|
if(rb_const_defined(rb_cWXPen,rb_intern("BLACK")))
|
65
75
|
return;
|
66
76
|
|
@@ -144,6 +154,22 @@ DLL_LOCAL VALUE _marshal_load(VALUE self, VALUE data)
|
|
144
154
|
return Qnil;
|
145
155
|
}
|
146
156
|
|
157
|
+
|
158
|
+
struct equal_obj {
|
159
|
+
wxPen* self;
|
160
|
+
VALUE other;
|
161
|
+
};
|
162
|
+
|
163
|
+
VALUE _equal_block(equal_obj *obj)
|
164
|
+
{
|
165
|
+
return wrap(*obj->self == unwrap<wxPen>(obj->other));
|
166
|
+
}
|
167
|
+
|
168
|
+
VALUE _equal_rescue(VALUE val)
|
169
|
+
{
|
170
|
+
return Qfalse;
|
171
|
+
}
|
172
|
+
|
147
173
|
/*
|
148
174
|
* call-seq:
|
149
175
|
* == pen -> bool
|
@@ -154,15 +180,24 @@ DLL_LOCAL VALUE _marshal_load(VALUE self, VALUE data)
|
|
154
180
|
*/
|
155
181
|
DLL_LOCAL VALUE _equal(VALUE self, VALUE other)
|
156
182
|
{
|
157
|
-
|
158
|
-
|
183
|
+
equal_obj obj;
|
184
|
+
obj.self = _self;
|
185
|
+
obj.other = other;
|
159
186
|
|
187
|
+
return rb_rescue(
|
188
|
+
RUBY_METHOD_FUNC(_equal_block),(VALUE)&obj,
|
189
|
+
RUBY_METHOD_FUNC(_equal_rescue),Qnil
|
190
|
+
);
|
191
|
+
}
|
160
192
|
|
161
193
|
DLL_LOCAL VALUE _class_get(int argc,VALUE *argv,VALUE self)
|
162
194
|
{
|
163
195
|
|
164
196
|
VALUE color,width,style;
|
165
197
|
rb_scan_args(argc, argv, "21",&color,&width,&style);
|
198
|
+
|
199
|
+
app_protected();
|
200
|
+
|
166
201
|
//TODO add refcounting
|
167
202
|
wxPen *pen = wxThePenList->FindOrCreatePen(
|
168
203
|
unwrap<wxColor>(color),
|
@@ -179,7 +214,7 @@ DLL_LOCAL VALUE _class_get(int argc,VALUE *argv,VALUE self)
|
|
179
214
|
return it->second;
|
180
215
|
} else {
|
181
216
|
//wrap wxPen pointer to ruby object
|
182
|
-
VALUE result =
|
217
|
+
VALUE result = wrapTypedPtr(pen,self);
|
183
218
|
|
184
219
|
//PenList objects should not be changed
|
185
220
|
rb_obj_freeze(result);
|
@@ -254,6 +289,14 @@ DLL_LOCAL VALUE _class_get(int argc,VALUE *argv,VALUE self)
|
|
254
289
|
|
255
290
|
DLL_LOCAL void Init_WXPen(VALUE rb_mWX)
|
256
291
|
{
|
292
|
+
#if 0
|
293
|
+
rb_mWX = rb_define_module("WX");
|
294
|
+
#endif
|
295
|
+
|
296
|
+
using namespace RubyWX::Pen;
|
297
|
+
rb_cWXPen = rb_define_class_under(rb_mWX,"Pen",rb_cObject);
|
298
|
+
rb_define_alloc_func(rb_cWXPen,_alloc);
|
299
|
+
|
257
300
|
#if 0
|
258
301
|
rb_define_attr(rb_cWXPen,"width",1,1);
|
259
302
|
rb_define_attr(rb_cWXPen,"color",1,1);
|
@@ -275,10 +318,6 @@ DLL_LOCAL void Init_WXPen(VALUE rb_mWX)
|
|
275
318
|
rb_define_const(rb_cWXPen,"WHITE",wrap(wxWHITE_PEN));
|
276
319
|
#endif
|
277
320
|
|
278
|
-
using namespace RubyWX::Pen;
|
279
|
-
rb_cWXPen = rb_define_class_under(rb_mWX,"Pen",rb_cObject);
|
280
|
-
rb_define_alloc_func(rb_cWXPen,_alloc);
|
281
|
-
|
282
321
|
rb_define_method(rb_cWXPen,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
283
322
|
rb_define_private_method(rb_cWXPen,"initialize_copy",RUBY_METHOD_FUNC(_initialize_copy),1);
|
284
323
|
|
@@ -289,7 +328,7 @@ DLL_LOCAL void Init_WXPen(VALUE rb_mWX)
|
|
289
328
|
rb_define_attr_method(rb_cWXPen,"stipple",_getStipple,_setStipple);
|
290
329
|
|
291
330
|
rb_define_method(rb_cWXPen,"marshal_dump",RUBY_METHOD_FUNC(_marshal_dump),0);
|
292
|
-
rb_define_method(rb_cWXPen,"marshal_load",RUBY_METHOD_FUNC(_marshal_load)
|
331
|
+
rb_define_method(rb_cWXPen,"marshal_load",RUBY_METHOD_FUNC(_marshal_load),-2);
|
293
332
|
|
294
333
|
rb_define_method(rb_cWXPen,"==",RUBY_METHOD_FUNC(_equal),1);
|
295
334
|
|
data/ext/wxPoint.cpp
CHANGED
@@ -193,16 +193,16 @@ DLL_LOCAL VALUE _marshal_load(VALUE self, VALUE data)
|
|
193
193
|
DLL_LOCAL void Init_WXPoint(VALUE rb_mWX)
|
194
194
|
{
|
195
195
|
|
196
|
-
#if 0
|
197
|
-
rb_define_attr(rb_cwxPoint,"x",1,1);
|
198
|
-
rb_define_attr(rb_cwxPoint,"y",1,1);
|
199
|
-
#endif
|
200
|
-
|
201
196
|
using namespace RubyWX::Point;
|
202
197
|
rb_cwxPoint = rb_define_class_under(rb_mWX,"Point",rb_cObject);
|
203
198
|
|
204
199
|
rb_define_alloc_func(rb_cwxPoint,_alloc);
|
205
200
|
|
201
|
+
#if 0
|
202
|
+
rb_define_attr(rb_cwxPoint,"x",1,1);
|
203
|
+
rb_define_attr(rb_cwxPoint,"y",1,1);
|
204
|
+
#endif
|
205
|
+
|
206
206
|
rb_define_method(rb_cwxPoint,"initialize",RUBY_METHOD_FUNC(_initialize),2);
|
207
207
|
rb_define_private_method(rb_cwxPoint,"initialize_copy",RUBY_METHOD_FUNC(_initialize_copy),1);
|
208
208
|
|
@@ -212,7 +212,7 @@ DLL_LOCAL void Init_WXPoint(VALUE rb_mWX)
|
|
212
212
|
rb_define_method(rb_cwxPoint,"inspect",RUBY_METHOD_FUNC(_inspect),0);
|
213
213
|
|
214
214
|
rb_define_method(rb_cwxPoint,"marshal_dump",RUBY_METHOD_FUNC(_marshal_dump),0);
|
215
|
-
rb_define_method(rb_cwxPoint,"marshal_load",RUBY_METHOD_FUNC(_marshal_load)
|
215
|
+
rb_define_method(rb_cwxPoint,"marshal_load",RUBY_METHOD_FUNC(_marshal_load),-2);
|
216
216
|
|
217
217
|
registerType<wxRealPoint>(rb_cwxPoint, true);
|
218
218
|
|
data/ext/wxPreferences.cpp
CHANGED
@@ -15,6 +15,10 @@ VALUE rb_cWXPreferences;
|
|
15
15
|
|
16
16
|
#include <wx/preferences.h>
|
17
17
|
|
18
|
+
#ifdef wxHAS_PREF_EDITOR_ICONS
|
19
|
+
#include "wxBitmap.hpp"
|
20
|
+
#endif
|
21
|
+
|
18
22
|
template <>
|
19
23
|
VALUE wrap< wxPreferencesEditor >(wxPreferencesEditor *point )
|
20
24
|
{
|
@@ -43,7 +47,6 @@ public:
|
|
43
47
|
|
44
48
|
return unwrap<wxWindow*>(result);
|
45
49
|
}
|
46
|
-
|
47
50
|
private:
|
48
51
|
VALUE mblock;
|
49
52
|
VALUE mklass;
|
@@ -52,8 +55,12 @@ private:
|
|
52
55
|
class RubyPreferencesPage : public RubyPreferencesPageInterface,public wxPreferencesPage
|
53
56
|
{
|
54
57
|
public:
|
55
|
-
RubyPreferencesPage(VALUE block,VALUE klass,const wxString &title) :
|
56
|
-
RubyPreferencesPageInterface(block,klass),wxPreferencesPage(),mtitle(title)
|
58
|
+
RubyPreferencesPage(VALUE block,VALUE klass,const wxString &title, VALUE bitmap) :
|
59
|
+
RubyPreferencesPageInterface(block,klass),wxPreferencesPage(),mtitle(title)
|
60
|
+
#ifdef wxHAS_PREF_EDITOR_ICONS
|
61
|
+
,mBitmap(unwrap<wxBitmap>(bitmap))
|
62
|
+
#endif
|
63
|
+
{}
|
57
64
|
|
58
65
|
//using RubyPreferencesPageInterface::CreateWindow;
|
59
66
|
wxWindow *CreateWindow(wxWindow *parent)
|
@@ -61,9 +68,17 @@ public:
|
|
61
68
|
return RubyPreferencesPageInterface::CreateWindow(parent);
|
62
69
|
}
|
63
70
|
|
71
|
+
#ifdef wxHAS_PREF_EDITOR_ICONS
|
72
|
+
virtual wxBitmap GetLargeIcon() const { return mBitmap; };
|
73
|
+
#endif
|
74
|
+
|
64
75
|
wxString GetName() const {return mtitle;}
|
65
76
|
private:
|
66
77
|
wxString mtitle;
|
78
|
+
|
79
|
+
#ifdef wxHAS_PREF_EDITOR_ICONS
|
80
|
+
wxBitmap mBitmap;
|
81
|
+
#endif
|
67
82
|
};
|
68
83
|
|
69
84
|
|
@@ -85,8 +100,8 @@ namespace Preferences {
|
|
85
100
|
|
86
101
|
DLL_LOCAL VALUE _add_page(int argc,VALUE *argv,VALUE self)
|
87
102
|
{
|
88
|
-
VALUE kind, klass,block;
|
89
|
-
rb_scan_args(argc, argv, "
|
103
|
+
VALUE kind, klass, block, bitmap;
|
104
|
+
rb_scan_args(argc, argv, "21&",&kind,&klass,&bitmap,&block);
|
90
105
|
wxPreferencesPage *page = NULL;
|
91
106
|
//VALUE block = rb_block_proc();
|
92
107
|
if(SYMBOL_P(kind))
|
@@ -99,7 +114,7 @@ DLL_LOCAL VALUE _add_page(int argc,VALUE *argv,VALUE self)
|
|
99
114
|
page = new RubyStockPreferencesPage(block,klass,wxkind);
|
100
115
|
}else
|
101
116
|
{
|
102
|
-
page = new RubyPreferencesPage(block,klass,unwrap<wxString>(kind));
|
117
|
+
page = new RubyPreferencesPage(block,klass,unwrap<wxString>(kind), bitmap);
|
103
118
|
}
|
104
119
|
|
105
120
|
_self->AddPage(page);
|
data/ext/wxProperty.cpp
CHANGED
@@ -603,8 +603,12 @@ VALUE find_prop_class(VALUE self,VALUE name)
|
|
603
603
|
*/
|
604
604
|
DLL_LOCAL void Init_WXProperty(VALUE rb_mWX)
|
605
605
|
{
|
606
|
-
#if
|
606
|
+
#if wxUSE_PROPGRID
|
607
|
+
using namespace RubyWX::Property;
|
608
|
+
rb_cWXProperty = rb_define_class_under(rb_mWX,"Property",rb_cObject);
|
609
|
+
rb_define_alloc_func(rb_cWXProperty,_alloc);
|
607
610
|
|
611
|
+
#if 0
|
608
612
|
rb_define_attr(rb_cWXProperty,"name",1,1);
|
609
613
|
rb_define_attr(rb_cWXProperty,"label",1,1);
|
610
614
|
rb_define_attr(rb_cWXProperty,"help_string",1,1);
|
@@ -625,14 +629,8 @@ DLL_LOCAL void Init_WXProperty(VALUE rb_mWX)
|
|
625
629
|
|
626
630
|
rb_define_attr(rb_cWXProperty,"depth",1,0);
|
627
631
|
rb_define_attr(rb_cWXProperty,"grid",1,0);
|
628
|
-
|
629
632
|
#endif
|
630
633
|
|
631
|
-
#if wxUSE_PROPGRID
|
632
|
-
using namespace RubyWX::Property;
|
633
|
-
rb_cWXProperty = rb_define_class_under(rb_mWX,"Property",rb_cObject);
|
634
|
-
rb_define_alloc_func(rb_cWXProperty,_alloc);
|
635
|
-
|
636
634
|
//TODO check if its possible to add this methods
|
637
635
|
rb_undef_method(rb_cWXProperty,"initialize_copy");
|
638
636
|
rb_undef_method(rb_cWXProperty,"_load");
|
data/ext/wxPropertyCell.cpp
CHANGED
@@ -69,6 +69,11 @@ DLL_LOCAL VALUE _inspect(VALUE self)
|
|
69
69
|
DLL_LOCAL void Init_WXPropertyCell(VALUE rb_mWX)
|
70
70
|
{
|
71
71
|
#if wxUSE_PROPGRID
|
72
|
+
|
73
|
+
using namespace RubyWX::PropertyCell;
|
74
|
+
rb_cWXPropertyCell = rb_define_class_under(rb_mWX,"PropertyCell",rb_cObject);
|
75
|
+
rb_undef_alloc_func(rb_cWXPropertyCell);
|
76
|
+
|
72
77
|
#if 0
|
73
78
|
rb_define_attr(rb_cWXPropertyCell,"text",1,1);
|
74
79
|
rb_define_attr(rb_cWXPropertyCell,"font",1,1);
|
@@ -77,10 +82,6 @@ DLL_LOCAL void Init_WXPropertyCell(VALUE rb_mWX)
|
|
77
82
|
rb_define_attr(rb_cWXPropertyCell,"bg_col",1,1);
|
78
83
|
#endif
|
79
84
|
|
80
|
-
using namespace RubyWX::PropertyCell;
|
81
|
-
rb_cWXPropertyCell = rb_define_class_under(rb_mWX,"PropertyCell",rb_cObject);
|
82
|
-
rb_undef_alloc_func(rb_cWXPropertyCell);
|
83
|
-
|
84
85
|
rb_undef_method(rb_cWXPropertyCell,"_load");
|
85
86
|
rb_undef_method(rb_cWXPropertyCell,"_dump");
|
86
87
|
|
data/ext/wxPropertyGrid.cpp
CHANGED
@@ -81,9 +81,12 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
81
81
|
set_hash_option(hash,"id",id,unwrapID);
|
82
82
|
set_hash_option(hash,"style",style);
|
83
83
|
}
|
84
|
-
|
85
|
-
_self->Create(unwrap<wxWindow*>(parent),id,wxDefaultPosition,wxDefaultSize,style);
|
86
84
|
|
85
|
+
if(nil_check(parent))
|
86
|
+
_self->Create(unwrap<wxWindow*>(parent),id,
|
87
|
+
wxDefaultPosition,wxDefaultSize,style
|
88
|
+
);
|
89
|
+
|
87
90
|
}
|
88
91
|
|
89
92
|
rb_call_super(argc,argv);
|
@@ -112,25 +115,6 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
112
115
|
}
|
113
116
|
#endif
|
114
117
|
|
115
|
-
|
116
|
-
/* Document-method: root
|
117
|
-
* call-seq:
|
118
|
-
* root -> WX::Property
|
119
|
-
*
|
120
|
-
* returns the root property of this WX::PropertyGrid
|
121
|
-
* ===Return value
|
122
|
-
* WX::Property
|
123
|
-
*/
|
124
|
-
|
125
|
-
/* Document-method: status_bar
|
126
|
-
* call-seq:
|
127
|
-
* status_bar -> WX::StatusBar
|
128
|
-
*
|
129
|
-
* returns the status bar of this WX::PropertyGrid when available.
|
130
|
-
* ===Return value
|
131
|
-
* WX::StatusBar
|
132
|
-
*/
|
133
|
-
|
134
118
|
/* Document-method: caption_font
|
135
119
|
* call-seq:
|
136
120
|
* caption_font -> WX::Font
|
@@ -140,6 +124,14 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
140
124
|
* WX::Font
|
141
125
|
*/
|
142
126
|
|
127
|
+
|
128
|
+
/* Document-attr: root
|
129
|
+
* the root property of this WX::PropertyGrid. WX::Property
|
130
|
+
*/
|
131
|
+
/* Document-attr: status_bar
|
132
|
+
* the status bar of this WX::PropertyGrid when available. WX::StatusBar
|
133
|
+
*/
|
134
|
+
|
143
135
|
/* Document-attr: caption_background_color
|
144
136
|
* the caption background color of the PropertyGrid. WX::Color
|
145
137
|
*/
|
@@ -182,6 +174,16 @@ DLL_LOCAL void Init_WXPropertyGrid(VALUE rb_mWX)
|
|
182
174
|
|
183
175
|
rb_mWXPropertyGridInterface = rb_define_module_under(rb_mWX,"PropertyGridInterface");
|
184
176
|
|
177
|
+
#endif
|
178
|
+
#if wxUSE_PROPGRID
|
179
|
+
using namespace RubyWX::PropertyGrid;
|
180
|
+
rb_cWXPropertyGrid = rb_define_class_under(rb_mWX,"PropertyGrid",rb_cWXControl);
|
181
|
+
rb_define_alloc_func(rb_cWXPropertyGrid,_alloc);
|
182
|
+
|
183
|
+
#if 0
|
184
|
+
rb_define_attr(rb_cWXPropertyGrid,"root",1,0);
|
185
|
+
rb_define_attr(rb_cWXPropertyGrid,"status_bar",1,0);
|
186
|
+
|
185
187
|
rb_define_attr(rb_cWXPropertyGrid,"caption_background_color",1,1);
|
186
188
|
rb_define_attr(rb_cWXPropertyGrid,"selection_background_color",1,1);
|
187
189
|
|
@@ -195,19 +197,16 @@ DLL_LOCAL void Init_WXPropertyGrid(VALUE rb_mWX)
|
|
195
197
|
rb_define_attr(rb_cWXPropertyGrid,"margin_color",1,1);
|
196
198
|
|
197
199
|
#endif
|
198
|
-
#if wxUSE_PROPGRID
|
199
|
-
using namespace RubyWX::PropertyGrid;
|
200
|
-
rb_cWXPropertyGrid = rb_define_class_under(rb_mWX,"PropertyGrid",rb_cWXControl);
|
201
|
-
rb_define_alloc_func(rb_cWXPropertyGrid,_alloc);
|
202
200
|
|
203
201
|
rb_include_module(rb_cWXPropertyGrid,rb_mWXPropertyGridInterface);
|
204
202
|
|
205
203
|
rb_define_method(rb_cWXPropertyGrid,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
206
204
|
|
207
|
-
|
205
|
+
rb_define_attr_method(rb_cWXPropertyGrid,"root",_GetRoot,0);
|
208
206
|
|
209
207
|
#if wxUSE_STATUSBAR
|
210
|
-
|
208
|
+
rb_define_attr_method(rb_cWXPropertyGrid,"status_bar",_GetStatusBar,0);
|
209
|
+
|
211
210
|
#endif
|
212
211
|
|
213
212
|
rb_define_method(rb_cWXPropertyGrid,"caption_font",RUBY_METHOD_FUNC(_GetCaptionFont),0);
|
@@ -59,7 +59,10 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
59
59
|
|
60
60
|
}
|
61
61
|
|
62
|
-
|
62
|
+
if(nil_check(parent))
|
63
|
+
_self->Create(unwrap<wxWindow*>(parent),id,
|
64
|
+
wxDefaultPosition,wxDefaultSize,style
|
65
|
+
);
|
63
66
|
|
64
67
|
}
|
65
68
|
|
@@ -234,14 +237,19 @@ DLL_LOCAL void Init_WXPropertyGridManager(VALUE rb_mWX)
|
|
234
237
|
rb_cWXPropertyGridManager = rb_define_class_under(rb_mWX,"PropertyGridManager",rb_cWXPanel);
|
235
238
|
rb_define_alloc_func(rb_cWXPropertyGridManager,_alloc);
|
236
239
|
|
240
|
+
#if 0
|
241
|
+
rb_define_attr(rb_cWXPropertyGridManager,"tool_bar",1,0);
|
242
|
+
rb_define_attr(rb_cWXPropertyGridManager,"grid",1,0);
|
243
|
+
rb_define_attr(rb_cWXPropertyGridManager,"current_page",1,0);
|
244
|
+
#endif
|
245
|
+
|
237
246
|
rb_include_module(rb_cWXPropertyGridManager,rb_mWXPropertyGridInterface);
|
238
247
|
|
239
248
|
rb_define_method(rb_cWXPropertyGridManager,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
240
249
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
rb_define_method(rb_cWXPropertyGridManager,"current_page",RUBY_METHOD_FUNC(_GetCurrentPage),0);
|
250
|
+
rb_define_attr_method(rb_cWXPropertyGridManager,"tool_bar",_GetToolBar,0);
|
251
|
+
rb_define_attr_method(rb_cWXPropertyGridManager,"grid",_GetGrid,0);
|
252
|
+
rb_define_attr_method(rb_cWXPropertyGridManager,"current_page",_GetCurrentPage,0);
|
245
253
|
|
246
254
|
rb_define_method(rb_cWXPropertyGridManager,"add_page",RUBY_METHOD_FUNC(_add_page),-1);
|
247
255
|
rb_define_method(rb_cWXPropertyGridManager,"insert_page",RUBY_METHOD_FUNC(_insert_page),-1);
|