wxruby3 0.9.0 → 0.9.1
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/ext/wxruby3/include/wxruby-runtime.h +3 -0
- data/ext/wxruby3/swig/common.i +22 -0
- data/ext/wxruby3/swig/custom/director.swg +296 -0
- data/ext/wxruby3/swig/custom/rubyapi.swg +19 -0
- data/ext/wxruby3/swig/custom/rubyerrors.swg +45 -0
- data/ext/wxruby3/swig/custom/rubyhead.swg +192 -0
- data/ext/wxruby3/swig/custom/rubyrun.swg +187 -0
- data/ext/wxruby3/swig/custom/swigrun.swg +363 -0
- data/ext/wxruby3/swig/custom/typemaps/swigtypemaps.swg +173 -0
- data/ext/wxruby3/swig/wx.i +50 -30
- data/lib/wx/core/const.rb +83 -0
- data/lib/wx/doc/const.rb +66 -66
- data/lib/wx/doc/event.rb +0 -6
- data/lib/wx/doc/functions.rb +9 -9
- data/lib/wx/doc/window.rb +5 -0
- data/lib/wx/keyword_defs.rb +43 -6
- data/lib/wx/version.rb +1 -1
- data/rakelib/lib/config/macosx.rb +1 -1
- data/rakelib/lib/core/include/funcall.inc +33 -14
- data/rakelib/lib/core/include/swigdirector.inc +384 -0
- data/rakelib/lib/core/include/swigrubyerrors.inc +161 -0
- data/{ext/wxruby3/swig/custom/swig4/rubyrun.swg → rakelib/lib/core/include/swigrubyrun.inc} +245 -120
- data/rakelib/lib/core/include/swigrun.inc +700 -0
- data/rakelib/lib/core/package.rb +5 -2
- data/rakelib/lib/core/parameter.rb +3 -0
- data/rakelib/lib/director/accelerator.rb +1 -1
- data/rakelib/lib/director/animation.rb +1 -1
- data/rakelib/lib/director/animation_ctrl.rb +20 -0
- data/rakelib/lib/director/app.rb +23 -5
- data/rakelib/lib/director/art_provider.rb +1 -1
- data/rakelib/lib/director/data_object_simple_base.rb +1 -2
- data/rakelib/lib/director/dialog.rb +5 -0
- data/rakelib/lib/director/dialup_event.rb +44 -0
- data/rakelib/lib/director/dialup_manager.rb +45 -0
- data/rakelib/lib/director/event.rb +20 -2
- data/rakelib/lib/director/file_ctrl.rb +35 -0
- data/rakelib/lib/director/file_ctrl_event.rb +26 -0
- data/rakelib/lib/director/gdicommon.rb +19 -1
- data/rakelib/lib/director/grid_cell_editor.rb +6 -6
- data/rakelib/lib/director/help_controller.rb +1 -1
- data/rakelib/lib/director/pgarray_editor_dialog.rb +0 -6
- data/rakelib/lib/director/pgeditor.rb +2 -2
- data/rakelib/lib/director/pgproperties.rb +2 -2
- data/rakelib/lib/director/richtext_buffer.rb +1 -1
- data/rakelib/lib/director/richtext_ctrl.rb +1 -1
- data/rakelib/lib/director/sash_event.rb +42 -0
- data/rakelib/lib/director/sizer.rb +64 -1
- data/rakelib/lib/director/sizer_item.rb +22 -0
- data/rakelib/lib/director/task_bar_icon.rb +1 -1
- data/rakelib/lib/director/tree_ctrl.rb +19 -44
- data/rakelib/lib/generate/doc/animation_ctrl.yaml +15 -0
- data/rakelib/lib/generate/doc/events.yaml +10 -4
- data/rakelib/lib/generate/doc/static_box.yaml +8 -0
- data/rakelib/lib/generate/doc/xml_resource.yaml +3 -0
- data/rakelib/lib/generate/doc.rb +14 -3
- data/rakelib/lib/generate/interface.rb +4 -3
- data/rakelib/lib/specs/interfaces.rb +5 -1
- data/rakelib/lib/swig_runner.rb +4 -50
- data/rakelib/lib/typemap/common.rb +24 -9
- data/rakelib/lib/typemap/data_format.rb +1 -1
- data/rakelib/lib/typemap/data_object_data.rb +2 -2
- data/rakelib/lib/typemap/pgprop_arg.rb +7 -2
- data/rakelib/lib/typemap/points_list.rb +5 -7
- data/rakelib/lib/util/string.rb +10 -8
- data/samples/text/richtext.rb +0 -30
- data/tests/test_app_exit_exception.rb +36 -0
- data/tests/test_app_init_exception.rb +20 -0
- data/tests/test_book_controls.rb +29 -0
- data/tests/test_exceptions.rb +41 -0
- data/tests/test_sizer.rb +43 -0
- data/tests/test_std_controls.rb +36 -0
- metadata +25 -4
- data/ext/wxruby3/swig/custom/swig3/rubyrun.swg +0 -456
@@ -0,0 +1,173 @@
|
|
1
|
+
/* -----------------------------------------------------------------------------
|
2
|
+
* swigtypemaps.swg
|
3
|
+
*
|
4
|
+
* Unified Typemap Library frontend
|
5
|
+
*
|
6
|
+
* Customized for wxRuby3.
|
7
|
+
* Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
8
|
+
*
|
9
|
+
* This software is released under the MIT license.
|
10
|
+
* ----------------------------------------------------------------------------- */
|
11
|
+
|
12
|
+
/*
|
13
|
+
This file provides the frontend to the Unified Typemap Library.
|
14
|
+
|
15
|
+
When using this library in a SWIG target language, you need to
|
16
|
+
define a minimum set of fragments, specialize a couple of macros,
|
17
|
+
and then include this file.
|
18
|
+
|
19
|
+
Typically you will create a 'mytypemaps.swg' file in each target
|
20
|
+
language, where you will have the following sections:
|
21
|
+
|
22
|
+
=== mytypemaps.swg ===
|
23
|
+
|
24
|
+
// Fragment section
|
25
|
+
%include <typemaps/fragments.swg>
|
26
|
+
<include target language fragments>
|
27
|
+
|
28
|
+
// Unified typemap section
|
29
|
+
<specialized the typemap library macros>
|
30
|
+
%include <typemaps/swigtypemaps.swg>
|
31
|
+
|
32
|
+
// Local typemap section
|
33
|
+
<add/replace extra target language typemaps>
|
34
|
+
|
35
|
+
=== mytypemaps.swg ===
|
36
|
+
|
37
|
+
While we add more docs, please take a look at the following cases
|
38
|
+
to see how you specialized the unified typemap library for a new
|
39
|
+
target language:
|
40
|
+
|
41
|
+
Lib/python/pytypemaps.swg
|
42
|
+
Lib/tcl/tcltypemaps.swg
|
43
|
+
Lib/ruby/rubytypemaps.swg
|
44
|
+
Lib/perl5/perltypemaps.swg
|
45
|
+
|
46
|
+
*/
|
47
|
+
|
48
|
+
#define SWIGUTL SWIGUTL
|
49
|
+
|
50
|
+
/* -----------------------------------------------------------------------------
|
51
|
+
* Language specialization section.
|
52
|
+
*
|
53
|
+
* Tune these macros for each language as needed.
|
54
|
+
* ----------------------------------------------------------------------------- */
|
55
|
+
|
56
|
+
/*
|
57
|
+
The SWIG target language object must be provided.
|
58
|
+
For example in python you define:
|
59
|
+
|
60
|
+
#define SWIG_Object PyObject *
|
61
|
+
*/
|
62
|
+
|
63
|
+
#if !defined(SWIG_Object)
|
64
|
+
#error "SWIG_Object must be defined as the SWIG target language object"
|
65
|
+
#endif
|
66
|
+
|
67
|
+
/*==== flags for new/convert methods ====*/
|
68
|
+
|
69
|
+
|
70
|
+
#ifndef %convertptr_flags
|
71
|
+
%define %convertptr_flags 0 %enddef
|
72
|
+
#endif
|
73
|
+
|
74
|
+
#ifndef %newpointer_flags
|
75
|
+
%define %newpointer_flags 0 %enddef
|
76
|
+
#endif
|
77
|
+
|
78
|
+
#ifndef %newinstance_flags
|
79
|
+
%define %newinstance_flags 0 %enddef
|
80
|
+
#endif
|
81
|
+
|
82
|
+
/*==== set output ====*/
|
83
|
+
|
84
|
+
#ifndef %set_output
|
85
|
+
/* simple set output operation */
|
86
|
+
#define %set_output(obj) $result = obj
|
87
|
+
#endif
|
88
|
+
|
89
|
+
/*==== set variable output ====*/
|
90
|
+
|
91
|
+
#ifndef %set_varoutput
|
92
|
+
/* simple set varoutput operation */
|
93
|
+
#define %set_varoutput(obj) $result = obj
|
94
|
+
#endif
|
95
|
+
|
96
|
+
/*==== append output ====*/
|
97
|
+
|
98
|
+
#ifndef %append_output
|
99
|
+
#if defined(SWIG_AppendOutput)
|
100
|
+
/* simple append operation */
|
101
|
+
#define %append_output(obj) $result = SWIG_AppendOutput($result,obj)
|
102
|
+
#else
|
103
|
+
#error "Language must define SWIG_AppendOutput or %append_output"
|
104
|
+
#endif
|
105
|
+
#endif
|
106
|
+
|
107
|
+
/*==== set constant ====*/
|
108
|
+
|
109
|
+
#ifndef %set_constant
|
110
|
+
#if defined(SWIG_SetConstant)
|
111
|
+
/* simple set constant operation */
|
112
|
+
#define %set_constant(name,value) SWIG_SetConstant(name,value)
|
113
|
+
#else
|
114
|
+
#error "Language must define SWIG_SetConstant or %set_constant"
|
115
|
+
#endif
|
116
|
+
#endif
|
117
|
+
|
118
|
+
/*==== raise an exception ====*/
|
119
|
+
|
120
|
+
#ifndef %raise
|
121
|
+
#if defined(SWIG_Raise)
|
122
|
+
/* simple raise operation */
|
123
|
+
#define %raise(obj, type, desc) SWIG_Raise(obj, type, desc); SWIG_fail
|
124
|
+
#else
|
125
|
+
#error "Language must define SWIG_Raise or %raise"
|
126
|
+
#endif
|
127
|
+
#endif
|
128
|
+
|
129
|
+
/*==== director output exception ====*/
|
130
|
+
|
131
|
+
/* wxRuby : make sure to pass the object and method that caused the failure */
|
132
|
+
#if defined(SWIG_DIRECTOR_TYPEMAPS)
|
133
|
+
#ifndef SWIG_DirOutFail
|
134
|
+
#define SWIG_DirOutFail(self, method, code, msg) Swig::DirectorTypeMismatchException::raise(self, method, SWIG_ErrorType(code), msg)
|
135
|
+
#endif
|
136
|
+
#endif
|
137
|
+
|
138
|
+
|
139
|
+
/* -----------------------------------------------------------------------------
|
140
|
+
* Language independent definitions
|
141
|
+
* ----------------------------------------------------------------------------- */
|
142
|
+
|
143
|
+
#define %error_block(Block...) %block(Block)
|
144
|
+
#define %default_code(code) SWIG_ArgError(code)
|
145
|
+
#define %argument_fail(code, type, name, argn) SWIG_exception_fail(%default_code(code), %argfail_fmt(type, name, argn))
|
146
|
+
#define %argument_nullref(type, name, argn) SWIG_exception_fail(SWIG_ValueError, %argnullref_fmt(type, name, argn))
|
147
|
+
#define %variable_fail(code, type, name) SWIG_exception_fail(%default_code(code), %varfail_fmt(type, name))
|
148
|
+
#define %variable_nullref(type, name) SWIG_exception_fail(SWIG_ValueError, %varnullref_fmt(type, name))
|
149
|
+
#define %releasenotowned_fail(code, type, name, argn) SWIG_exception_fail(%default_code(code), %releasenotownedfail_fmt(type, name, argn))
|
150
|
+
|
151
|
+
/* wxRuby : make sure to pass the object and method that caused the failure */
|
152
|
+
#if defined(SWIG_DIRECTOR_TYPEMAPS)
|
153
|
+
#define %dirout_fail(code, type) SWIG_DirOutFail(swig_get_self(), "$symname", %default_code(code), %outfail_fmt(type))
|
154
|
+
#define %dirout_nullref(type) SWIG_DirOutFail(swig_get_self(), "$symname", SWIG_ValueError, %outnullref_fmt(type))
|
155
|
+
#endif
|
156
|
+
|
157
|
+
/* -----------------------------------------------------------------------------
|
158
|
+
* All the typemaps
|
159
|
+
* ----------------------------------------------------------------------------- */
|
160
|
+
|
161
|
+
|
162
|
+
%include <typemaps/fragments.swg>
|
163
|
+
%include <typemaps/exception.swg>
|
164
|
+
%include <typemaps/swigtype.swg>
|
165
|
+
%include <typemaps/void.swg>
|
166
|
+
%include <typemaps/swigobject.swg>
|
167
|
+
%include <typemaps/valtypes.swg>
|
168
|
+
%include <typemaps/ptrtypes.swg>
|
169
|
+
%include <typemaps/inoutlist.swg>
|
170
|
+
%include <typemaps/primtypes.swg>
|
171
|
+
%include <typemaps/string.swg>
|
172
|
+
%include <typemaps/misctypes.swg>
|
173
|
+
%include <typemaps/enumint.swg>
|
data/ext/wxruby3/swig/wx.i
CHANGED
@@ -35,11 +35,31 @@ WX_DECLARE_HASH_MAP(VALUE,
|
|
35
35
|
RbClassToSwigTypeHash);
|
36
36
|
RbClassToSwigTypeHash Global_Type_Map;
|
37
37
|
|
38
|
+
// Mapping of wxWidgets class names to Ruby classes
|
39
|
+
WX_DECLARE_STRING_HASH_MAP(VALUE,
|
40
|
+
WxClassnameToRbClassHash);
|
41
|
+
WxClassnameToRbClassHash Global_Class_Map;
|
42
|
+
|
43
|
+
// Record wxRuby class for a wxw class name
|
44
|
+
WXRUBY_EXPORT void wxRuby_SetRbClassForWxName(const wxString& wx_name, VALUE cls)
|
45
|
+
{
|
46
|
+
Global_Class_Map[wx_name] = cls;
|
47
|
+
}
|
48
|
+
|
49
|
+
// Retrieve wxRuby class for a wxw class name
|
50
|
+
WXRUBY_EXPORT VALUE wxRuby_GetRbClassForWxName(const wxString& wx_name)
|
51
|
+
{
|
52
|
+
return Global_Class_Map[wx_name];
|
53
|
+
}
|
54
|
+
|
38
55
|
// Record swig_type_info for a wxRuby class; called in class
|
39
56
|
// initialisation
|
40
57
|
WXRUBY_EXPORT void wxRuby_SetSwigTypeForClass(VALUE cls, swig_type_info* ty)
|
41
58
|
{
|
42
59
|
Global_Type_Map[cls] = ty;
|
60
|
+
const char* swig_type_name = ty->name;
|
61
|
+
// skip '_p_' prefix and register class
|
62
|
+
wxRuby_SetRbClassForWxName(wxString(swig_type_name+3), cls);
|
43
63
|
}
|
44
64
|
|
45
65
|
// Retrieve swig_type_info for a ruby class - needed by functions which
|
@@ -141,41 +161,41 @@ WXRUBY_EXPORT VALUE wxRuby_WrapWxObjectInRuby(wxObject *wx_obj)
|
|
141
161
|
|
142
162
|
// Get the wx class and the ruby class we are converting into
|
143
163
|
wxString class_name( wx_obj->GetClassInfo()->GetClassName() );
|
144
|
-
|
145
|
-
VALUE r_class_name = rb_intern(wx_classname.data () + 2);
|
146
|
-
VALUE r_class = Qnil;
|
147
|
-
|
148
|
-
if ( class_name.Len() > 2 )
|
149
|
-
{
|
150
|
-
// lookup the class in the main module and any package submodules loaded
|
151
|
-
if (rb_const_defined(mWxCore, r_class_name))
|
152
|
-
r_class = rb_const_get(mWxCore, r_class_name);
|
153
|
-
else
|
154
|
-
{
|
155
|
-
VALUE submod_ary = rb_ivar_get(mWxCore, rb_intern("@__pkgmods__"));
|
156
|
-
for (long n=0; n<RARRAY_LEN(submod_ary); ++n)
|
157
|
-
{
|
158
|
-
VALUE submod = rb_ary_entry(submod_ary, n);
|
159
|
-
if (rb_const_defined(submod, r_class_name))
|
160
|
-
{
|
161
|
-
r_class = rb_const_get(submod, r_class_name);
|
162
|
-
break;
|
163
|
-
}
|
164
|
-
}
|
165
|
-
}
|
166
|
-
}
|
164
|
+
VALUE r_class = wxRuby_GetRbClassForWxName(class_name);
|
167
165
|
|
168
166
|
// Handle classes (currently) unknown in wxRuby.
|
169
167
|
// (could cause problems because class-specific methods won't be accessible).
|
170
|
-
if (
|
168
|
+
if (r_class == 0 || NIL_P(r_class))
|
171
169
|
{
|
172
|
-
// map unknown wxWindow derivatives as
|
170
|
+
// map unknown wxWindow derivatives as a mapped base class
|
171
|
+
// this solves issues with explicitly defined wxRuby custom
|
172
|
+
// DECLARE_DYNAMIC_CLASS classes like WxRubyTreeCtrl
|
173
173
|
if (wxIsKindOf(wx_obj, wxWindow))
|
174
174
|
{
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
175
|
+
wxClassInfo* cls_info = wx_obj->GetClassInfo();
|
176
|
+
do
|
177
|
+
{
|
178
|
+
wxString base_name(wx_obj->GetClassInfo()->GetBaseClassName1());
|
179
|
+
r_class = wxRuby_GetRbClassForWxName(base_name);
|
180
|
+
if (r_class == 0 || NIL_P(r_class))
|
181
|
+
{
|
182
|
+
cls_info = wxClassInfo::FindClass(base_name);
|
183
|
+
if (!cls_info)
|
184
|
+
{
|
185
|
+
// map to basic Wx::Window
|
186
|
+
r_class = rb_const_get(mWxCore, window_id());
|
187
|
+
// issue warning if $VERBOSE is true
|
188
|
+
rb_warning("Cannot wrap exact window class as '%s' is not (yet) known in wxRuby; wrapping as base Wx::Window object.",
|
189
|
+
(const char *)class_name.mb_str());
|
190
|
+
}
|
191
|
+
}
|
192
|
+
else
|
193
|
+
{
|
194
|
+
// issue warning if $VERBOSE is true
|
195
|
+
rb_warning("Cannot wrap exact window class as '%s' is not (yet) known in wxRuby; wrapping as %s object.",
|
196
|
+
(const char *)class_name.mb_str(), rb_class2name(r_class));
|
197
|
+
}
|
198
|
+
} while (r_class == 0 || NIL_P(r_class));
|
179
199
|
}
|
180
200
|
else
|
181
201
|
{
|
@@ -188,7 +208,7 @@ WXRUBY_EXPORT VALUE wxRuby_WrapWxObjectInRuby(wxObject *wx_obj)
|
|
188
208
|
// Otherwise, retrieve the swig type info for this class and wrap it
|
189
209
|
// in Ruby. wxRuby_GetSwigTypeForClass is defined in wx.i
|
190
210
|
swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(r_class);
|
191
|
-
VALUE r_obj = SWIG_NewPointerObj(wx_obj, swig_type,
|
211
|
+
VALUE r_obj = SWIG_NewPointerObj(wx_obj, swig_type, 0);
|
192
212
|
return r_obj;
|
193
213
|
}
|
194
214
|
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
|
5
|
+
|
6
|
+
module Wx
|
7
|
+
|
8
|
+
=begin
|
9
|
+
These constants are not documented in the wxWidgets interface headers
|
10
|
+
although they are referenced in various argument defaults which *are*
|
11
|
+
in the interface header declarations so.
|
12
|
+
=end
|
13
|
+
|
14
|
+
DEFAULT_DATE_TIME_FORMAT = '%c'
|
15
|
+
DEFAULT_TIME_SPAN_FORMAT = '%H:%M:%S'
|
16
|
+
|
17
|
+
CHOICE_NAME_STR = 'choice'
|
18
|
+
COLOUR_PICKER_CTRL_NAME_STR = 'colourpicker'
|
19
|
+
COLOUR_PICKER_WIDGET_NAME_STR = 'colourpickerwidget'
|
20
|
+
HYPERLINK_CTRL_NAME_STR = 'hyperlink'
|
21
|
+
PANEL_NAME_STR = 'panel'
|
22
|
+
LIST_BOX_NAME_STR = 'listBox'
|
23
|
+
FRAME_NAME_STR = 'frame'
|
24
|
+
STATUS_LINE_NAME_STR = 'status_line'
|
25
|
+
STATIC_BITMAP_NAME_STR = 'staticBitmap'
|
26
|
+
WEB_VIEW_NAME_STR = 'wxWebView'
|
27
|
+
ANIMATION_CTRL_NAME_STR = 'animationctrl'
|
28
|
+
TOOL_BAR_NAME_STR = 'toolbar'
|
29
|
+
TEXT_CTRL_NAME_STR = 'text'
|
30
|
+
LIST_CTRL_NAME_STR = 'listCtrl'
|
31
|
+
FILE_PICKER_CTRL_NAME_STR = 'filepicker'
|
32
|
+
FILE_PICKER_WIDGET_NAME_STR = 'filepickerwidget'
|
33
|
+
DIR_PICKER_CTRL_NAME_STR = 'dirpicker'
|
34
|
+
DIR_PICKER_WIDGET_NAME_STR = 'dirpickerwidget'
|
35
|
+
FILE_CTRL_NAME_STR = 'wxfilectrl'
|
36
|
+
FILE_SELECTOR_PROMPT_STR = 'Select a file'
|
37
|
+
STATIC_BOX_NAME_STR = 'groupBox'
|
38
|
+
BUTTON_NAME_STR = 'button'
|
39
|
+
RADIO_BOX_NAME_STR = 'radioBox'
|
40
|
+
STATIC_LINE_NAME_STR = 'staticLine'
|
41
|
+
RADIO_BUTTON_NAME_STR = 'radioButton'
|
42
|
+
BITMAP_RADIO_BUTTON_NAME_STR = 'radioButton'
|
43
|
+
GAUGE_NAME_STR = 'gauge'
|
44
|
+
DATA_VIEW_CTRL_NAME_STR = 'dataviewCtrl'
|
45
|
+
FONT_PICKER_CTRL_NAME_STR = 'fontpicker'
|
46
|
+
FONT_PICKER_WIDGET_NAME_STR = 'fontpickerwidget'
|
47
|
+
REARRANGE_LIST_NAME_STR = 'wxRearrangeList'
|
48
|
+
REARRANGE_DIALOG_NAME_STR = 'wxRearrangeDlg'
|
49
|
+
NOTEBOOK_NAME_STR = 'notebook'
|
50
|
+
CONTROL_NAME_STR = 'control'
|
51
|
+
SCROLL_BAR_NAME_STR = 'scrollBar'
|
52
|
+
STATUS_BAR_NAME_STR = 'statusBar'
|
53
|
+
SLIDER_NAME_STR = 'slider'
|
54
|
+
HEADER_CTRL_NAME_STR = 'wxHeaderCtrl'
|
55
|
+
BITMAP_COMBO_BOX_NAME_STR = 'bitmapComboBox'
|
56
|
+
CHECK_BOX_NAME_STR = 'check'
|
57
|
+
FILE_DIALOG_NAME_STR = 'filedlg'
|
58
|
+
ADD_REMOVE_CTRL_NAME_STR = 'wxAddRemoveCtrl'
|
59
|
+
STATIC_TEXT_NAME_STR = 'staticText'
|
60
|
+
COMBO_BOX_NAME_STR = 'comboBox'
|
61
|
+
SEARCH_CTRL_NAME_STR = 'searchCtrl'
|
62
|
+
TREE_CTRL_NAME_STR = 'treeCtrl'
|
63
|
+
DIALOG_NAME_STR = 'dialog'
|
64
|
+
COLLAPSIBLE_HEADER_CTRL_NAME_STR = 'collapsibleHeader'
|
65
|
+
COLLAPSIBLE_PANE_NAME_STR = 'collapsiblePane'
|
66
|
+
BANNER_WINDOW_NAME_STR = 'bannerwindow'
|
67
|
+
GRID_NAME_STR = 'grid'
|
68
|
+
TREE_LIST_CTRL_NAME_STR = 'wxTreeListCtrl'
|
69
|
+
HTML_LIST_BOX_NAME_STR = 'htmlListBox'
|
70
|
+
SIMPLE_HTML_LIST_BOX_NAME_STR = 'simpleHtmlListBox'
|
71
|
+
EDITABLE_LIST_BOX_NAME_STR = 'editableListBox'
|
72
|
+
V_LIST_BOX_NAME_STR = 'wxVListBox'
|
73
|
+
|
74
|
+
if Wx::PLATFORM == 'WXMSW'
|
75
|
+
# wxMSW only
|
76
|
+
MSW_HEADER_CTRL_NAME_STR = 'wxMSWHeaderCtrl'
|
77
|
+
end
|
78
|
+
|
79
|
+
PROPERTY_GRID_MANAGER_NAME_STR = 'wxPropertyGridManager'
|
80
|
+
PROPERTY_GRID_NAME_STR = 'wxPropertyGrid'
|
81
|
+
STC_NAME_STR = 'stcwindow'
|
82
|
+
|
83
|
+
end
|
data/lib/wx/doc/const.rb
CHANGED
@@ -11,74 +11,74 @@ module Wx
|
|
11
11
|
These constants are not documented in the wxWidgets interface headers
|
12
12
|
although they are referenced in various argument defaults which *are*
|
13
13
|
in the interface header declarations so we do want them included the
|
14
|
-
wxRuby docs so the doc links work
|
15
|
-
wxRuby implementation since these are internal to the C++ wrappers.
|
14
|
+
wxRuby docs so the doc links work.
|
16
15
|
=end
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
DEFAULT_DATE_TIME_FORMAT = '%c'
|
18
|
+
DEFAULT_TIME_SPAN_FORMAT = '%H:%M:%S'
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
20
|
+
CHOICE_NAME_STR = 'choice'
|
21
|
+
COLOUR_PICKER_CTRL_NAME_STR = 'colourpicker'
|
22
|
+
COLOUR_PICKER_WIDGET_NAME_STR = 'colourpickerwidget'
|
23
|
+
HYPERLINK_CTRL_NAME_STR = 'hyperlink'
|
24
|
+
PANEL_NAME_STR = 'panel'
|
25
|
+
LIST_BOX_NAME_STR = 'listBox'
|
26
|
+
FRAME_NAME_STR = 'frame'
|
27
|
+
STATUS_LINE_NAME_STR = 'status_line'
|
28
|
+
STATIC_BITMAP_NAME_STR = 'staticBitmap'
|
29
|
+
WEB_VIEW_NAME_STR = 'wxWebView'
|
30
|
+
ANIMATION_CTRL_NAME_STR = 'animationctrl'
|
31
|
+
TOOL_BAR_NAME_STR = 'toolbar'
|
32
|
+
TEXT_CTRL_NAME_STR = 'text'
|
33
|
+
LIST_CTRL_NAME_STR = 'listCtrl'
|
34
|
+
FILE_PICKER_CTRL_NAME_STR = 'filepicker'
|
35
|
+
FILE_PICKER_WIDGET_NAME_STR = 'filepickerwidget'
|
36
|
+
DIR_PICKER_CTRL_NAME_STR = 'dirpicker'
|
37
|
+
DIR_PICKER_WIDGET_NAME_STR = 'dirpickerwidget'
|
38
|
+
FILE_CTRL_NAME_STR = 'wxfilectrl'
|
39
|
+
FILE_SELECTOR_PROMPT_STR = 'Select a file'
|
40
|
+
STATIC_BOX_NAME_STR = 'groupBox'
|
41
|
+
BUTTON_NAME_STR = 'button'
|
42
|
+
RADIO_BOX_NAME_STR = 'radioBox'
|
43
|
+
STATIC_LINE_NAME_STR = 'staticLine'
|
44
|
+
RADIO_BUTTON_NAME_STR = 'radioButton'
|
45
|
+
BITMAP_RADIO_BUTTON_NAME_STR = 'radioButton'
|
46
|
+
GAUGE_NAME_STR = 'gauge'
|
47
|
+
DATA_VIEW_CTRL_NAME_STR = 'dataviewCtrl'
|
48
|
+
FONT_PICKER_CTRL_NAME_STR = 'fontpicker'
|
49
|
+
FONT_PICKER_WIDGET_NAME_STR = 'fontpickerwidget'
|
50
|
+
REARRANGE_LIST_NAME_STR = 'wxRearrangeList'
|
51
|
+
REARRANGE_DIALOG_NAME_STR = 'wxRearrangeDlg'
|
52
|
+
NOTEBOOK_NAME_STR = 'notebook'
|
53
|
+
CONTROL_NAME_STR = 'control'
|
54
|
+
SCROLL_BAR_NAME_STR = 'scrollBar'
|
55
|
+
STATUS_BAR_NAME_STR = 'statusBar'
|
56
|
+
SLIDER_NAME_STR = 'slider'
|
57
|
+
HEADER_CTRL_NAME_STR = 'wxHeaderCtrl'
|
58
|
+
BITMAP_COMBO_BOX_NAME_STR = 'bitmapComboBox'
|
59
|
+
CHECK_BOX_NAME_STR = 'check'
|
60
|
+
FILE_DIALOG_NAME_STR = 'filedlg'
|
61
|
+
ADD_REMOVE_CTRL_NAME_STR = 'wxAddRemoveCtrl'
|
62
|
+
STATIC_TEXT_NAME_STR = 'staticText'
|
63
|
+
COMBO_BOX_NAME_STR = 'comboBox'
|
64
|
+
SEARCH_CTRL_NAME_STR = 'searchCtrl'
|
65
|
+
TREE_CTRL_NAME_STR = 'treeCtrl'
|
66
|
+
DIALOG_NAME_STR = 'dialog'
|
67
|
+
COLLAPSIBLE_HEADER_CTRL_NAME_STR = 'collapsibleHeader'
|
68
|
+
COLLAPSIBLE_PANE_NAME_STR = 'collapsiblePane'
|
69
|
+
BANNER_WINDOW_NAME_STR = 'bannerwindow'
|
70
|
+
GRID_NAME_STR = 'grid'
|
71
|
+
TREE_LIST_CTRL_NAME_STR = 'wxTreeListCtrl'
|
72
|
+
HTML_LIST_BOX_NAME_STR = 'htmlListBox'
|
73
|
+
SIMPLE_HTML_LIST_BOX_NAME_STR = 'simpleHtmlListBox'
|
74
|
+
EDITABLE_LIST_BOX_NAME_STR = 'editableListBox'
|
75
|
+
V_LIST_BOX_NAME_STR = 'wxVListBox'
|
76
|
+
|
77
|
+
# wxMSW only
|
78
|
+
MSW_HEADER_CTRL_NAME_STR = 'wxMSWHeaderCtrl'
|
79
|
+
|
80
|
+
PROPERTY_GRID_MANAGER_NAME_STR = 'wxPropertyGridManager'
|
81
|
+
PROPERTY_GRID_NAME_STR = 'wxPropertyGrid'
|
82
|
+
STC_NAME_STR = 'stcwindow'
|
83
83
|
|
84
84
|
end
|
data/lib/wx/doc/event.rb
CHANGED
@@ -27,10 +27,4 @@ module Wx
|
|
27
27
|
|
28
28
|
end
|
29
29
|
|
30
|
-
# Find a window with the focus, that is also a descendant of the given window.
|
31
|
-
# This is used to determine the window to initially send commands to.
|
32
|
-
# @param [Wx::Window] ancestor
|
33
|
-
# @return [Wx::Window,nil] descendant window of ancestor with focus
|
34
|
-
def self.find_focus_descendant(ancestor) end
|
35
|
-
|
36
30
|
end
|
data/lib/wx/doc/functions.rb
CHANGED
@@ -190,21 +190,21 @@ module Wx
|
|
190
190
|
# # else: cancelled by user
|
191
191
|
# </code>
|
192
192
|
# @return [String] selected file name
|
193
|
-
def file_selector(message, default_path='', default_filename='', default_extension='', wildcard='',
|
193
|
+
def self.file_selector(message, default_path='', default_filename='', default_extension='', wildcard='',
|
194
194
|
flags=0, parent=nil, x=Wx::DEFAULT_COORD, y=Wx::DEFAULT_COORD) end
|
195
195
|
|
196
196
|
# An extended version of {Wx::file_selector}.
|
197
197
|
# @return [String] selected file name
|
198
|
-
def file_selector_ex(message='Select a file', default_path='', default_filename='', indexDefaultExtension=nil,
|
198
|
+
def self.file_selector_ex(message='Select a file', default_path='', default_filename='', indexDefaultExtension=nil,
|
199
199
|
wildcard='*', flags=0, parent=nil, x=Wx::DEFAULT_COORD, y=Wx::DEFAULT_COORD) end
|
200
200
|
|
201
201
|
# Shows a file dialog asking the user for a file name for saving a file.
|
202
202
|
# @see Wx::file_selector, Wx::FileDialog
|
203
|
-
def load_file_selector(what, extension, default_name='', parent=nil) end
|
203
|
+
def self.load_file_selector(what, extension, default_name='', parent=nil) end
|
204
204
|
|
205
205
|
# Shows a file dialog asking the user for a file name for opening a file.
|
206
206
|
# @see Wx::file_selector, Wx::FileDialog
|
207
|
-
def save_file_selector(what, extension, default_name='', parent=nil) end
|
207
|
+
def self.save_file_selector(what, extension, default_name='', parent=nil) end
|
208
208
|
|
209
209
|
# @!endgroup
|
210
210
|
|
@@ -213,14 +213,14 @@ module Wx
|
|
213
213
|
# Returns true if the ID is in the list of recognized stock actions
|
214
214
|
# @param [Integer] id ID to check
|
215
215
|
# @return [true,false]
|
216
|
-
def is_stock_id(id) end
|
216
|
+
def self.is_stock_id(id) end
|
217
217
|
|
218
218
|
# Returns true if the label is empty or label of a stock button with
|
219
219
|
# given ID
|
220
220
|
# @param [Integer] id ID to check
|
221
221
|
# @param [String] label to check
|
222
222
|
# @return [true,false]
|
223
|
-
def is_stock_label(id, label) end
|
223
|
+
def self.is_stock_label(id, label) end
|
224
224
|
|
225
225
|
STOCK_NOFLAGS = 0
|
226
226
|
|
@@ -236,13 +236,13 @@ module Wx
|
|
236
236
|
# @param [Integer] id Given id of the wxMenuItem, wxButton, wxToolBar tool, etc.
|
237
237
|
# @param [Integer] flags Combination of the elements of STOCK_xxx flags.
|
238
238
|
# @return [String]
|
239
|
-
def get_stock_label(id, flags = Wx::STOCK_WITH_MNEMONIC) end
|
239
|
+
def self.get_stock_label(id, flags = Wx::STOCK_WITH_MNEMONIC) end
|
240
240
|
|
241
241
|
# Returns the accelerator that should be used for given stock UI element
|
242
242
|
# (e.g. "Ctrl+X" for Wx::ID_CUT)
|
243
243
|
# @param [Integer] id stock UI element ID
|
244
244
|
# @return [Wx::AcceleratorEntry]
|
245
|
-
def get_stock_accelerator(id) end
|
245
|
+
def self.get_stock_accelerator(id) end
|
246
246
|
|
247
247
|
STOCK_MENU = 0
|
248
248
|
|
@@ -250,7 +250,7 @@ module Wx
|
|
250
250
|
# @param [Integer] id stock UI element ID
|
251
251
|
# @param [Integer] client context (currently only STOCK_MENU)
|
252
252
|
# @return [String]
|
253
|
-
def get_stock_help_string(id, client = Wx::STOCK_MENU) end
|
253
|
+
def self.get_stock_help_string(id, client = Wx::STOCK_MENU) end
|
254
254
|
|
255
255
|
# @!endgroup
|
256
256
|
|
data/lib/wx/doc/window.rb
CHANGED
@@ -48,4 +48,9 @@ class Wx::Window
|
|
48
48
|
# @return [Wx::Window]
|
49
49
|
def find_window_by_name(name) end
|
50
50
|
|
51
|
+
# Switches the current sizer with the given sizer and detaches and returns the 'old' sizer.
|
52
|
+
# @param [Wx::Sizer] new_sizer new sizer for window
|
53
|
+
# @return [Wx::Sizer] previous window sizer
|
54
|
+
def switch_sizer(new_sizer) end
|
55
|
+
|
51
56
|
end
|
data/lib/wx/keyword_defs.rb
CHANGED
@@ -349,8 +349,6 @@ Wx::define_keyword_ctors(Wx::ComboCtrl) do
|
|
349
349
|
wx_ctor_params :validator, :name => 'comboCtrl'
|
350
350
|
end
|
351
351
|
|
352
|
-
# wxDatePickerCtrl Small date picker control
|
353
|
-
|
354
352
|
# wxGauge A control to represent a varying quantity, such as time
|
355
353
|
# remaining
|
356
354
|
Wx::define_keyword_ctors(Wx::Gauge) do
|
@@ -514,8 +512,50 @@ Wx::define_keyword_ctors(Wx::VListBox) do
|
|
514
512
|
wx_ctor_params :id, :pos, :size, :style, :name => 'VListBoxNameStr'
|
515
513
|
end
|
516
514
|
|
515
|
+
# wxDatePickerCtrl Small date picker control
|
517
516
|
Wx::define_keyword_ctors(Wx::DatePickerCtrl) do
|
518
|
-
wx_ctor_params :id, :dt, :pos, :size, :style
|
517
|
+
wx_ctor_params :id, :dt, :pos, :size, :style => Wx::DP_DEFAULT|Wx::DP_SHOWCENTURY
|
518
|
+
wx_ctor_params :validator, :name => 'datePickerCtrl'
|
519
|
+
end
|
520
|
+
|
521
|
+
Wx::define_keyword_ctors(Wx::TimePickerCtrl) do
|
522
|
+
wx_ctor_params :id, :dt, :pos, :size, :style => Wx::TP_DEFAULT
|
523
|
+
wx_ctor_params :validator, :name => 'timePickerCtrl'
|
524
|
+
end
|
525
|
+
|
526
|
+
Wx::define_keyword_ctors(Wx::ColourPickerCtrl) do
|
527
|
+
wx_ctor_params :id, :colour => :BLACK
|
528
|
+
wx_ctor_params :pos, :size, :style => Wx::CLRP_DEFAULT_STYLE
|
529
|
+
wx_ctor_params :validator, :name => 'colourPickerCtrl'
|
530
|
+
end
|
531
|
+
|
532
|
+
Wx::define_keyword_ctors(Wx::FontPickerCtrl) do
|
533
|
+
wx_ctor_params :id, :font => Wx::NULL_FONT
|
534
|
+
wx_ctor_params :pos, :size, :style => Wx::FNTP_DEFAULT_STYLE
|
535
|
+
wx_ctor_params :validator, :name => 'fontPickerCtrl'
|
536
|
+
end
|
537
|
+
|
538
|
+
Wx::define_keyword_ctors(Wx::FilePickerCtrl) do
|
539
|
+
wx_ctor_params :id, :path => ''
|
540
|
+
wx_ctor_params :message => Wx::FILE_SELECTOR_PROMPT_STR
|
541
|
+
wx_ctor_params :wildcard => Wx::FILE_SELECTOR_DEFAULT_WILDCARD_STR
|
542
|
+
wx_ctor_params :pos, :size, :style => Wx::FLP_DEFAULT_STYLE
|
543
|
+
wx_ctor_params :validator, :name => 'filePickerCtrl'
|
544
|
+
end
|
545
|
+
|
546
|
+
Wx::define_keyword_ctors(Wx::DirPickerCtrl) do
|
547
|
+
wx_ctor_params :id, :path => ''
|
548
|
+
wx_ctor_params :message => Wx::DIR_SELECTOR_PROMPT_STR
|
549
|
+
wx_ctor_params :pos, :size, :style => Wx::DIRP_DEFAULT_STYLE
|
550
|
+
wx_ctor_params :validator, :name => 'dirPickerCtrl'
|
551
|
+
end
|
552
|
+
|
553
|
+
Wx::define_keyword_ctors(Wx::FileCtrl) do
|
554
|
+
wx_ctor_params :id, :defaultDirectory => ''
|
555
|
+
wx_ctor_params :defaultFilename => ''
|
556
|
+
wx_ctor_params :wildcard => Wx::FILE_SELECTOR_DEFAULT_WILDCARD_STR
|
557
|
+
wx_ctor_params :style => Wx::FC_DEFAULT_STYLE
|
558
|
+
wx_ctor_params :pos, :size, :name => 'fileCtrl'
|
519
559
|
end
|
520
560
|
|
521
561
|
Wx::define_keyword_ctors(Wx::ActivityIndicator) do
|
@@ -542,6 +582,3 @@ Wx::define_keyword_ctors(Wx::RearrangeCtrl) do
|
|
542
582
|
wx_ctor_params :id, :pos, :size, :order, :items, :style
|
543
583
|
wx_ctor_params :validator, :name => 'rearrangeCtrl'
|
544
584
|
end
|
545
|
-
|
546
|
-
# FIXME - SymbolPickerDialog is hard to because the parent argument is
|
547
|
-
# in a strange place.
|
data/lib/wx/version.rb
CHANGED