wxruby3 1.3.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +16 -12
- data/README.md +4 -3
- data/ext/wxruby3/include/wxRubyApp.h +9 -9
- data/ext/wxruby3/swig/mark_free_impl.i +47 -11
- data/ext/wxruby3/swig/wx.i +30 -12
- data/lib/wx/aui/auifloatframe.rb +1 -1
- data/lib/wx/aui/auimanager.rb +5 -16
- data/lib/wx/aui/auinotebook.rb +1 -1
- data/lib/wx/aui/require.rb +0 -2
- data/lib/wx/core/acceleratortable.rb +1 -1
- data/lib/wx/core/animation.rb +2 -2
- data/lib/wx/core/app.rb +1 -1
- data/lib/wx/core/artprovider.rb +4 -4
- data/lib/wx/core/bitmap.rb +1 -1
- data/lib/wx/core/bitmap_combobox.rb +2 -2
- data/lib/wx/core/clientdc.rb +1 -1
- data/lib/wx/core/clipboard.rb +4 -4
- data/lib/wx/core/colour.rb +1 -1
- data/lib/wx/core/combobox.rb +1 -1
- data/lib/wx/core/config.rb +7 -7
- data/lib/wx/core/controlwithitems.rb +3 -3
- data/lib/wx/core/data_object.rb +4 -4
- data/lib/wx/core/dataformat.rb +9 -3
- data/lib/wx/core/dialog.rb +3 -2
- data/lib/wx/core/event.rb +3 -3
- data/lib/wx/core/evthandler.rb +317 -289
- data/lib/wx/core/file_dialog.rb +1 -1
- data/lib/wx/core/find_replace_dialog.rb +2 -2
- data/lib/wx/core/functions.rb +1 -1
- data/lib/wx/core/genericdirctrl.rb +1 -1
- data/lib/wx/core/geometry.rb +2 -2
- data/lib/wx/core/graphics_pen_info.rb +1 -1
- data/lib/wx/core/helpprovider.rb +1 -1
- data/lib/wx/core/icon.rb +1 -1
- data/lib/wx/core/image.rb +2 -2
- data/lib/wx/core/imagelist.rb +1 -1
- data/lib/wx/core/locale.rb +5 -5
- data/lib/wx/core/log.rb +8 -8
- data/lib/wx/core/menu.rb +3 -3
- data/lib/wx/core/module_ext.rb +16 -0
- data/lib/wx/core/owner_drawn_combobox.rb +3 -3
- data/lib/wx/core/pen_info.rb +1 -1
- data/lib/wx/core/persistence_manager.rb +2 -2
- data/lib/wx/core/rect.rb +1 -1
- data/lib/wx/core/secret_store.rb +1 -1
- data/lib/wx/core/simplehelpprovider.rb +1 -1
- data/lib/wx/core/sizer.rb +8 -8
- data/lib/wx/core/splash_screen.rb +1 -1
- data/lib/wx/core/standard_paths.rb +1 -1
- data/lib/wx/core/task_bar_button.rb +1 -1
- data/lib/wx/core/text_entry.rb +1 -1
- data/lib/wx/core/textctrl.rb +2 -2
- data/lib/wx/core/timer.rb +2 -2
- data/lib/wx/core/tree_ctrl.rb +1 -1
- data/lib/wx/core/v_list_box.rb +1 -1
- data/lib/wx/core/validator.rb +2 -2
- data/lib/wx/core/variant.rb +2 -2
- data/lib/wx/core/window.rb +48 -2
- data/lib/wx/core/xmlresource.rb +4 -4
- data/lib/wx/core.rb +2 -0
- data/lib/wx/doc/evthandler.rb +1 -0
- data/lib/wx/doc/tip_window.rb +22 -0
- data/lib/wx/grid/grid.rb +3 -3
- data/lib/wx/grid/require.rb +0 -2
- data/lib/wx/html/htmlhelpcontroller.rb +1 -1
- data/lib/wx/html/htmlwindow.rb +1 -1
- data/lib/wx/html/require.rb +0 -2
- data/lib/wx/html/simple_html_listbox.rb +3 -3
- data/lib/wx/keyword_ctors.rb +14 -7
- data/lib/wx/keyword_defs.rb +7 -7
- data/lib/wx/pg/pg_properties.rb +1 -1
- data/lib/wx/pg/pg_property.rb +3 -3
- data/lib/wx/pg/property_grid.rb +2 -2
- data/lib/wx/pg/property_grid_interface.rb +2 -2
- data/lib/wx/pg/require.rb +0 -2
- data/lib/wx/prt/previewframe.rb +1 -1
- data/lib/wx/prt/require.rb +0 -2
- data/lib/wx/rbn/ribbon_control.rb +1 -1
- data/lib/wx/rbn/ribbon_page.rb +1 -1
- data/lib/wx/rbn/ribbon_panel.rb +1 -1
- data/lib/wx/rtc/require.rb +0 -2
- data/lib/wx/rtc/rich_text_composite_object.rb +1 -1
- data/lib/wx/rtc/rich_text_ctrl.rb +1 -1
- data/lib/wx/rtc/rich_text_paragraph.rb +1 -1
- data/lib/wx/rtc/richtext_buffer.rb +3 -3
- data/lib/wx/rtc/richtext_formatting_dialog.rb +2 -2
- data/lib/wx/rtc/richtext_style_organiser_dialog.rb +1 -1
- data/lib/wx/rtc/symbol_picker_dialog.rb +1 -1
- data/lib/wx/stc/require.rb +0 -2
- data/lib/wx/stc/styled_text_ctrl.rb +1 -1
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/base.rb +8 -2
- data/lib/wx/wxruby/cmd/setup.rb +61 -37
- data/rakelib/gem.rb +8 -4
- data/rakelib/lib/config/mingw.rb +1 -1
- data/rakelib/lib/director/about_dialog_info.rb +1 -0
- data/rakelib/lib/director/aui_manager.rb +63 -57
- data/rakelib/lib/director/aui_notebook.rb +7 -0
- data/rakelib/lib/director/colour.rb +1 -1
- data/rakelib/lib/director/data_format.rb +1 -1
- data/rakelib/lib/director/event.rb +1 -0
- data/rakelib/lib/director/event_handler.rb +82 -46
- data/rakelib/lib/director/functions.rb +0 -3
- data/rakelib/lib/director/list_ctrl.rb +14 -10
- data/rakelib/lib/director/locale.rb +2 -0
- data/rakelib/lib/director/num_validator.rb +7 -0
- data/rakelib/lib/director/tip_window.rb +34 -0
- data/rakelib/lib/director/window.rb +9 -1
- data/rakelib/lib/director.rb +0 -1
- data/rakelib/lib/generate/doc/evt_handler.yaml +31 -12
- data/rakelib/lib/specs/interfaces.rb +1 -0
- data/tests/test_combo_ctrl.rb +1 -0
- data/tests/test_event_handling.rb +158 -31
- metadata +6 -5
data/lib/wx/core.rb
CHANGED
@@ -38,6 +38,8 @@ require 'wx/global_const'
|
|
38
38
|
# ctor syntax sweeteners support
|
39
39
|
require 'wx/keyword_ctors'
|
40
40
|
|
41
|
+
require 'wx/core/module_ext'
|
42
|
+
|
41
43
|
# Load in all the class extension methods written in ruby
|
42
44
|
# evthandler must be required first b/c it sets up methods modified elsewhere
|
43
45
|
require 'wx/core/evthandler.rb'
|
data/lib/wx/doc/evthandler.rb
CHANGED
@@ -143,6 +143,7 @@ module Wx
|
|
143
143
|
def call_after(meth = nil, *args, &block) end
|
144
144
|
|
145
145
|
# Process a {Wx::EVT_HOTKEY} event.
|
146
|
+
# @wxrb_require WXOSX|WXMSW
|
146
147
|
# @param [Integer] id hotkey id
|
147
148
|
# @param [String,Symbol,Method,Proc] meth (name of) method or handler proc
|
148
149
|
# @yieldparam [Wx::KeyEvent] event the event to handle
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# :stopdoc:
|
2
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
3
|
+
#
|
4
|
+
# This software is released under the MIT license.
|
5
|
+
# :startdoc:
|
6
|
+
|
7
|
+
|
8
|
+
module Wx
|
9
|
+
|
10
|
+
class TipWindow < Wx::Window
|
11
|
+
|
12
|
+
# Constructor.
|
13
|
+
#
|
14
|
+
# The tip is shown immediately after the window is constructed.
|
15
|
+
# @param [Wx::Window] parent The parent window, must be non-nil
|
16
|
+
# @param [String] text The text to show, may contain the new line characters
|
17
|
+
# @param [Integer] max_length The length of each line, in pixels. Set to a very large value to avoid wrapping lines.
|
18
|
+
def initialize(parent, text, max_length = 100); end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/wx/grid/grid.rb
CHANGED
@@ -13,7 +13,7 @@ module Wx
|
|
13
13
|
alias :table= :assign_table
|
14
14
|
|
15
15
|
wx_each_selected_block = instance_method :each_selected_block
|
16
|
-
|
16
|
+
wx_redefine_method :each_selected_block do
|
17
17
|
if block_given?
|
18
18
|
wx_each_selected_block.bind(self).call
|
19
19
|
else
|
@@ -27,7 +27,7 @@ module Wx
|
|
27
27
|
alias :selected_blocks :get_selected_blocks
|
28
28
|
|
29
29
|
wx_each_selected_row_block = instance_method :each_selected_row_block
|
30
|
-
|
30
|
+
wx_redefine_method :each_selected_row_block do
|
31
31
|
if block_given?
|
32
32
|
wx_each_selected_row_block.bind(self).call
|
33
33
|
else
|
@@ -36,7 +36,7 @@ module Wx
|
|
36
36
|
end
|
37
37
|
|
38
38
|
wx_each_selected_col_block = instance_method :each_selected_col_block
|
39
|
-
|
39
|
+
wx_redefine_method :each_selected_col_block do
|
40
40
|
if block_given?
|
41
41
|
wx_each_selected_col_block.bind(self).call
|
42
42
|
else
|
data/lib/wx/grid/require.rb
CHANGED
@@ -14,7 +14,7 @@ module Wx
|
|
14
14
|
|
15
15
|
# cache any explicitly assigned config for GC protection
|
16
16
|
wx_use_config = instance_method(:use_config)
|
17
|
-
|
17
|
+
wx_redefine_method :use_config do |cfg, *args|
|
18
18
|
@configuration = cfg
|
19
19
|
if get_help_window
|
20
20
|
# also set config var for any associated help window (as wxWidgets propagates it too)
|
data/lib/wx/html/htmlwindow.rb
CHANGED
data/lib/wx/html/require.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
6
6
|
|
7
7
|
# make sure to honor the inherited common overloads
|
8
8
|
wx_get_client_object = instance_method :get_client_object
|
9
|
-
|
9
|
+
wx_redefine_method :get_client_object do |*args|
|
10
10
|
if args.empty?
|
11
11
|
super()
|
12
12
|
else
|
@@ -14,7 +14,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
wx_set_client_object = instance_method :set_client_object
|
17
|
-
|
17
|
+
wx_redefine_method :set_client_object do |*args|
|
18
18
|
if args.size < 2
|
19
19
|
super(*args)
|
20
20
|
else
|
@@ -30,7 +30,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
30
30
|
|
31
31
|
# Overload to provide Enumerator without block
|
32
32
|
wx_each_string = instance_method :each_string
|
33
|
-
|
33
|
+
wx_redefine_method :each_string do |&block|
|
34
34
|
if block
|
35
35
|
wx_each_string.bind(self).call(&block)
|
36
36
|
else
|
data/lib/wx/keyword_ctors.rb
CHANGED
@@ -70,6 +70,13 @@ module Wx
|
|
70
70
|
# This module defines an inheritable class attribute like the ones defined
|
71
71
|
# by the Rails #class_attribute method.
|
72
72
|
module ParamSpec
|
73
|
+
|
74
|
+
if RUBY_VERSION < '2.7.0'
|
75
|
+
PARAM_SPEC_ARG = [:param_spec]
|
76
|
+
else
|
77
|
+
PARAM_SPEC_ARG = [:param_spec, false]
|
78
|
+
end
|
79
|
+
|
73
80
|
def self.included(mod)
|
74
81
|
mod.class_eval do
|
75
82
|
def self.param_spec
|
@@ -82,9 +89,9 @@ module Wx
|
|
82
89
|
|
83
90
|
def self.param_spec=(val)
|
84
91
|
singleton_class.class_eval do
|
85
|
-
if method_defined?(
|
92
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
86
93
|
begin
|
87
|
-
remove_method(:param_spec)
|
94
|
+
remove_method(:param_spec)
|
88
95
|
rescue NameError;
|
89
96
|
end
|
90
97
|
end
|
@@ -93,9 +100,9 @@ module Wx
|
|
93
100
|
|
94
101
|
if singleton_class?
|
95
102
|
class_eval do
|
96
|
-
if method_defined?(
|
103
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
97
104
|
begin
|
98
|
-
remove_method(:param_spec)
|
105
|
+
remove_method(:param_spec)
|
99
106
|
rescue NameError;
|
100
107
|
end
|
101
108
|
end
|
@@ -108,9 +115,9 @@ module Wx
|
|
108
115
|
val
|
109
116
|
end
|
110
117
|
|
111
|
-
if method_defined?(
|
118
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
112
119
|
begin
|
113
|
-
remove_method(:param_spec)
|
120
|
+
remove_method(:param_spec)
|
114
121
|
rescue NameError;
|
115
122
|
end
|
116
123
|
end
|
@@ -191,7 +198,7 @@ module Wx
|
|
191
198
|
# The new definition of initialize; accepts a parent arg
|
192
199
|
# mixed_args, which may zero or more position args, optionally
|
193
200
|
# terminated with hash keyword args, and an optional block
|
194
|
-
|
201
|
+
wx_redefine_method :initialize do |parent = :default_ctor, *mixed_args, &block|
|
195
202
|
# allow zero-args ctor for use with XRC
|
196
203
|
if parent == :default_ctor
|
197
204
|
pre_wx_kwctor_init
|
data/lib/wx/keyword_defs.rb
CHANGED
@@ -61,13 +61,13 @@ end
|
|
61
61
|
# MISCELLANEOUS WINDOWS
|
62
62
|
|
63
63
|
# OpenGL Canvas
|
64
|
-
Wx::define_keyword_ctors('GLCanvas') do
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
64
|
+
# Wx::define_keyword_ctors('GLCanvas') do
|
65
|
+
# wx_ctor_params :id
|
66
|
+
# wx_ctor_params :pos, :size, :style => Wx::FULL_REPAINT_ON_RESIZE
|
67
|
+
# wx_ctor_params :name => 'GLCanvas'
|
68
|
+
# wx_ctor_params :attrib_list => [Wx::GL_RGBA, Wx::GL_DOUBLEBUFFER]
|
69
|
+
# wx_ctor_params :palette => Wx::NULL_PALETTE
|
70
|
+
# end
|
71
71
|
|
72
72
|
# A window whose colour changes according to current user settings
|
73
73
|
Wx::define_keyword_ctors(Wx::Panel) do
|
data/lib/wx/pg/pg_properties.rb
CHANGED
@@ -10,7 +10,7 @@ module Wx::PG
|
|
10
10
|
|
11
11
|
# add some 'smart' conversions
|
12
12
|
wx_initialize = instance_method :initialize
|
13
|
-
|
13
|
+
wx_redefine_method :initialize do |label=Wx::PG_LABEL, name=Wx::PG_LABEL, value=Wx::PG::ColourPropertyValue.new|
|
14
14
|
value = case value
|
15
15
|
when Wx::Colour
|
16
16
|
Wx::PG::ColourPropertyValue.new(value)
|
data/lib/wx/pg/pg_property.rb
CHANGED
@@ -29,7 +29,7 @@ module Wx::PG
|
|
29
29
|
class PGProperty
|
30
30
|
|
31
31
|
wx_each_attribute = instance_method :each_attribute
|
32
|
-
|
32
|
+
wx_redefine_method :each_attribute do
|
33
33
|
if block_given?
|
34
34
|
wx_each_attribute.bind(self).call
|
35
35
|
else
|
@@ -52,7 +52,7 @@ module Wx::PG
|
|
52
52
|
class PGChoices
|
53
53
|
|
54
54
|
wx_each_label = instance_method :each_label
|
55
|
-
|
55
|
+
wx_redefine_method :each_label do
|
56
56
|
if block_given?
|
57
57
|
wx_each_label.bind(self).call
|
58
58
|
else
|
@@ -61,7 +61,7 @@ module Wx::PG
|
|
61
61
|
end
|
62
62
|
|
63
63
|
wx_each_entry = instance_method :each_entry
|
64
|
-
|
64
|
+
wx_redefine_method :each_entry do
|
65
65
|
if block_given?
|
66
66
|
wx_each_entry.bind(self).call
|
67
67
|
else
|
data/lib/wx/pg/property_grid.rb
CHANGED
@@ -29,7 +29,7 @@ module Wx::PG
|
|
29
29
|
private :property_editors
|
30
30
|
|
31
31
|
wx_do_register_editor_class = self.instance_method(:do_register_editor_class)
|
32
|
-
|
32
|
+
wx_redefine_method(:do_register_editor_class) do |editor_class, name|
|
33
33
|
editor = wx_do_register_editor_class.bind(self).call(editor_class, name)
|
34
34
|
property_editors[name] = editor # keep safe from GC and for lookup
|
35
35
|
end
|
@@ -44,7 +44,7 @@ module Wx::PG
|
|
44
44
|
end
|
45
45
|
|
46
46
|
wx_set_sorter = instance_method :set_sorter
|
47
|
-
|
47
|
+
wx_redefine_method :set_sorter do |meth, &block|
|
48
48
|
h_sorter = if block and not meth
|
49
49
|
block
|
50
50
|
elsif meth and not block
|
@@ -20,7 +20,7 @@ module Wx::PG
|
|
20
20
|
module PropertyGridInterface
|
21
21
|
|
22
22
|
wx_each_property = instance_method :each_property
|
23
|
-
|
23
|
+
wx_redefine_method :each_property do |flags = Wx::PG::PG_ITERATE_DEFAULT, start = nil, reverse: false, &block|
|
24
24
|
if block
|
25
25
|
wx_each_property.bind(self).call(flags.to_int, start, reverse, &block)
|
26
26
|
else
|
@@ -35,7 +35,7 @@ module Wx::PG
|
|
35
35
|
alias :properties_reversed :reverse_each_property
|
36
36
|
|
37
37
|
wx_each_property_attribute = instance_method :each_property_attribute
|
38
|
-
|
38
|
+
wx_redefine_method :each_property_attribute do |id, &block|
|
39
39
|
if block
|
40
40
|
wx_each_property_attribute.bind(self).call(id, &block)
|
41
41
|
else
|
data/lib/wx/pg/require.rb
CHANGED
data/lib/wx/prt/previewframe.rb
CHANGED
@@ -11,7 +11,7 @@ class Wx::PRT::PreviewFrame
|
|
11
11
|
# to assign it to an instance variable so it is marked correctly when
|
12
12
|
# the frame displaying it is marked.
|
13
13
|
wx_init = self.instance_method(:initialize)
|
14
|
-
|
14
|
+
wx_redefine_method(:initialize) do | *args |
|
15
15
|
wx_init.bind(self).call(*args)
|
16
16
|
@__preview = args[0]
|
17
17
|
end
|
data/lib/wx/prt/require.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonControl
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rbn/ribbon_page.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonPage
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rbn/ribbon_panel.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonPanel
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rtc/require.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RTC::RichTextBuffer
|
|
6
6
|
|
7
7
|
class << self
|
8
8
|
wx_each_handler = instance_method :each_handler
|
9
|
-
|
9
|
+
wx_redefine_method :each_handler do |&block|
|
10
10
|
if block_given?
|
11
11
|
wx_each_handler.bind(self).call(&block)
|
12
12
|
else
|
@@ -15,7 +15,7 @@ class Wx::RTC::RichTextBuffer
|
|
15
15
|
end
|
16
16
|
|
17
17
|
wx_each_field_type = instance_method :each_field_type
|
18
|
-
|
18
|
+
wx_redefine_method :each_field_type do |&block|
|
19
19
|
if block_given?
|
20
20
|
wx_each_field_type.bind(self).call(&block)
|
21
21
|
else
|
@@ -24,7 +24,7 @@ class Wx::RTC::RichTextBuffer
|
|
24
24
|
end
|
25
25
|
|
26
26
|
wx_each_drawing_handler = instance_method :each_drawing_handler
|
27
|
-
|
27
|
+
wx_redefine_method :each_drawing_handler do |&block|
|
28
28
|
if block_given?
|
29
29
|
wx_each_drawing_handler.bind(self).call(&block)
|
30
30
|
else
|
@@ -8,7 +8,7 @@ module Wx::RTC
|
|
8
8
|
class << self
|
9
9
|
|
10
10
|
wx_set_formatting_dialog_factory = instance_method :set_formatting_dialog_factory
|
11
|
-
|
11
|
+
wx_redefine_method :set_formatting_dialog_factory do |factory|
|
12
12
|
wx_set_formatting_dialog_factory.bind(self).call(factory)
|
13
13
|
@factory = factory # cache here to prevent GC collection
|
14
14
|
end
|
@@ -23,7 +23,7 @@ module Wx::RTC
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# now redefine the overridden ctor to account for deviating arglist
|
26
|
-
|
26
|
+
wx_redefine_method :initialize do |flags = nil, parent = nil, *mixed_args, &block|
|
27
27
|
# allow zero-args ctor for use with XRC
|
28
28
|
if flags.nil?
|
29
29
|
pre_wx_kwctor_init
|
@@ -12,7 +12,7 @@ class Wx::RTC::RichTextStyleOrganiserDialog
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# now redefine the overridden ctor to account for deviating arglist
|
15
|
-
|
15
|
+
wx_redefine_method :initialize do |flags, sheet, ctrl, parent = nil, *mixed_args, &block|
|
16
16
|
real_args = begin
|
17
17
|
[ flags, sheet, ctrl, parent ] + self.class.args_as_list(*mixed_args)
|
18
18
|
rescue => err
|
@@ -13,7 +13,7 @@ class Wx::RTC::SymbolPickerDialog
|
|
13
13
|
end
|
14
14
|
|
15
15
|
# now redefine the overridden ctor to account for deviating arglist
|
16
|
-
|
16
|
+
wx_redefine_method :initialize do |symbol, initialFont, normalTextFont, parent = nil, *mixed_args, &block|
|
17
17
|
real_args = begin
|
18
18
|
[ symbol, initialFont, normalTextFont, parent ] + self.class.args_as_list(*mixed_args)
|
19
19
|
rescue => err
|
data/lib/wx/stc/require.rb
CHANGED
data/lib/wx/version.rb
CHANGED
data/lib/wx/wxruby/base.rb
CHANGED
@@ -55,6 +55,10 @@ module WxRuby
|
|
55
55
|
puts
|
56
56
|
end
|
57
57
|
|
58
|
+
def show_version
|
59
|
+
system(%Q[#{RUBY} -r wx -e 'puts "wxRuby3 v\#{Wx::WXRUBY_VERSION} (wxWidgets v\#{Wx::WXWIDGETS_VERSION})"' 2> /dev/null])
|
60
|
+
end
|
61
|
+
|
58
62
|
def run(cmdid, args)
|
59
63
|
commands[cmdid.to_s].call(args)
|
60
64
|
end
|
@@ -65,9 +69,11 @@ module WxRuby
|
|
65
69
|
" COMMAND\t\t\t\tSpecifies wxruby command to execute."
|
66
70
|
opts.separator ''
|
67
71
|
opts.on('-v', '--verbose',
|
68
|
-
'Show verbose output') { |
|
72
|
+
'Show verbose output') { |_| ::WxRuby::Commands.options[:verbose] = true }
|
73
|
+
opts.on('-V', '--version',
|
74
|
+
'Show versions.') { |_| show_version } if setup_done?
|
69
75
|
opts.on('-h', '--help',
|
70
|
-
'Show this message.') do |
|
76
|
+
'Show this message.') do |_|
|
71
77
|
puts opts
|
72
78
|
puts
|
73
79
|
describe_all
|
data/lib/wx/wxruby/cmd/setup.rb
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
#--------------------------------------------------------------------
|
7
7
|
|
8
8
|
require 'fileutils'
|
9
|
+
require 'json'
|
9
10
|
|
10
11
|
module WxRuby
|
11
12
|
module Commands
|
@@ -55,6 +56,16 @@ module WxRuby
|
|
55
56
|
opts.parse!(args) rescue ($stderr.puts $!.message; exit(127))
|
56
57
|
end
|
57
58
|
|
59
|
+
class << self
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def check_wx_config
|
64
|
+
!(`which #{@wx_config} 2>/dev/null`).chomp.empty?
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
58
69
|
def self.run(argv)
|
59
70
|
return description if argv == :describe
|
60
71
|
|
@@ -74,48 +85,61 @@ module WxRuby
|
|
74
85
|
cfg_cmd = 'rake configure'
|
75
86
|
cfg_cmd << "[#{cfg_args.join(',')}]" unless cfg_args.empty?
|
76
87
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
steps = 1
|
82
|
-
'(possibly) install required software'
|
83
|
-
else
|
84
|
-
''
|
85
|
-
end
|
86
|
-
if Setup.options['with-wxwin'] || Setup.options['wxwin'].nil?
|
87
|
-
actions_txt << ', ' if steps>0
|
88
|
-
actions_txt << 'build the wxWidgets libraries (if needed), '
|
89
|
-
actions_txt << "\n" if steps>0
|
90
|
-
steps += 1
|
88
|
+
log_file = File.join(WxRuby::ROOT, 'setup.log')
|
89
|
+
if Setup.options['log']
|
90
|
+
if File.directory?(Setup.options['log']) && File.writable?(Setup.options['log'])
|
91
|
+
log_file = File.join(Setup.options['log'], 'setup.log')
|
91
92
|
else
|
92
|
-
|
93
|
+
$stderr.puts "ERROR: cannot write log to #{Setup.options['log']}. Log path must exist and be writable."
|
94
|
+
exit(1)
|
93
95
|
end
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
96
|
+
end
|
97
|
+
run_env = {'WXRUBY_RUN_SILENT' => "#{log_file}"}
|
98
|
+
run_env['WXRUBY_VERBOSE'] = '1' if Setup.options[:verbose]
|
99
|
+
|
100
|
+
result = false
|
101
|
+
|
102
|
+
FileUtils.chdir(WxRuby::ROOT) do
|
103
|
+
# first run the configure command
|
104
|
+
result = system(run_env, "#{cfg_cmd}")
|
105
|
+
|
106
|
+
# if succeeded
|
107
|
+
if result
|
108
|
+
# load the wxRuby3 build config
|
109
|
+
build_cfg = ::JSON.load(File.read('.wxconfig'))
|
110
|
+
|
111
|
+
# now determine the steps to execute
|
112
|
+
steps = 0
|
113
|
+
actions_txt = if Setup.options['autoinstall'] != false
|
114
|
+
steps = 1
|
115
|
+
'(possibly) install required software'
|
116
|
+
else
|
117
|
+
''
|
118
|
+
end
|
119
|
+
if build_cfg['with-wxwin'] || (!build_cfg['wxwin'].to_s.empty? && build_cfg['wxwin'].to_s != '@system')
|
120
|
+
actions_txt << ', ' if steps>0
|
121
|
+
actions_txt << 'build the wxWidgets libraries, '
|
122
|
+
actions_txt << "\n" if steps>0
|
123
|
+
steps += 1
|
110
124
|
else
|
111
|
-
|
112
|
-
exit(1)
|
125
|
+
actions_txt << ',' if steps>0
|
113
126
|
end
|
127
|
+
actions_txt << 'build the native wxRuby3 extensions '
|
128
|
+
actions_txt << "\n" if steps==1
|
129
|
+
actions_txt << 'and generate the wxRuby3 reference documentation.'
|
130
|
+
$stdout.puts <<~__INFO_TXT
|
131
|
+
|
132
|
+
---
|
133
|
+
Now running wxRuby3 post-install setup.
|
134
|
+
This will #{actions_txt}
|
135
|
+
Please be patient as this may take quite a while depending on your system.
|
136
|
+
(#{steps >= 2 ? '10-15' : '5-10'} min on a modern PC with multicore CPU but longer with older/slower CPUs)
|
137
|
+
---
|
138
|
+
|
139
|
+
__INFO_TXT
|
140
|
+
# can't rely on FileUtils#chdir returning the block result (bug in older Rubies) so assign result here
|
141
|
+
result = system(run_env, "rake -m wxruby:gem:setup#{Setup.options['log'] ? '[:keep_log]' : ''} && gem rdoc wxruby3 --overwrite")
|
114
142
|
end
|
115
|
-
run_env = {'WXRUBY_RUN_SILENT' => "#{log_file}"}
|
116
|
-
run_env['WXRUBY_VERBOSE'] = '1' if Setup.options[:verbose]
|
117
|
-
# can't rely on FileUtils#chdir returning the block result (bug in older Rubies) so assign result here
|
118
|
-
result = system(run_env, "#{cfg_cmd} && rake -m wxruby:gem:setup#{Setup.options['log'] ? '[:keep_log]' : ''} && gem rdoc wxruby3 --overwrite")
|
119
143
|
end
|
120
144
|
exit(result ? 0 : 1)
|
121
145
|
end
|