rwx 0.0.1.dev → 0.0.1.1.dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/ext/wxComboCtrl.hpp
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
/*
|
2
|
+
* wxComboCtrl.hpp
|
3
|
+
*
|
4
|
+
* Created on: 14.10.2014
|
5
|
+
* Author: hanmac
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef WXCOMBOCTRL_HPP_
|
9
|
+
#define WXCOMBOCTRL_HPP_
|
10
|
+
|
11
|
+
#include "main.hpp"
|
12
|
+
|
13
|
+
extern VALUE rb_cWXComboCtrl;
|
14
|
+
|
15
|
+
void Init_WXComboCtrl(VALUE rb_mWX);
|
16
|
+
|
17
|
+
#if wxUSE_COMBOCTRL
|
18
|
+
#include <wx/combo.h>
|
19
|
+
#endif
|
20
|
+
|
21
|
+
|
22
|
+
#endif /* WXCOMBOCTRL_HPP_ */
|
data/ext/wxControl.cpp
CHANGED
@@ -43,8 +43,8 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
43
43
|
{
|
44
44
|
set_hash_option(hash,"id",id,unwrapID);
|
45
45
|
}
|
46
|
-
|
47
|
-
|
46
|
+
if(nil_check(parent))
|
47
|
+
_self->Create(unwrap<wxWindow*>(parent),id);
|
48
48
|
}
|
49
49
|
rb_call_super(argc,argv);
|
50
50
|
|
data/ext/wxDC.cpp
CHANGED
@@ -199,6 +199,11 @@ DLL_LOCAL VALUE _DrawLines(int argc,VALUE *argv,VALUE self)
|
|
199
199
|
|
200
200
|
DLL_LOCAL void Init_WXDC(VALUE rb_mWX)
|
201
201
|
{
|
202
|
+
|
203
|
+
using namespace RubyWX::DC;
|
204
|
+
rb_cWXDC = rb_define_class_under(rb_mWX,"DC",rb_cObject);
|
205
|
+
rb_undef_alloc_func(rb_cWXDC);
|
206
|
+
|
202
207
|
#if 0
|
203
208
|
rb_define_attr(rb_cWXDC,"font",1,1);
|
204
209
|
rb_define_attr(rb_cWXDC,"pen",1,1);
|
@@ -213,10 +218,6 @@ DLL_LOCAL void Init_WXDC(VALUE rb_mWX)
|
|
213
218
|
rb_define_attr(rb_cWXDC,"logical_scale",1,1);
|
214
219
|
#endif
|
215
220
|
|
216
|
-
using namespace RubyWX::DC;
|
217
|
-
rb_cWXDC = rb_define_class_under(rb_mWX,"DC",rb_cObject);
|
218
|
-
rb_undef_alloc_func(rb_cWXDC);
|
219
|
-
|
220
221
|
rb_undef_method(rb_cWXDC,"initialize_copy");
|
221
222
|
rb_undef_method(rb_cWXDC,"_load");
|
222
223
|
rb_undef_method(rb_cWXDC,"_dump");
|
data/ext/wxDatePicker.cpp
CHANGED
@@ -46,12 +46,12 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
46
46
|
set_hash_option(hash,"date",date);
|
47
47
|
set_hash_option(hash,"style",style);
|
48
48
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
49
|
+
if(nil_check(parent))
|
50
|
+
_self->Create(
|
51
|
+
unwrap<wxWindow*>(parent),id,date,
|
52
|
+
wxDefaultPosition,wxDefaultSize,
|
53
|
+
style
|
54
|
+
);
|
55
55
|
|
56
56
|
}
|
57
57
|
|
@@ -83,7 +83,6 @@ DLL_LOCAL void Init_WXDatePicker(VALUE rb_mWX)
|
|
83
83
|
rb_cWXWindow = rb_define_class_under(rb_mWX,"Window",rb_cObject);
|
84
84
|
|
85
85
|
rb_cWXControl = rb_define_class_under(rb_mWX,"Control",rb_cWXWindow);
|
86
|
-
rb_define_attr(rb_cWXDatePicker,"value",1,1);
|
87
86
|
#endif
|
88
87
|
|
89
88
|
#if wxUSE_DATEPICKCTRL
|
@@ -91,6 +90,10 @@ DLL_LOCAL void Init_WXDatePicker(VALUE rb_mWX)
|
|
91
90
|
rb_cWXDatePicker = rb_define_class_under(rb_mWX,"DatePicker",rb_cWXControl);
|
92
91
|
rb_define_alloc_func(rb_cWXDatePicker,_alloc);
|
93
92
|
|
93
|
+
#if 0
|
94
|
+
rb_define_attr(rb_cWXDatePicker,"value",1,1);
|
95
|
+
#endif
|
96
|
+
|
94
97
|
rb_define_method(rb_cWXDatePicker,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
95
98
|
|
96
99
|
rb_define_attr_method(rb_cWXDatePicker,"value",_getValue,_setValue);
|
data/ext/wxDirCtrl.cpp
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
/*
|
2
|
+
* wxDirCtrl.cpp
|
3
|
+
*
|
4
|
+
* Created on: 29.09.2014
|
5
|
+
* Author: hanmac
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include "wxDirCtrl.hpp"
|
9
|
+
#include "wxFileCtrlBase.hpp"
|
10
|
+
|
11
|
+
VALUE rb_cWXDirCtrl;
|
12
|
+
|
13
|
+
#if wxUSE_DIRDLG
|
14
|
+
|
15
|
+
#if !defined(HAVE_WXDIRCTRL)
|
16
|
+
#define wxDirCtrl wxGenericDirCtrl
|
17
|
+
#endif
|
18
|
+
|
19
|
+
#define _self unwrap<wxDirCtrl*>(self)
|
20
|
+
|
21
|
+
namespace RubyWX {
|
22
|
+
namespace DirCtrl {
|
23
|
+
|
24
|
+
APP_PROTECT(wxDirCtrl)
|
25
|
+
|
26
|
+
macro_attr_with_func(Filter,wrap,unwrapWildCard)
|
27
|
+
|
28
|
+
macro_attr(Path,wxString)
|
29
|
+
|
30
|
+
singlereturn(GetFilterIndex)
|
31
|
+
singlereturn_array(GetFilePaths,wxArrayString)
|
32
|
+
|
33
|
+
/*
|
34
|
+
* call-seq:
|
35
|
+
* DirCtrl.new(parent, name, [options])
|
36
|
+
* DirCtrl.new(parent, [options])
|
37
|
+
*
|
38
|
+
* creates a new DirCtrl widget.
|
39
|
+
* ===Arguments
|
40
|
+
* * parent of this window or nil
|
41
|
+
* * name is a String describing a resource in a loaded xrc
|
42
|
+
*
|
43
|
+
* *options: Hash with possible options to set:
|
44
|
+
* * default_directory String default directory
|
45
|
+
*
|
46
|
+
*/
|
47
|
+
DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
48
|
+
{
|
49
|
+
VALUE parent,name,hash;
|
50
|
+
rb_scan_args(argc, argv, "11:",&parent,&name,&hash);
|
51
|
+
|
52
|
+
if(!_created && !rb_obj_is_kind_of(name,rb_cString))
|
53
|
+
{
|
54
|
+
wxWindowID id(wxID_ANY);
|
55
|
+
#ifdef HAVE_CONST_WXDIRCTRL_DEFAULT_STYLE
|
56
|
+
int style(wxDIRCTRL_DEFAULT_STYLE);
|
57
|
+
#else
|
58
|
+
int style(wxDIRCTRL_3D_INTERNAL);
|
59
|
+
#endif
|
60
|
+
wxString defaultDirectory(wxDirDialogDefaultFolderStr);
|
61
|
+
|
62
|
+
if(rb_obj_is_kind_of(hash,rb_cHash))
|
63
|
+
{
|
64
|
+
set_hash_option(hash,"id",id,unwrapID);
|
65
|
+
set_hash_option(hash,"style",style);
|
66
|
+
|
67
|
+
set_hash_option(hash,"default_directory",defaultDirectory);
|
68
|
+
|
69
|
+
set_hash_flag_option(hash, "dir_only", wxDIRCTRL_DIR_ONLY, style);
|
70
|
+
set_hash_flag_option(hash, "select_first", wxDIRCTRL_SELECT_FIRST, style);
|
71
|
+
set_hash_flag_option(hash, "show_filters", wxDIRCTRL_SHOW_FILTERS, style);
|
72
|
+
set_hash_flag_option(hash, "internal_3d", wxDIRCTRL_3D_INTERNAL, style);
|
73
|
+
set_hash_flag_option(hash, "edit_labels", wxDIRCTRL_EDIT_LABELS, style);
|
74
|
+
set_hash_flag_option(hash, "multiple", wxDIRCTRL_MULTIPLE, style);
|
75
|
+
|
76
|
+
}
|
77
|
+
|
78
|
+
if(nil_check(parent)) {
|
79
|
+
_self->Create(unwrap<wxWindow*>(parent),id,
|
80
|
+
defaultDirectory,
|
81
|
+
wxDefaultPosition,
|
82
|
+
wxDefaultSize,style
|
83
|
+
);
|
84
|
+
}
|
85
|
+
|
86
|
+
}
|
87
|
+
|
88
|
+
rb_call_super(argc,argv);
|
89
|
+
return self;
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
VALUE _setFilterIndex(VALUE self,VALUE other)
|
95
|
+
{
|
96
|
+
rb_check_frozen(self);
|
97
|
+
int filter(NUM2INT(other));
|
98
|
+
|
99
|
+
if(check_filter_index(filter,_self->GetFilter()))
|
100
|
+
_self->SetFilterIndex(filter);
|
101
|
+
|
102
|
+
return other;
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
}
|
107
|
+
}
|
108
|
+
#endif
|
109
|
+
|
110
|
+
/* Document-attr: filter
|
111
|
+
* the filter of the DirCtrl. String, raise an ArgumentError if filter has wrong format
|
112
|
+
*/
|
113
|
+
/* Document-attr: filter_index
|
114
|
+
* the filter_index of the DirCtrl.
|
115
|
+
* Can't be higher than filters in filter. Integer
|
116
|
+
*/
|
117
|
+
/* Document-attr: path
|
118
|
+
* the path of the DirCtrl. String
|
119
|
+
*/
|
120
|
+
/* Document-attr: file_paths
|
121
|
+
* the file paths of the DirCtrl. Array<String>
|
122
|
+
*/
|
123
|
+
|
124
|
+
DLL_LOCAL void Init_WXDirCtrl(VALUE rb_mWX)
|
125
|
+
{
|
126
|
+
#if 0
|
127
|
+
rb_mWX = rb_define_module("WX");
|
128
|
+
rb_cWXWindow = rb_define_class_under(rb_mWX,"Window",rb_cObject);
|
129
|
+
|
130
|
+
rb_cWXControl = rb_define_class_under(rb_mWX,"Control",rb_cWXWindow);
|
131
|
+
#endif
|
132
|
+
|
133
|
+
#if wxUSE_DIRDLG
|
134
|
+
using namespace RubyWX::DirCtrl;
|
135
|
+
rb_cWXDirCtrl = rb_define_class_under(rb_mWX,"DirCtrl",rb_cWXControl);
|
136
|
+
rb_define_alloc_func(rb_cWXDirCtrl,_alloc);
|
137
|
+
|
138
|
+
#if 0
|
139
|
+
rb_define_attr(rb_cWXDirCtrl,"filter",1,1);
|
140
|
+
rb_define_attr(rb_cWXDirCtrl,"path",1,1);
|
141
|
+
rb_define_attr(rb_cWXDirCtrl,"filter_index",1,1);
|
142
|
+
|
143
|
+
rb_define_attr(rb_cWXDirCtrl,"file_paths",1,0);
|
144
|
+
#endif
|
145
|
+
|
146
|
+
rb_define_method(rb_cWXDirCtrl,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
147
|
+
|
148
|
+
rb_define_attr_method(rb_cWXDirCtrl,"filter",_getFilter,_setFilter);
|
149
|
+
rb_define_attr_method(rb_cWXDirCtrl,"path",_getPath,_setPath);
|
150
|
+
rb_define_attr_method(rb_cWXDirCtrl,"filter_index",_GetFilterIndex,_setFilterIndex);
|
151
|
+
|
152
|
+
rb_define_attr_method(rb_cWXDirCtrl,"file_paths",_GetFilePaths,NULL);
|
153
|
+
|
154
|
+
registerInfo<wxFileCtrl>(rb_cWXDirCtrl);
|
155
|
+
#endif
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
data/ext/wxDirCtrl.hpp
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
/*
|
2
|
+
* wxDirCtrl.hpp
|
3
|
+
*
|
4
|
+
* Created on: 29.09.2014
|
5
|
+
* Author: hanmac
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef WXDIRCTRL_HPP_
|
9
|
+
#define WXDIRCTRL_HPP_
|
10
|
+
|
11
|
+
#include "wxControl.hpp"
|
12
|
+
|
13
|
+
extern VALUE rb_cWXDirCtrl;
|
14
|
+
|
15
|
+
void Init_WXDirCtrl(VALUE rb_mWX);
|
16
|
+
|
17
|
+
#if wxUSE_DIRDLG
|
18
|
+
#include <wx/dirctrl.h>
|
19
|
+
#endif
|
20
|
+
|
21
|
+
#endif /* WXDIRCTRL_HPP_ */
|
data/ext/wxDirPicker.cpp
CHANGED
@@ -71,11 +71,11 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
71
71
|
}
|
72
72
|
|
73
73
|
FileDirPicker::check_style_flags(style);
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
if(nil_check(parent))
|
75
|
+
_self->Create(
|
76
|
+
unwrap<wxWindow*>(parent),id,path,
|
77
|
+
message,wxDefaultPosition,wxDefaultSize,style
|
78
|
+
);
|
79
79
|
|
80
80
|
}
|
81
81
|
rb_call_super(argc,argv);
|
data/ext/wxDirPickerWidget.cpp
CHANGED
@@ -63,11 +63,12 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
63
63
|
|
64
64
|
FileDirPicker::check_style_flags(style);
|
65
65
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
66
|
+
if(nil_check(parent))
|
67
|
+
_self->Create(
|
68
|
+
unwrap<wxWindow*>(parent),id,label,path,
|
69
|
+
message,wildCard,
|
70
|
+
wxDefaultPosition,wxDefaultSize,style
|
71
|
+
);
|
71
72
|
|
72
73
|
}
|
73
74
|
|
@@ -104,9 +105,6 @@ DLL_LOCAL void Init_WXDirPickerWidget(VALUE rb_mWX)
|
|
104
105
|
rb_cWXAnyButton = rb_define_class_under(rb_mWX,"AnyButton",rb_cWXControl);
|
105
106
|
|
106
107
|
rb_cWXButton = rb_define_class_under(rb_mWX,"Button",rb_cWXAnyButton);
|
107
|
-
|
108
|
-
rb_define_attr(rb_cWXDirPickerWidget,"path",1,1);
|
109
|
-
|
110
108
|
#endif
|
111
109
|
|
112
110
|
#if wxUSE_DIRPICKERCTRL
|
@@ -114,6 +112,10 @@ DLL_LOCAL void Init_WXDirPickerWidget(VALUE rb_mWX)
|
|
114
112
|
rb_cWXDirPickerWidget = rb_define_class_under(rb_mWX,"DirPickerWidget",rb_cWXButton);
|
115
113
|
rb_define_alloc_func(rb_cWXDirPickerWidget,_alloc);
|
116
114
|
|
115
|
+
#if 0
|
116
|
+
rb_define_attr(rb_cWXDirPickerWidget,"path",1,1);
|
117
|
+
#endif
|
118
|
+
|
117
119
|
rb_define_method(rb_cWXDirPickerWidget,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
118
120
|
|
119
121
|
rb_define_attr_method(rb_cWXDirPickerWidget,"path",_getPath,_setPath);
|
data/ext/wxFileCtrl.cpp
CHANGED
@@ -59,8 +59,11 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
59
59
|
FileCtrlBase::set_style_flags(hash,style);
|
60
60
|
|
61
61
|
}
|
62
|
-
|
63
|
-
|
62
|
+
if(nil_check(parent))
|
63
|
+
_self->Create(unwrap<wxWindow*>(parent),id,
|
64
|
+
defaultDirectory,defaultFilename,
|
65
|
+
defaultWildCard,style
|
66
|
+
);
|
64
67
|
|
65
68
|
}
|
66
69
|
|
data/ext/wxFileCtrlBase.cpp
CHANGED
@@ -45,6 +45,9 @@ macro_attr(Directory,wxString)
|
|
45
45
|
macro_attr(Filename,wxString)
|
46
46
|
macro_attr(Path,wxString)
|
47
47
|
|
48
|
+
singlereturn_array(GetPaths,wxArrayString)
|
49
|
+
singlereturn_array(GetFilenames,wxArrayString)
|
50
|
+
|
48
51
|
singlereturn(GetFilterIndex)
|
49
52
|
|
50
53
|
|
@@ -139,6 +142,15 @@ singlereturn(GetFile)
|
|
139
142
|
/* Document-attr: filename
|
140
143
|
* the filename of the FileCtrl. String
|
141
144
|
*/
|
145
|
+
/* Document-attr: path
|
146
|
+
* the path of the FileCtrl. String
|
147
|
+
*/
|
148
|
+
/* Document-attr: filenames
|
149
|
+
* the filenames of the FileCtrl. Array<String>
|
150
|
+
*/
|
151
|
+
/* Document-attr: paths
|
152
|
+
* the paths of the FileCtrl. Array<String>
|
153
|
+
*/
|
142
154
|
|
143
155
|
/* Document-const: OPEN
|
144
156
|
* creates control in "open" mode
|
@@ -166,12 +178,27 @@ DLL_LOCAL void Init_WXFileCtrlBase(VALUE rb_mWX)
|
|
166
178
|
|
167
179
|
rb_cWXEvent = rb_define_class_under(rb_mWX,"Event",rb_cObject);
|
168
180
|
rb_cWXCommandEvent = rb_define_class_under(rb_cWXEvent,"Command",rb_cWXEvent);
|
181
|
+
#endif
|
182
|
+
|
183
|
+
|
184
|
+
#if wxUSE_FILECTRL
|
185
|
+
using namespace RubyWX::FileCtrlBase;
|
186
|
+
rb_cWXFileCtrlBase = rb_define_class_under(rb_mWX,"FileCtrlBase",rb_cWXControl);
|
187
|
+
rb_undef_alloc_func(rb_cWXFileCtrlBase);
|
188
|
+
|
189
|
+
rb_cWXFileCtrlEvent = rb_define_class_under(rb_cWXEvent,"FileCtrl",rb_cWXCommandEvent);
|
169
190
|
|
191
|
+
#if 0
|
170
192
|
rb_define_attr(rb_cWXFileCtrlBase,"wildcard",1,1);
|
171
193
|
rb_define_attr(rb_cWXFileCtrlBase,"directory",1,1);
|
172
194
|
rb_define_attr(rb_cWXFileCtrlBase,"filename",1,1);
|
195
|
+
rb_define_attr(rb_cWXFileCtrlBase,"path",1,1);
|
173
196
|
rb_define_attr(rb_cWXFileCtrlBase,"filter_index",1,1);
|
174
197
|
|
198
|
+
rb_define_attr(rb_cWXFileCtrlBase,"filenames",1,0);
|
199
|
+
rb_define_attr(rb_cWXFileCtrlBase,"paths",1,0);
|
200
|
+
|
201
|
+
|
175
202
|
rb_define_attr(rb_cWXFileCtrlEvent,"directory",1,1);
|
176
203
|
rb_define_attr(rb_cWXFileCtrlEvent,"filter_index",1,1);
|
177
204
|
|
@@ -179,18 +206,17 @@ DLL_LOCAL void Init_WXFileCtrlBase(VALUE rb_mWX)
|
|
179
206
|
|
180
207
|
#endif
|
181
208
|
|
182
|
-
#if wxUSE_FILECTRL
|
183
|
-
using namespace RubyWX::FileCtrlBase;
|
184
|
-
rb_cWXFileCtrlBase = rb_define_class_under(rb_mWX,"FileCtrlBase",rb_cWXControl);
|
185
|
-
rb_undef_alloc_func(rb_cWXFileCtrlBase);
|
186
|
-
|
187
209
|
rb_define_method(rb_cWXFileCtrlBase,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
188
210
|
|
189
211
|
rb_define_attr_method(rb_cWXFileCtrlBase,"wildcard",_getWildcard,_setWildcard);
|
190
212
|
rb_define_attr_method(rb_cWXFileCtrlBase,"directory",_getDirectory,_setDirectory);
|
191
213
|
rb_define_attr_method(rb_cWXFileCtrlBase,"filename",_getFilename,_setFilename);
|
214
|
+
rb_define_attr_method(rb_cWXFileCtrlBase,"path",_getPath,_setPath);
|
192
215
|
rb_define_attr_method(rb_cWXFileCtrlBase,"filter_index",_GetFilterIndex,_setFilterIndex);
|
193
216
|
|
217
|
+
rb_define_attr_method(rb_cWXFileCtrlBase,"filenames",_GetFilenames,NULL);
|
218
|
+
rb_define_attr_method(rb_cWXFileCtrlBase,"paths",_GetPaths,NULL);
|
219
|
+
|
194
220
|
rb_define_const(rb_cWXFileCtrlBase,"OPEN",INT2NUM(wxFC_OPEN));
|
195
221
|
rb_define_const(rb_cWXFileCtrlBase,"SAVE",INT2NUM(wxFC_SAVE));
|
196
222
|
rb_define_const(rb_cWXFileCtrlBase,"MULTIPLE",INT2NUM(wxFC_MULTIPLE));
|
@@ -198,8 +224,6 @@ DLL_LOCAL void Init_WXFileCtrlBase(VALUE rb_mWX)
|
|
198
224
|
|
199
225
|
rb_define_const(rb_cWXFileCtrlBase,"DEFAULT_STYLE",INT2NUM(wxFC_DEFAULT_STYLE));
|
200
226
|
|
201
|
-
|
202
|
-
rb_cWXFileCtrlEvent = rb_define_class_under(rb_cWXEvent,"FileCtrl",rb_cWXCommandEvent);
|
203
227
|
registerEventType("filectrl_selectionchanged",wxEVT_FILECTRL_SELECTIONCHANGED,rb_cWXFileCtrlEvent);
|
204
228
|
registerEventType("filectrl_fileactivated",wxEVT_FILECTRL_FILEACTIVATED,rb_cWXFileCtrlEvent);
|
205
229
|
registerEventType("filectrl_folderchanged",wxEVT_FILECTRL_FOLDERCHANGED,rb_cWXFileCtrlEvent);
|
data/ext/wxFileCtrlGeneric.cpp
CHANGED
@@ -62,8 +62,11 @@ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
62
62
|
FileCtrlBase::set_style_flags(hash,style);
|
63
63
|
|
64
64
|
}
|
65
|
-
|
66
|
-
|
65
|
+
if(nil_check(parent))
|
66
|
+
_self->Create(unwrap<wxWindow*>(parent), id,
|
67
|
+
defaultDirectory, defaultFilename,
|
68
|
+
defaultWildCard, style
|
69
|
+
);
|
67
70
|
|
68
71
|
}
|
69
72
|
|