wxruby3 0.9.0.pre.beta.8-x64-mingw-ucrt → 0.9.0.pre.beta.10-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/wxbase32u_gcc_custom.dll +0 -0
- data/ext/wxbase32u_net_gcc_custom.dll +0 -0
- data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
- data/lib/wx/core/bitmap.rb +7 -0
- data/lib/wx/core/choice.rb +3 -0
- data/lib/wx/core/combobox.rb +3 -0
- data/lib/wx/core/controlwithitems.rb +98 -2
- data/lib/wx/core/icon.rb +7 -1
- data/lib/wx/core/imagelist.rb +11 -0
- data/lib/wx/core/listbox.rb +3 -0
- data/lib/wx/doc/gen/control_with_items.rb +3 -131
- data/lib/wx/doc/gen/core.rb +2 -2
- data/lib/wx/doc/gen/image_list.rb +9 -10
- data/lib/wx/doc/gen/progress_dialog.rb +0 -20
- data/lib/wx/doc/gen/prt/print_data.rb +5 -0
- data/lib/wx/doc/progress_dialog.rb +37 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby_aui.so +0 -0
- data/lib/wxruby_core.so +0 -0
- data/lib/wxruby_grid.so +0 -0
- data/lib/wxruby_html.so +0 -0
- data/lib/wxruby_pg.so +0 -0
- data/lib/wxruby_prt.so +0 -0
- data/lib/wxruby_rbn.so +0 -0
- data/lib/wxruby_rtc.so +0 -0
- data/lib/wxruby_stc.so +0 -0
- data/rakelib/lib/config/mingw.rb +3 -0
- data/samples/dialogs/dialogs.rb +70 -50
- data/samples/drawing/maths_images.rb +1 -1
- data/samples/sampler/editor.rb +22 -0
- data/samples/sampler/ext.rb +3 -3
- data/samples/sampler/stc_editor.rb +44 -41
- data/samples/sampler/txt_editor.rb +26 -3
- data/samples/treectrl/treectrl.rb +32 -30
- data/tests/test_item_data.rb +67 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f6e7941faf953aaccbdd3190c6620f078e864099d452047cf549275a288bf89
|
4
|
+
data.tar.gz: ff440fc245055bd4ea02623335c4c00068b808b2c2a1314761f3c8f9a8486cbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25bfc9999b42bd5cf1c4e80ac332b1d31c67882a725f6959acbe256d4c64be468fde151149e9d4ee58937e4f27e0d644332d9c8c83d85387b144c63a6ac457d
|
7
|
+
data.tar.gz: 074ee9e7abd96662182e4f86f792c319e49f7e5f108ca63404bba97c7d2b6d938e8520c1a315568ba34e0ace84d34949da5a65bfd457c0a1af1a391a559e238d
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/wx/core/bitmap.rb
CHANGED
@@ -25,6 +25,13 @@ class Wx::Bitmap
|
|
25
25
|
new(img, depth)
|
26
26
|
end
|
27
27
|
|
28
|
+
# Create a new bitmap from an icon
|
29
|
+
def self.from_icon(icon)
|
30
|
+
bmp = self.new
|
31
|
+
bmp.copy_from_icon(icon)
|
32
|
+
bmp
|
33
|
+
end
|
34
|
+
|
28
35
|
# Ruby methods that switch class are conventionally named to_foo
|
29
36
|
alias :to_image :convert_to_image
|
30
37
|
|
data/lib/wx/core/choice.rb
CHANGED
data/lib/wx/core/combobox.rb
CHANGED
@@ -1,10 +1,106 @@
|
|
1
1
|
# Superclass of a variety of controls that display lists of items (eg
|
2
2
|
# Choice, ListBox, CheckListBox)
|
3
3
|
class Wx::ControlWithItems
|
4
|
-
|
4
|
+
|
5
|
+
# Make these Ruby enumerables so find, find_all, map etc are available
|
5
6
|
include Enumerable
|
7
|
+
|
6
8
|
# Passes each valid item index into the passed block
|
7
9
|
def each
|
8
|
-
|
10
|
+
get_count.times { | i | yield i }
|
11
|
+
end
|
12
|
+
|
13
|
+
# We need to cache client data in Ruby variables as we cannot access items
|
14
|
+
# during the GC mark phase as for some platforms (WXMSW at least) that would
|
15
|
+
# involve calling methods that would break in that phase.
|
16
|
+
|
17
|
+
def client_data_store
|
18
|
+
@client_data ||= []
|
19
|
+
end
|
20
|
+
private :client_data_store
|
21
|
+
|
22
|
+
wx_set_client_data = instance_method :set_client_data
|
23
|
+
define_method :set_client_data do |item, data|
|
24
|
+
item = item.to_i
|
25
|
+
wx_set_client_data.bind(self).call(item, data)
|
26
|
+
client_data_store[item] = data
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_client_data(item)
|
30
|
+
client_data_store[item.to_i]
|
31
|
+
end
|
32
|
+
|
33
|
+
wx_append = instance_method :append
|
34
|
+
define_method :append do |item, data=nil|
|
35
|
+
if data
|
36
|
+
if ::Array === item
|
37
|
+
if !(::Array === data)
|
38
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 3")
|
39
|
+
elsif data.size != item.size
|
40
|
+
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
41
|
+
end
|
42
|
+
offs = get_count
|
43
|
+
wx_append.bind(self).call(item)
|
44
|
+
item.size.times { |ix| set_client_data(offs+ix, data[ix]) }
|
45
|
+
else
|
46
|
+
wx_append.bind(self).call(item, data)
|
47
|
+
client_data_store[get_count-1] = data
|
48
|
+
end
|
49
|
+
else
|
50
|
+
wx_append.bind(self).call(item)
|
51
|
+
# no changes to data store
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
wx_insert = instance_method :insert
|
56
|
+
define_method :insert do |item, pos, data=nil|
|
57
|
+
if data
|
58
|
+
if ::Array === item
|
59
|
+
if !(::Array === data)
|
60
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 3")
|
61
|
+
elsif data.size != item.size
|
62
|
+
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
63
|
+
end
|
64
|
+
wx_insert.bind(self).call(item, pos)
|
65
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
66
|
+
item.size.times { |ix| set_client_data(pos+ix, data[ix]) }
|
67
|
+
else
|
68
|
+
wx_insert.bind(self).call(item, pos, data)
|
69
|
+
client_data_store.insert(pos, data)
|
70
|
+
end
|
71
|
+
else
|
72
|
+
wx_insert.bind(self).call(item, pos)
|
73
|
+
if ::Array === item
|
74
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
75
|
+
else
|
76
|
+
client_data_store.insert(pos, nil)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
wx_set = instance_method :set
|
82
|
+
define_method :set do |items, data=nil|
|
83
|
+
if data
|
84
|
+
if !(::Array === data)
|
85
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 2")
|
86
|
+
elsif data.size != items.size
|
87
|
+
::Kernel.raise ::ArgumentError.new("items and data array must be equal size")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
wx_set.bind(self).call(items)
|
91
|
+
client_data_store.clear
|
92
|
+
items.each_with_index { |item, ix| set_client_data(item, data[ix]) }
|
93
|
+
end
|
94
|
+
|
95
|
+
wx_clear = instance_method :clear
|
96
|
+
define_method :clear do
|
97
|
+
wx_clear.bind(self).call
|
98
|
+
client_data_store.clear
|
99
|
+
end
|
100
|
+
|
101
|
+
wx_delete = instance_method :delete
|
102
|
+
define_method :delete do |item|
|
103
|
+
wx_delete.bind(self).call(item.to_i)
|
104
|
+
client_data_store.slice!(item.to_i)
|
9
105
|
end
|
10
106
|
end
|
data/lib/wx/core/icon.rb
CHANGED
@@ -14,12 +14,18 @@ class Wx::Icon
|
|
14
14
|
|
15
15
|
def to_bitmap
|
16
16
|
# for WXMSW platform Icon is not derived from Bitmap
|
17
|
-
return self unless Wx::PLATFORM == 'WXMSW'
|
17
|
+
return self unless Wx::PLATFORM == 'WXMSW' || Wx::PLATFORM == 'WXOSX'
|
18
18
|
bm = Wx::Bitmap.new
|
19
19
|
bm.copy_from_icon(self)
|
20
20
|
bm
|
21
21
|
end
|
22
22
|
|
23
|
+
if Wx::PLATFORM == 'WXMSW' || Wx::PLATFORM == 'WXOSX'
|
24
|
+
def convert_to_image
|
25
|
+
to_bitmap.convert_to_image
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
23
29
|
# Redefine the initialize method so it raises an exception if a
|
24
30
|
# non-existent file is given to the constructor; otherwise, wx Widgets
|
25
31
|
# just carries on with an empty icon, which may cause faults
|
data/lib/wx/core/imagelist.rb
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
|
1
2
|
class Wx::ImageList
|
3
|
+
|
4
|
+
# provide seamless support for adding icons on all platforms
|
5
|
+
wx_add = instance_method :add
|
6
|
+
define_method :add do |*args|
|
7
|
+
if Wx::Icon === args.first
|
8
|
+
args[0] = args.first.to_bitmap
|
9
|
+
end
|
10
|
+
wx_add.bind(self).call(*args)
|
11
|
+
end
|
12
|
+
|
2
13
|
alias :<< :add
|
3
14
|
end
|
data/lib/wx/core/listbox.rb
CHANGED
@@ -28,53 +28,16 @@ module Wx
|
|
28
28
|
# @param item [String] String to add.
|
29
29
|
# @param clientData [Object] Pointer to client data to associate with the new item.
|
30
30
|
# @return [Integer]
|
31
|
-
# @overload append(item, clientData)
|
32
|
-
# Appends item into the control.
|
33
|
-
# The return value is the index of the newly inserted item. Note that this may be different from the last one if the control is sorted (e.g. has {Wx::LB_SORT} or {Wx::CB_SORT} style).
|
34
|
-
# @param item [String] String to add.
|
35
|
-
# @param clientData [Wx::ClientData] Pointer to client data to associate with the new item.
|
36
|
-
# @return [Integer]
|
37
31
|
# @overload append(items)
|
38
32
|
# Appends several items at once into the control.
|
39
33
|
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
40
34
|
# @param items [Array<String>] Array of strings to insert.
|
41
35
|
# @return [Integer]
|
42
|
-
# @overload append(items)
|
43
|
-
# Appends several items at once into the control.
|
44
|
-
# This is the same as the overload taking {Wx::ArrayString}, except that it works with the standard vector container.
|
45
|
-
# @param items [std::vector< wxString >]
|
46
|
-
# @return [Integer]
|
47
36
|
# @overload append(items, clientData)
|
48
37
|
# Appends several items at once into the control.
|
49
38
|
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
50
39
|
# @param items [Array<String>] Array of strings to insert.
|
51
|
-
# @param clientData [
|
52
|
-
# @return [Integer]
|
53
|
-
# @overload append(items, clientData)
|
54
|
-
# Appends several items at once into the control.
|
55
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
56
|
-
# @param items [Array<String>] Array of strings to insert.
|
57
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of the same size as items to associate with the new items.
|
58
|
-
# @return [Integer]
|
59
|
-
# @overload append(n, items)
|
60
|
-
# Appends several items at once into the control.
|
61
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
62
|
-
# @param n [Integer] Number of items in the items array.
|
63
|
-
# @param items [String] Array of strings of size n.
|
64
|
-
# @return [Integer]
|
65
|
-
# @overload append(n, items, clientData)
|
66
|
-
# Appends several items at once into the control.
|
67
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
68
|
-
# @param n [Integer] Number of items in the items array.
|
69
|
-
# @param items [String] Array of strings of size n.
|
70
|
-
# @param clientData [void] Array of client data pointers of size n to associate with the new items.
|
71
|
-
# @return [Integer]
|
72
|
-
# @overload append(n, items, clientData)
|
73
|
-
# Appends several items at once into the control.
|
74
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
75
|
-
# @param n [Integer] Number of items in the items array.
|
76
|
-
# @param items [String] Array of strings of size n.
|
77
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of size n to associate with the new items.
|
40
|
+
# @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items.
|
78
41
|
# @return [Integer]
|
79
42
|
def append(*args) end
|
80
43
|
|
@@ -107,13 +70,6 @@ module Wx
|
|
107
70
|
# @param pos [Integer] Position to insert item before, zero based.
|
108
71
|
# @param clientData [Object] Pointer to client data to associate with the new item.
|
109
72
|
# @return [Integer]
|
110
|
-
# @overload insert(item, pos, clientData)
|
111
|
-
# Inserts item into the control.
|
112
|
-
# The return value is the index of the newly inserted item. If the insertion failed for some reason, -1 is returned.
|
113
|
-
# @param item [String] String to add.
|
114
|
-
# @param pos [Integer] Position to insert item before, zero based.
|
115
|
-
# @param clientData [Wx::ClientData] Pointer to client data to associate with the new item.
|
116
|
-
# @return [Integer]
|
117
73
|
# @overload insert(items, pos)
|
118
74
|
# Inserts several items at once into the control.
|
119
75
|
# Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.
|
@@ -129,45 +85,7 @@ module Wx
|
|
129
85
|
# The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.
|
130
86
|
# @param items [Array<String>] Array of strings to insert.
|
131
87
|
# @param pos [Integer] Position to insert the items before, zero based.
|
132
|
-
# @param clientData [
|
133
|
-
# @return [Integer]
|
134
|
-
# @overload insert(items, pos, clientData)
|
135
|
-
# Inserts several items at once into the control.
|
136
|
-
# Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.
|
137
|
-
#
|
138
|
-
# The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.
|
139
|
-
# @param items [Array<String>] Array of strings to insert.
|
140
|
-
# @param pos [Integer] Position to insert the items before, zero based.
|
141
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of the same size as items to associate with the new items.
|
142
|
-
# @return [Integer]
|
143
|
-
# @overload insert(n, items, pos)
|
144
|
-
# Inserts several items at once into the control.
|
145
|
-
# Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.
|
146
|
-
#
|
147
|
-
# The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.
|
148
|
-
# @param n [Integer] Number of items in the items array.
|
149
|
-
# @param items [String] Array of strings of size n.
|
150
|
-
# @param pos [Integer] Position to insert the items before, zero based.
|
151
|
-
# @return [Integer]
|
152
|
-
# @overload insert(n, items, pos, clientData)
|
153
|
-
# Inserts several items at once into the control.
|
154
|
-
# Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.
|
155
|
-
#
|
156
|
-
# The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.
|
157
|
-
# @param n [Integer] Number of items in the items array.
|
158
|
-
# @param items [String] Array of strings of size n.
|
159
|
-
# @param pos [Integer] Position to insert the new items before, zero based.
|
160
|
-
# @param clientData [void] Array of client data pointers of size n to associate with the new items.
|
161
|
-
# @return [Integer]
|
162
|
-
# @overload insert(n, items, pos, clientData)
|
163
|
-
# Inserts several items at once into the control.
|
164
|
-
# Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.
|
165
|
-
#
|
166
|
-
# The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.
|
167
|
-
# @param n [Integer] Number of items in the items array.
|
168
|
-
# @param items [String] Array of strings of size n.
|
169
|
-
# @param pos [Integer] Position to insert the new items before, zero based.
|
170
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of size n to associate with the new items.
|
88
|
+
# @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items.
|
171
89
|
# @return [Integer]
|
172
90
|
def insert(*args) end
|
173
91
|
|
@@ -176,42 +94,11 @@ module Wx
|
|
176
94
|
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
177
95
|
# @param items [Array<String>] Array of strings to insert.
|
178
96
|
# @return [void]
|
179
|
-
# @overload set(items)
|
180
|
-
# Replaces the current control contents with the given items.
|
181
|
-
# This is the same as the overload taking {Wx::ArrayString}, except that it works with the standard vector container.
|
182
|
-
# @param items [std::vector< wxString >]
|
183
|
-
# @return [void]
|
184
97
|
# @overload set(items, clientData)
|
185
98
|
# Replaces the current control contents with the given items.
|
186
99
|
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
187
100
|
# @param items [Array<String>] Array of strings to insert.
|
188
|
-
# @param clientData [
|
189
|
-
# @return [void]
|
190
|
-
# @overload set(items, clientData)
|
191
|
-
# Replaces the current control contents with the given items.
|
192
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
193
|
-
# @param items [Array<String>] Array of strings to insert.
|
194
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of the same size as items to associate with the new items.
|
195
|
-
# @return [void]
|
196
|
-
# @overload set(n, items)
|
197
|
-
# Replaces the current control contents with the given items.
|
198
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
199
|
-
# @param n [Integer] Number of items in the items array.
|
200
|
-
# @param items [String] Array of strings of size n.
|
201
|
-
# @return [void]
|
202
|
-
# @overload set(n, items, clientData)
|
203
|
-
# Replaces the current control contents with the given items.
|
204
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
205
|
-
# @param n [Integer] Number of items in the items array.
|
206
|
-
# @param items [String] Array of strings of size n.
|
207
|
-
# @param clientData [void] Array of client data pointers of size n to associate with the new items.
|
208
|
-
# @return [void]
|
209
|
-
# @overload set(n, items, clientData)
|
210
|
-
# Replaces the current control contents with the given items.
|
211
|
-
# Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
|
212
|
-
# @param n [Integer] Number of items in the items array.
|
213
|
-
# @param items [String] Array of strings of size n.
|
214
|
-
# @param clientData [Wx::ClientData] Array of client data pointers of size n to associate with the new items.
|
101
|
+
# @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items.
|
215
102
|
# @return [void]
|
216
103
|
def set(*args) end
|
217
104
|
|
@@ -228,26 +115,11 @@ module Wx
|
|
228
115
|
# @return [void]
|
229
116
|
def delete(n) end
|
230
117
|
|
231
|
-
# Returns the client object associated with the given item and transfers its ownership to the caller.
|
232
|
-
# This method, unlike {Wx::ControlWithItems#get_client_object}, expects the caller to delete the returned pointer. It also replaces the internally stored pointer with NULL, i.e. completely detaches the client object pointer from the control.
|
233
|
-
# It's an error to call this method unless {Wx::ControlWithItems#has_client_object_data} returns true.
|
234
|
-
#
|
235
|
-
# The associated client object pointer to be deleted by caller or NULL.
|
236
|
-
# @param n [Integer] The zero-based item index.
|
237
|
-
# @return [Wx::ClientData]
|
238
|
-
def detach_client_object(n) end
|
239
|
-
|
240
118
|
# Returns true, if either untyped data (<code>void*</code>) or object data ({Wx::ClientData}*) is associated with the items of the control.
|
241
119
|
# @return [true,false]
|
242
120
|
def has_client_data; end
|
243
121
|
alias_method :has_client_data?, :has_client_data
|
244
122
|
|
245
|
-
# Returns true, if object data is associated with the items of the control.
|
246
|
-
# Object data pointers have the type <code>wxClientData*</code> instead of <code>void*</code> and, importantly, are owned by the control, i.e. will be deleted by it, unlike their untyped counterparts.
|
247
|
-
# @return [true,false]
|
248
|
-
def has_client_object_data; end
|
249
|
-
alias_method :has_client_object_data?, :has_client_object_data
|
250
|
-
|
251
123
|
# Returns true, if untyped data (<code>void*</code>) is associated with the items of the control.
|
252
124
|
# @return [true,false]
|
253
125
|
def has_client_untyped_data; end
|
data/lib/wx/doc/gen/core.rb
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
module Wx
|
8
8
|
|
9
9
|
# wxRuby version string
|
10
|
-
Wx::WXRUBY_VERSION = '0.9.0-beta.
|
10
|
+
Wx::WXRUBY_VERSION = '0.9.0-beta.10'
|
11
11
|
|
12
12
|
# wxRuby version release type (alpha, beta, rc)
|
13
|
-
Wx::WXRUBY_RELEASE_TYPE = 'beta.
|
13
|
+
Wx::WXRUBY_RELEASE_TYPE = 'beta.10'
|
14
14
|
# wxRuby major version number
|
15
15
|
Wx::WXRUBY_MAJOR = 0
|
16
16
|
# wxRuby minor version number
|
@@ -73,18 +73,17 @@ module Wx
|
|
73
73
|
# @param bitmap [Wx::Bitmap] Bitmap representing the opaque areas of the image.
|
74
74
|
# @param maskColour [Wx::Colour,String,Symbol] Colour indicating which parts of the image are transparent.
|
75
75
|
# @return [Integer]
|
76
|
+
# @overload add(icon)
|
77
|
+
# Adds a new image using an icon.
|
78
|
+
# The logical size of the icon should be the same as the size specified when constructing {Wx::ImageList}.
|
79
|
+
#
|
80
|
+
# The new zero-based image index.
|
81
|
+
#
|
82
|
+
# Availability: only available for the {Wx::MSW}, {Wx::OSX/Cocoa} ports. {Wx::msw},{Wx::osx}
|
83
|
+
# @param icon [Wx::Icon] Icon to use as the image.
|
84
|
+
# @return [Integer]
|
76
85
|
def add(*args) end
|
77
86
|
|
78
|
-
# Adds a new image using an icon.
|
79
|
-
# The logical size of the icon should be the same as the size specified when constructing {Wx::ImageList}.
|
80
|
-
#
|
81
|
-
# The new zero-based image index.
|
82
|
-
#
|
83
|
-
# Availability: only available for the {Wx::MSW}, {Wx::OSX/Cocoa} ports. {Wx::msw},{Wx::osx}
|
84
|
-
# @param icon [Wx::Icon] Icon to use as the image.
|
85
|
-
# @return [Integer]
|
86
|
-
def add_icon(icon) end
|
87
|
-
|
88
87
|
# Initializes the list.
|
89
88
|
# See {Wx::ImageList#image_list} for details.
|
90
89
|
# This function can be called only once after creating the object using its default ctor or after calling {Wx::ImageList#destroy}.
|
@@ -58,15 +58,6 @@ module Wx
|
|
58
58
|
def get_message; end
|
59
59
|
alias_method :message, :get_message
|
60
60
|
|
61
|
-
# Like {Wx::ProgressDialog#update} but makes the gauge control run in indeterminate mode.
|
62
|
-
# In indeterminate mode the remaining and the estimated time labels (if present) are set to "Unknown" or to newmsg (if it's non-empty). Each call to this function moves the progress bar a bit to indicate that some progress was done.
|
63
|
-
# @see Wx::Gauge#pulse
|
64
|
-
# @see Wx::ProgressDialog#update
|
65
|
-
# @param newmsg [String]
|
66
|
-
# @param skip [bool]
|
67
|
-
# @return [true,false]
|
68
|
-
def pulse(newmsg=Wx::EMPTY_STRING, skip=nil) end
|
69
|
-
|
70
61
|
# Can be used to continue with the dialog, after the user had clicked the "Abort" button.
|
71
62
|
# @return [void]
|
72
63
|
def resume; end
|
@@ -89,17 +80,6 @@ module Wx
|
|
89
80
|
# @return [true,false]
|
90
81
|
def was_skipped; end
|
91
82
|
|
92
|
-
# Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.
|
93
|
-
# Returns true unless the "Cancel" button has been pressed.
|
94
|
-
# If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation and if the abort is not confirmed the dialog may be resumed with {Wx::ProgressDialog#resume} function.
|
95
|
-
# If value is the maximum value for the dialog, the behaviour of the function depends on whether {Wx::PD_AUTO_HIDE} was used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not return until this happens.
|
96
|
-
# Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you may call {Wx::ProgressDialog#fit} explicitly. However the native MSW implementation of this class does make the dialog shorter if the new text has fewer lines of text than the old one, so it is recommended to keep the number of lines of text constant in order to avoid jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog, wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces ({Wx::String}(L'\u00a0', 100)) to it.
|
97
|
-
# @param value [Integer] The new value of the progress meter. It should be less than or equal to the maximum value given to the constructor.
|
98
|
-
# @param newmsg [String] The new messages for the progress dialog text, if it is empty (which is the default) the message is not changed.
|
99
|
-
# @param skip [bool] If "Skip" button was pressed since last {Wx::ProgressDialog#update} call, this is set to true.
|
100
|
-
# @return [true,false]
|
101
|
-
def update(value, newmsg=Wx::EMPTY_STRING, skip=nil) end
|
102
|
-
|
103
83
|
end # ProgressDialog
|
104
84
|
|
105
85
|
|
@@ -331,6 +331,11 @@ module Wx::PRT
|
|
331
331
|
def get_no_copies; end
|
332
332
|
alias_method :no_copies, :get_no_copies
|
333
333
|
|
334
|
+
# Returns a reference to the internal {Wx::PRT::PrintData} object.
|
335
|
+
# @return [Wx::PrintData]
|
336
|
+
def get_print_data; end
|
337
|
+
alias_method :print_data, :get_print_data
|
338
|
+
|
334
339
|
# Returns true if the user has selected printing to a file.
|
335
340
|
# @return [true,false]
|
336
341
|
def get_print_to_file; end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
class Wx::ProgressDialog
|
3
|
+
|
4
|
+
# Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.
|
5
|
+
#
|
6
|
+
# Returns <code>false</code> if the "Cancel" button has been pressed, <code>true</code> if neither "Cancel" nor
|
7
|
+
# "Skip" has been pressed and <code>:skipped</code> if "Skip" has been pressed.
|
8
|
+
#
|
9
|
+
# If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation
|
10
|
+
# and if the abort is not confirmed the dialog may be resumed with #resume method.
|
11
|
+
#
|
12
|
+
# If value is the maximum value for the dialog, the behaviour of the function depends on whether Wx::PD_AUTO_HIDE was
|
13
|
+
# used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was
|
14
|
+
# not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not
|
15
|
+
# return until this happens.
|
16
|
+
#
|
17
|
+
# Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to
|
18
|
+
# account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to
|
19
|
+
# avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you
|
20
|
+
# may call fit explicitly. An alternative would be to keep the number of lines of text constant in order to avoid
|
21
|
+
# jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog,
|
22
|
+
# wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces
|
23
|
+
# (wxString(L'\u00a0', 100)) to it.
|
24
|
+
# @param [Integer] value The new value of the progress meter. It should be less than or equal to the maximum value given to the constructor.
|
25
|
+
# @param [String] newmsg The new messages for the progress dialog text, if it is empty (which is the default) the message is not changed.
|
26
|
+
# @return [Boolean,:skipped]
|
27
|
+
def update(value, newmsg = '') end
|
28
|
+
|
29
|
+
# Like #update but makes the gauge control run in indeterminate mode.
|
30
|
+
#
|
31
|
+
# In indeterminate mode the remaining and the estimated time labels (if present) are set to "Unknown" or to newmsg
|
32
|
+
# (if it's non-empty). Each call to this function moves the progress bar a bit to indicate that some progress was done.
|
33
|
+
# @param [String] newmsg
|
34
|
+
# @return [Boolean,:skipped]
|
35
|
+
def pulse(newmsg = '') end
|
36
|
+
|
37
|
+
end
|
data/lib/wx/version.rb
CHANGED
data/lib/wxruby_aui.so
CHANGED
Binary file
|
data/lib/wxruby_core.so
CHANGED
Binary file
|
data/lib/wxruby_grid.so
CHANGED
Binary file
|
data/lib/wxruby_html.so
CHANGED
Binary file
|
data/lib/wxruby_pg.so
CHANGED
Binary file
|
data/lib/wxruby_prt.so
CHANGED
Binary file
|
data/lib/wxruby_rbn.so
CHANGED
Binary file
|
data/lib/wxruby_rtc.so
CHANGED
Binary file
|
data/lib/wxruby_stc.so
CHANGED
Binary file
|
data/rakelib/lib/config/mingw.rb
CHANGED
@@ -122,6 +122,9 @@ module WXRuby3
|
|
122
122
|
@rescomp << ' --define __WXMSW__ --define wxUSE_DPI_AWARE_MANIFEST=2 --define wxUSE_RC_MANIFEST=1 --define ISOLATION_AWARE_ENABLED'
|
123
123
|
@rescomp << ' --define WXUSINGDLL'
|
124
124
|
@extra_cflags << '-DISOLATION_AWARE_ENABLED'
|
125
|
+
if @wx_version >= '3.3.0'
|
126
|
+
@extra_cflags << '-D_UNICODE' << '-DUNICODE'
|
127
|
+
end
|
125
128
|
end
|
126
129
|
end
|
127
130
|
private :init_platform
|
data/samples/dialogs/dialogs.rb
CHANGED
@@ -36,6 +36,7 @@ DIALOGS_STYLED_BUSYINFO = 25
|
|
36
36
|
DIALOGS_FIND = 26
|
37
37
|
DIALOGS_REPLACE = 27
|
38
38
|
DIALOGS_PREFS = 28
|
39
|
+
DIALOGS_PREFS_TOOLBOOK = 29
|
39
40
|
|
40
41
|
class MyTipProvider < TipProvider
|
41
42
|
TIPS = [
|
@@ -147,16 +148,18 @@ end
|
|
147
148
|
# PropertySheetDialog is specialised for doing preferences dialogs; it
|
148
149
|
# contains a BookCtrl of some sort
|
149
150
|
class MyPrefsDialog < Wx::PropertySheetDialog
|
150
|
-
def initialize(parent)
|
151
|
+
def initialize(parent, pref_type)
|
151
152
|
# Using Book type other than Notebook needs two-step construction
|
152
153
|
super()
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
154
|
+
if pref_type == DIALOGS_PREFS_TOOLBOOK
|
155
|
+
self.sheet_style = Wx::PROPSHEET_BUTTONTOOLBOOK
|
156
|
+
self.sheet_outer_border = 1
|
157
|
+
self.sheet_inner_border = 2
|
158
|
+
img_list = Wx::ImageList.new(32, 32)
|
159
|
+
img_list << std_bitmap(Wx::ART_NORMAL_FILE)
|
160
|
+
img_list << std_bitmap(Wx::ART_CDROM)
|
161
|
+
img_list << std_bitmap(Wx::ART_REPORT_VIEW)
|
162
|
+
end
|
160
163
|
|
161
164
|
create(parent, -1, "Preferences")
|
162
165
|
create_buttons(Wx::ID_OK|Wx::ID_CANCEL)
|
@@ -247,40 +250,41 @@ class MyFrame < Frame
|
|
247
250
|
@index = -1
|
248
251
|
@index_2 = -1
|
249
252
|
|
250
|
-
@max =
|
253
|
+
@max = 100
|
251
254
|
|
252
255
|
create_status_bar()
|
253
256
|
|
254
|
-
evt_menu(DIALOGS_CHOOSE_COLOUR
|
255
|
-
evt_menu(DIALOGS_CHOOSE_FONT
|
256
|
-
evt_menu(DIALOGS_LOG_DIALOG
|
257
|
-
evt_menu(DIALOGS_MESSAGE_BOX
|
258
|
-
evt_menu(DIALOGS_TEXT_ENTRY
|
259
|
-
evt_menu(DIALOGS_PASSWORD_ENTRY
|
260
|
-
evt_menu(DIALOGS_NUM_ENTRY
|
261
|
-
evt_menu(DIALOGS_SINGLE_CHOICE
|
262
|
-
evt_menu(DIALOGS_MULTI_CHOICE
|
263
|
-
evt_menu(DIALOGS_FILE_OPEN
|
264
|
-
evt_menu(DIALOGS_FILE_OPEN2
|
265
|
-
evt_menu(DIALOGS_FILES_OPEN
|
266
|
-
evt_menu(DIALOGS_FILE_SAVE
|
267
|
-
evt_menu(DIALOGS_DIR_CHOOSE
|
268
|
-
evt_menu(DIALOGS_MODAL
|
269
|
-
evt_menu(DIALOGS_MODELESS
|
270
|
-
evt_menu(DIALOGS_TIP
|
271
|
-
evt_menu(DIALOGS_CUSTOM_TIP
|
272
|
-
evt_menu(DIALOGS_PROGRESS
|
273
|
-
evt_menu(DIALOGS_BUSYINFO
|
274
|
-
evt_menu(DIALOGS_STYLED_BUSYINFO
|
275
|
-
evt_menu(DIALOGS_PREFS
|
276
|
-
evt_menu(
|
277
|
-
evt_menu(
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
257
|
+
evt_menu(DIALOGS_CHOOSE_COLOUR, :on_choose_colour)
|
258
|
+
evt_menu(DIALOGS_CHOOSE_FONT, :on_choose_font)
|
259
|
+
evt_menu(DIALOGS_LOG_DIALOG, :on_log_dialog)
|
260
|
+
evt_menu(DIALOGS_MESSAGE_BOX, :on_message_box)
|
261
|
+
evt_menu(DIALOGS_TEXT_ENTRY, :on_text_entry)
|
262
|
+
evt_menu(DIALOGS_PASSWORD_ENTRY, :on_password_entry)
|
263
|
+
evt_menu(DIALOGS_NUM_ENTRY, :on_numeric_entry)
|
264
|
+
evt_menu(DIALOGS_SINGLE_CHOICE, :on_single_choice)
|
265
|
+
evt_menu(DIALOGS_MULTI_CHOICE, :on_multi_choice)
|
266
|
+
evt_menu(DIALOGS_FILE_OPEN, :on_file_open)
|
267
|
+
evt_menu(DIALOGS_FILE_OPEN2, :on_file_open2)
|
268
|
+
evt_menu(DIALOGS_FILES_OPEN, :on_files_open)
|
269
|
+
evt_menu(DIALOGS_FILE_SAVE, :on_file_save)
|
270
|
+
evt_menu(DIALOGS_DIR_CHOOSE, :on_dir_choose)
|
271
|
+
evt_menu(DIALOGS_MODAL, :on_modal_dlg)
|
272
|
+
evt_menu(DIALOGS_MODELESS, :on_modeless_dlg)
|
273
|
+
evt_menu(DIALOGS_TIP, :on_show_tip)
|
274
|
+
evt_menu(DIALOGS_CUSTOM_TIP, :on_show_custom_tip)
|
275
|
+
evt_menu(DIALOGS_PROGRESS, :on_show_progress)
|
276
|
+
evt_menu(DIALOGS_BUSYINFO, :on_show_busy_info)
|
277
|
+
evt_menu(DIALOGS_STYLED_BUSYINFO, :on_show_styled_busy_info)
|
278
|
+
evt_menu(DIALOGS_PREFS, :on_show_prefs)
|
279
|
+
evt_menu(DIALOGS_PREFS_TOOLBOOK,:on_show_prefs)
|
280
|
+
evt_menu(DIALOGS_FIND, :on_show_find_dialog)
|
281
|
+
evt_menu(DIALOGS_REPLACE, :on_show_replace_dialog)
|
282
|
+
evt_find(-1, :on_find_dialog)
|
283
|
+
evt_find_next(-1, :on_find_dialog)
|
284
|
+
evt_find_replace(-1, :on_find_dialog)
|
285
|
+
evt_find_replace_all(-1, :on_find_dialog)
|
286
|
+
evt_find_close(-1, :on_find_dialog)
|
287
|
+
evt_menu(ID_EXIT, :on_exit)
|
284
288
|
|
285
289
|
end
|
286
290
|
|
@@ -614,26 +618,37 @@ class MyFrame < Frame
|
|
614
618
|
|
615
619
|
|
616
620
|
def on_show_prefs(event)
|
617
|
-
MyPrefsDialog(self)
|
621
|
+
MyPrefsDialog(self, event.id)
|
618
622
|
end
|
619
623
|
|
620
624
|
def on_show_progress(event)
|
621
625
|
cont = false
|
622
626
|
Wx::ProgressDialog("Progress dialog example",
|
623
|
-
"An informative message",
|
627
|
+
"An informative message\n"+"#{' '*100}\n\n\n\n",
|
624
628
|
@max, # range
|
625
629
|
self, # parent
|
626
|
-
PD_CAN_ABORT | PD_APP_MODAL |
|
630
|
+
PD_CAN_ABORT | PD_CAN_SKIP | PD_APP_MODAL |
|
627
631
|
PD_ELAPSED_TIME | PD_ESTIMATED_TIME |
|
628
632
|
PD_REMAINING_TIME) do |dialog|
|
629
633
|
cont = true
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
elsif i == @max / 2
|
634
|
-
cont = dialog.update(i, "Only half of it left (very long message)!")
|
635
|
-
else
|
634
|
+
i = 0
|
635
|
+
while i <= @max
|
636
|
+
if i == 0
|
636
637
|
cont = dialog.update(i)
|
638
|
+
elsif i == @max
|
639
|
+
cont = dialog.update(i, "That's all, folks!\n\nNothing more to see here any more.")
|
640
|
+
elsif i <= (@max / 2)
|
641
|
+
cont = dialog.pulse("Testing indeterminate mode\n" +
|
642
|
+
"\n" +
|
643
|
+
"This mode allows you to show to the user\n" +
|
644
|
+
"that something is going on even if you don't know\n" +
|
645
|
+
"when exactly will you finish.")
|
646
|
+
else
|
647
|
+
cont = dialog.update(i, "Now in standard determinate mode\n" +
|
648
|
+
"\n" +
|
649
|
+
"This is the standard usage mode in which you\n" +
|
650
|
+
"update the dialog after performing each new step of work.\n" +
|
651
|
+
"It requires knowing the total number of steps in advance.")
|
637
652
|
end
|
638
653
|
|
639
654
|
if !cont
|
@@ -644,8 +659,12 @@ class MyFrame < Frame
|
|
644
659
|
break
|
645
660
|
end
|
646
661
|
dialog.resume
|
662
|
+
elsif cont == :skipped
|
663
|
+
i += (@max / 4)
|
664
|
+
i = @max-1 if i >= @max
|
647
665
|
end
|
648
|
-
sleep(1)
|
666
|
+
sleep(i == 0 ? 1 : 0.15)
|
667
|
+
i += 1
|
649
668
|
end
|
650
669
|
end
|
651
670
|
|
@@ -831,7 +850,8 @@ class MyApp < App
|
|
831
850
|
file_menu.append(DIALOGS_PROGRESS, "Pro&gress dialog\tCtrl-G")
|
832
851
|
file_menu.append(DIALOGS_BUSYINFO, "&Busy info dialog\tCtrl-B")
|
833
852
|
file_menu.append(DIALOGS_STYLED_BUSYINFO, "Styled BusyInfo dialog")
|
834
|
-
file_menu.append(DIALOGS_PREFS, "
|
853
|
+
file_menu.append(DIALOGS_PREFS, "Standard propert&y sheet dialog\tCtrl-Y")
|
854
|
+
file_menu.append(DIALOGS_PREFS_TOOLBOOK, "&Toolbook property sheet dialog\tShift-Ctrl-Y")
|
835
855
|
file_menu.append(DIALOGS_FIND, "&Find dialog\tCtrl-F", "", ITEM_CHECK)
|
836
856
|
file_menu.append(DIALOGS_REPLACE, "Find and &replace dialog\tShift-Ctrl-F", "", ITEM_CHECK)
|
837
857
|
|
@@ -211,7 +211,7 @@ class MathsPanel < Panel
|
|
211
211
|
# Display a dialog to save the image to a file
|
212
212
|
def on_save
|
213
213
|
SaveImageDialog(parent) do |dlg|
|
214
|
-
if dlg.show_modal == ID_OK
|
214
|
+
if dlg.show_modal == Wx::ID_OK
|
215
215
|
if dlg.image_type == Wx::BITMAP_TYPE_PNG
|
216
216
|
# test writing to IO
|
217
217
|
File.open(dlg.path, 'w') do |f|
|
data/samples/sampler/editor.rb
CHANGED
@@ -175,6 +175,19 @@ module WxRuby
|
|
175
175
|
@editors.each { |e| e.find_close }
|
176
176
|
end
|
177
177
|
|
178
|
+
def goto
|
179
|
+
res = Wx.get_number_from_user('Enter line number to go to.',
|
180
|
+
'Line:',
|
181
|
+
'Goto Line',
|
182
|
+
@editors[@edt_book.selection].current_line+1,
|
183
|
+
1,
|
184
|
+
@editors[@edt_book.selection].line_count,
|
185
|
+
@frame)
|
186
|
+
if res >= 1
|
187
|
+
@editors[@edt_book.selection].goto_line(res-1)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
178
191
|
def page_from_id(id)
|
179
192
|
if id >= ID::EDT_MIN_ID && id < (ID::EDT_MIN_ID+@edt_book.page_count)
|
180
193
|
id - ID::EDT_MIN_ID
|
@@ -231,6 +244,7 @@ module WxRuby
|
|
231
244
|
FIND_NEXT = Wx::ID_FORWARD
|
232
245
|
FIND_PREV = Wx::ID_BACKWARD
|
233
246
|
REPLACE = Wx::ID_REPLACE
|
247
|
+
GOTO = Wx::ID_JUMP_TO
|
234
248
|
%i[
|
235
249
|
RUN
|
236
250
|
TOGGLE_THEME
|
@@ -268,6 +282,8 @@ module WxRuby
|
|
268
282
|
menuEdit.append(ID::FIND_NEXT, "Find Next\tF3", 'Find next occurrence of the search phrase')
|
269
283
|
menuEdit.append(ID::FIND_PREV, "Find Previous\tShift-F3", 'Find previous occurrence of the search phrase')
|
270
284
|
menuEdit.append(ID::REPLACE, "Replace...\tCtrl-R", 'Show Replace Dialog')
|
285
|
+
menuEdit.append_separator
|
286
|
+
menuEdit.append(ID::GOTO, "Got to line...\tCtrl-G", 'Move to line number')
|
271
287
|
|
272
288
|
menuView = Wx::Menu.new
|
273
289
|
menuView.append(ID::TOGGLE_THEME, 'Display dark theme', 'Display dark theme', Wx::ITEM_CHECK)
|
@@ -354,6 +370,8 @@ module WxRuby
|
|
354
370
|
evt_menu(ID::FIND_NEXT, :on_find_next)
|
355
371
|
evt_menu(ID::FIND_PREV, :on_find_prev)
|
356
372
|
|
373
|
+
evt_menu(ID::GOTO, :on_goto)
|
374
|
+
|
357
375
|
layout
|
358
376
|
end
|
359
377
|
|
@@ -555,6 +573,10 @@ module WxRuby
|
|
555
573
|
set_status_text('')
|
556
574
|
end
|
557
575
|
|
576
|
+
def on_goto(_evt)
|
577
|
+
@editors.goto
|
578
|
+
end
|
579
|
+
|
558
580
|
end
|
559
581
|
|
560
582
|
end
|
data/samples/sampler/ext.rb
CHANGED
@@ -38,12 +38,12 @@ end
|
|
38
38
|
# otherwise samples using 'include Wx' (or other modules) will fail on referencing
|
39
39
|
# a (module) method unscoped from one of these included modules
|
40
40
|
module ::Kernel
|
41
|
-
def method_missing(name, *args)
|
41
|
+
def method_missing(name, *args, &block)
|
42
42
|
if self.class.name.start_with?('WxRuby::Sample::SampleLoader_') && (scope = self.class.name.split('::')).size > 3
|
43
43
|
top_mod = Object.const_get(scope[0,3].join('::'))
|
44
|
-
return top_mod.__send__(name, *args) if top_mod.respond_to?(name)
|
44
|
+
return top_mod.__send__(name, *args, &block) if top_mod.respond_to?(name)
|
45
45
|
top_mod.included_modules.each do |imod|
|
46
|
-
return imod.__send__(name, *args) if imod.respond_to?(name)
|
46
|
+
return imod.__send__(name, *args, &block) if imod.respond_to?(name)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
super
|
@@ -117,35 +117,36 @@ module WxRuby
|
|
117
117
|
style_set_foreground(Wx::STC::STC_STYLE_DEFAULT, Wx::BLACK);
|
118
118
|
style_set_background(Wx::STC::STC_STYLE_DEFAULT, Wx::WHITE);
|
119
119
|
style_clear_all
|
120
|
-
style_set_foreground(Wx::STC::STC_STYLE_LINENUMBER, Wx::Colour.new('
|
120
|
+
style_set_foreground(Wx::STC::STC_STYLE_LINENUMBER, Wx::Colour.new('Dark Grey'))
|
121
121
|
style_set_background(Wx::STC::STC_STYLE_LINENUMBER, Wx::WHITE);
|
122
122
|
style_set_foreground(Wx::STC::STC_STYLE_INDENTGUIDE, Wx::LIGHT_GREY);
|
123
|
-
set_whitespace_background(false, Wx::Colour.new('
|
124
|
-
style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('
|
123
|
+
set_whitespace_background(false, Wx::Colour.new('Dark Slate Grey'))
|
124
|
+
style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('Dark Green'))
|
125
125
|
style_set_bold(SCE_RB_COMMENTLINE, true)
|
126
126
|
style_set_foreground(SCE_RB_WORD, Wx::BLACK)
|
127
127
|
style_set_bold(SCE_RB_WORD, true)
|
128
|
-
style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('
|
128
|
+
style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('Dark Olive Green'))
|
129
129
|
style_set_bold(SCE_RB_OPERATOR, true)
|
130
|
-
style_set_foreground(SCE_RB_POD, Wx::Colour.new('
|
130
|
+
style_set_foreground(SCE_RB_POD, Wx::Colour.new('Grey'))
|
131
131
|
style_set_foreground(SCE_RB_NUMBER, Wx::BLUE)
|
132
132
|
style_set_foreground(SCE_RB_STRING, c_maroon)
|
133
133
|
style_set_foreground(SCE_RB_CHARACTER, Wx::RED)
|
134
|
-
style_set_foreground(SCE_RB_SYMBOL, Wx::Colour.new('
|
134
|
+
style_set_foreground(SCE_RB_SYMBOL, Wx::Colour.new('Navy'))
|
135
135
|
style_set_bold(SCE_RB_SYMBOL, true)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
136
|
+
if Wx::WXWIDGETS_VERSION >= '3.3.0'
|
137
|
+
style_set_foreground(SCE_RB_HERE_DELIM, Wx::BLACK)
|
138
|
+
style_set_bold(SCE_RB_HERE_DELIM, true)
|
139
|
+
style_set_foreground(SCE_RB_HERE_Q, c_maroon)
|
140
|
+
style_set_foreground(SCE_RB_HERE_QQ, c_maroon)
|
141
|
+
style_set_foreground(SCE_RB_HERE_QX, c_maroon)
|
142
|
+
style_set_foreground(SCE_RB_STRING_Q, c_maroon)
|
143
|
+
style_set_foreground(SCE_RB_STRING_QQ, c_maroon)
|
144
|
+
style_set_foreground(SCE_RB_STRING_QX, c_maroon)
|
145
|
+
style_set_foreground(SCE_RB_STRING_QR, c_maroon)
|
146
|
+
style_set_foreground(SCE_RB_STRING_QW, c_maroon)
|
147
|
+
end
|
148
|
+
bg = Wx::Colour.new('Light Grey')
|
149
|
+
fg = Wx::Colour.new('Cadet Blue')
|
149
150
|
set_fold_margin_colour(true, bg)
|
150
151
|
set_fold_margin_hi_colour(true, bg)
|
151
152
|
marker_set_foreground(Wx::STC::STC_MARKNUM_FOLDER, fg)
|
@@ -155,7 +156,8 @@ module WxRuby
|
|
155
156
|
end
|
156
157
|
|
157
158
|
def dark_theme
|
158
|
-
bg = Wx::Colour.new('
|
159
|
+
bg = Wx::Colour.new('Dark Slate Grey')
|
160
|
+
c_str = Wx::Colour.new('Lime Green')
|
159
161
|
style_set_background(Wx::STC::STC_STYLE_DEFAULT, bg)
|
160
162
|
style_set_foreground(Wx::STC::STC_STYLE_DEFAULT, Wx::WHITE)
|
161
163
|
style_clear_all
|
@@ -164,39 +166,40 @@ module WxRuby
|
|
164
166
|
style_set_foreground(Wx::STC::STC_STYLE_INDENTGUIDE, bg);
|
165
167
|
set_whitespace_background(true, bg)
|
166
168
|
style_set_eol_filled(SCE_RB_DEFAULT, true)
|
167
|
-
style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('
|
169
|
+
style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('Light Grey'))
|
168
170
|
style_set_background(SCE_RB_COMMENTLINE, bg)
|
169
171
|
style_set_bold(SCE_RB_COMMENTLINE, true)
|
170
|
-
style_set_foreground(SCE_RB_WORD, Wx::Colour.new('
|
172
|
+
style_set_foreground(SCE_RB_WORD, Wx::Colour.new('Coral'))
|
171
173
|
style_set_background(SCE_RB_WORD, bg)
|
172
174
|
style_set_bold(SCE_RB_WORD, true)
|
173
|
-
style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('
|
175
|
+
style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('Light Grey'))
|
174
176
|
style_set_background(SCE_RB_OPERATOR, bg)
|
175
177
|
style_set_bold(SCE_RB_OPERATOR, true)
|
176
|
-
style_set_foreground(SCE_RB_POD, Wx::Colour.new('
|
178
|
+
style_set_foreground(SCE_RB_POD, Wx::Colour.new('Grey'))
|
177
179
|
style_set_background(SCE_RB_POD, bg)
|
178
|
-
style_set_foreground(SCE_RB_NUMBER, Wx::Colour.new('
|
180
|
+
style_set_foreground(SCE_RB_NUMBER, Wx::Colour.new('Cyan'))
|
179
181
|
style_set_background(SCE_RB_NUMBER, bg)
|
180
|
-
style_set_foreground(SCE_RB_STRING,
|
182
|
+
style_set_foreground(SCE_RB_STRING, c_str)
|
181
183
|
style_set_background(SCE_RB_STRING, bg)
|
182
|
-
style_set_foreground(SCE_RB_CHARACTER, Wx::Colour.new('
|
184
|
+
style_set_foreground(SCE_RB_CHARACTER, Wx::Colour.new('Yellow Green'))
|
183
185
|
style_set_background(SCE_RB_CHARACTER, bg)
|
184
186
|
style_set_foreground(SCE_RB_SYMBOL, Wx::Colour.new('Gold'))
|
185
187
|
style_set_background(SCE_RB_SYMBOL, bg)
|
186
188
|
style_set_bold(SCE_RB_SYMBOL, true)
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
189
|
+
if Wx::WXWIDGETS_VERSION >= '3.3.0'
|
190
|
+
style_set_foreground(SCE_RB_HERE_DELIM, Wx::Colour.new('Coral'))
|
191
|
+
style_set_bold(SCE_RB_HERE_DELIM, true)
|
192
|
+
style_set_foreground(SCE_RB_HERE_Q, c_str)
|
193
|
+
style_set_foreground(SCE_RB_HERE_QQ, c_str)
|
194
|
+
style_set_foreground(SCE_RB_HERE_QX, c_str)
|
195
|
+
style_set_foreground(SCE_RB_STRING_Q, c_str)
|
196
|
+
style_set_foreground(SCE_RB_STRING_QQ, c_str)
|
197
|
+
style_set_foreground(SCE_RB_STRING_QX, c_str)
|
198
|
+
style_set_foreground(SCE_RB_STRING_QR, c_str)
|
199
|
+
style_set_foreground(SCE_RB_STRING_QW, c_str)
|
200
|
+
end
|
201
|
+
bg = Wx::Colour.new('Cadet Blue')
|
202
|
+
fg = Wx::Colour.new('Coral')
|
200
203
|
set_fold_margin_colour(true, bg)
|
201
204
|
set_fold_margin_hi_colour(true, bg)
|
202
205
|
marker_set_foreground(Wx::STC::STC_MARKNUM_FOLDER, fg)
|
@@ -212,7 +215,7 @@ module WxRuby
|
|
212
215
|
start_pos = current_pos
|
213
216
|
end_pos = length-1
|
214
217
|
else
|
215
|
-
start_pos = current_pos
|
218
|
+
start_pos = [0, current_pos - (@search_indicator ? @search_indicator.last : 0)].max
|
216
219
|
end_pos = 0
|
217
220
|
end
|
218
221
|
pos, end_pos = find_text(start_pos, end_pos, txt, flags)
|
@@ -35,9 +35,9 @@ module WxRuby
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def dark_theme
|
38
|
-
self.background_colour = Wx::Colour.new('
|
38
|
+
self.background_colour = Wx::Colour.new('Dark Slate Grey')
|
39
39
|
self.foreground_colour = Wx::WHITE
|
40
|
-
self.set_default_style(txtatt = Wx::TextAttr.new(Wx::WHITE, Wx::Colour.new('
|
40
|
+
self.set_default_style(txtatt = Wx::TextAttr.new(Wx::WHITE, Wx::Colour.new('Dark Slate Grey'), self.font))
|
41
41
|
self.set_style(0, self.get_last_position, txtatt)
|
42
42
|
end
|
43
43
|
|
@@ -45,6 +45,24 @@ module WxRuby
|
|
45
45
|
clear
|
46
46
|
end
|
47
47
|
|
48
|
+
def get_line_count
|
49
|
+
number_of_lines
|
50
|
+
end
|
51
|
+
alias :line_count :get_line_count
|
52
|
+
|
53
|
+
def get_current_line
|
54
|
+
pos = insertion_point
|
55
|
+
_, line = position_to_xy(pos)
|
56
|
+
line
|
57
|
+
end
|
58
|
+
alias :current_line :get_current_line
|
59
|
+
|
60
|
+
def goto_line(line)
|
61
|
+
pos = xy_to_position(0, line)
|
62
|
+
self.show_position(pos)
|
63
|
+
self.insertion_point = pos
|
64
|
+
end
|
65
|
+
|
48
66
|
def do_find(txt, forward, whole_word, match_case)
|
49
67
|
options = (match_case ? 0 : Regexp::IGNORECASE)
|
50
68
|
pattern = if whole_word
|
@@ -52,7 +70,12 @@ module WxRuby
|
|
52
70
|
else
|
53
71
|
::Regexp.new(txt, options)
|
54
72
|
end
|
55
|
-
forward
|
73
|
+
if forward
|
74
|
+
self.value.index(pattern, insertion_point)
|
75
|
+
else
|
76
|
+
start_pos = [0, insertion_point - (@search_indicator ? @search_indicator.last+1 : 0)].max
|
77
|
+
self.value.rindex(pattern, start_pos)
|
78
|
+
end
|
56
79
|
end
|
57
80
|
|
58
81
|
def indicator_clear_range(pos, len)
|
@@ -262,39 +262,41 @@ class MyTreeCtrl < Wx::TreeCtrl
|
|
262
262
|
end
|
263
263
|
|
264
264
|
def create_buttons_image_list(size)
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
# Make an image list containing small icons
|
271
|
-
images = Wx::ImageList.new(size, size, true)
|
265
|
+
unless Wx::PLATFORM == 'WXMSW'
|
266
|
+
if size < 0
|
267
|
+
self.buttons_image_list = nil
|
268
|
+
return
|
269
|
+
end
|
272
270
|
|
273
|
-
|
274
|
-
|
275
|
-
icons = if @alternate_images
|
276
|
-
[Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon3.xpm'), Wx::BITMAP_TYPE_XPM),
|
277
|
-
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon3.xpm'), Wx::BITMAP_TYPE_XPM),
|
278
|
-
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon5.xpm'), Wx::BITMAP_TYPE_XPM),
|
279
|
-
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon5.xpm'), Wx::BITMAP_TYPE_XPM)
|
280
|
-
]
|
281
|
-
else
|
282
|
-
icon_size = Wx::Size.new(@image_size, @image_size)
|
283
|
-
ic1 = Wx::ArtProvider::get_icon(Wx::ART_FOLDER, Wx::ART_LIST, icon_size)
|
284
|
-
ic2 = Wx::ArtProvider::get_icon(Wx::ART_FOLDER_OPEN, Wx::ART_LIST, icon_size)
|
285
|
-
[ic1, ic1, ic2, ic2]
|
286
|
-
end
|
271
|
+
# Make an image list containing small icons
|
272
|
+
images = Wx::ImageList.new(size, size, true)
|
287
273
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
274
|
+
# should correspond to TreeCtrlIcon_xxx enum
|
275
|
+
Wx::BusyCursor.busy do
|
276
|
+
icons = if @alternate_images
|
277
|
+
[Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon3.xpm'), Wx::BITMAP_TYPE_XPM),
|
278
|
+
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon3.xpm'), Wx::BITMAP_TYPE_XPM),
|
279
|
+
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon5.xpm'), Wx::BITMAP_TYPE_XPM),
|
280
|
+
Wx::Icon.new(File.join(File.dirname(__FILE__), 'icon5.xpm'), Wx::BITMAP_TYPE_XPM)
|
281
|
+
]
|
282
|
+
else
|
283
|
+
icon_size = Wx::Size.new(@image_size, @image_size)
|
284
|
+
ic1 = Wx::ArtProvider::get_icon(Wx::ART_FOLDER, Wx::ART_LIST, icon_size)
|
285
|
+
ic2 = Wx::ArtProvider::get_icon(Wx::ART_FOLDER_OPEN, Wx::ART_LIST, icon_size)
|
286
|
+
[ic1, ic1, ic2, ic2]
|
287
|
+
end
|
288
|
+
|
289
|
+
icons.each do |ic|
|
290
|
+
if ic.width == size
|
291
|
+
images.add(ic)
|
292
|
+
else
|
293
|
+
resized = ic.convert_to_image.rescale(size, size)
|
294
|
+
images.add(Wx::Bitmap.new(resized))
|
295
|
+
end
|
294
296
|
end
|
295
|
-
end
|
296
297
|
|
297
|
-
|
298
|
+
self.buttons_image_list = images
|
299
|
+
end
|
298
300
|
end
|
299
301
|
end
|
300
302
|
|
@@ -1454,7 +1456,7 @@ class MyFrame < Wx::Frame
|
|
1454
1456
|
end
|
1455
1457
|
|
1456
1458
|
def on_toggle_buttons(event)
|
1457
|
-
unless Wx
|
1459
|
+
unless Wx::PLATFORM == 'WXMSW'
|
1458
1460
|
if Wx::THE_APP.show_buttons
|
1459
1461
|
@treectrl.create_buttons_image_list(-1)
|
1460
1462
|
Wx::get_app.show_buttons = false
|
data/tests/test_item_data.rb
CHANGED
@@ -31,6 +31,73 @@ class TestItemData < Test::Unit::TestCase
|
|
31
31
|
assert_retrievable_data(f.control, 0, { 'b' => 'B' })
|
32
32
|
assert_retrievable_data(f.control, 1, 'string item data')
|
33
33
|
assert_retrievable_data(f.control, 2, 42.3)
|
34
|
+
|
35
|
+
GC.start
|
36
|
+
|
37
|
+
# single item append; no data
|
38
|
+
f.control.append('integer')
|
39
|
+
assert_equal(4, f.control.count)
|
40
|
+
assert_equal('integer', f.control.get_string(3))
|
41
|
+
assert_equal(nil, f.control.get_item_data(3))
|
42
|
+
|
43
|
+
# single item append; with data
|
44
|
+
f.control.append('array', 110)
|
45
|
+
assert_equal(5, f.control.count)
|
46
|
+
assert_equal('array', f.control.get_string(4))
|
47
|
+
assert_equal(110, f.control.get_item_data(4))
|
48
|
+
|
49
|
+
# array item append; no data
|
50
|
+
f.control.append(%w[set tree bag])
|
51
|
+
assert_equal(8, f.control.count)
|
52
|
+
assert_equal(nil, f.control.get_item_data(5))
|
53
|
+
assert_equal(nil, f.control.get_item_data(7))
|
54
|
+
|
55
|
+
# array item append; with data
|
56
|
+
f.control.append(%w[object module class], ['O', 'M', 'C'])
|
57
|
+
assert_equal(11, f.control.count)
|
58
|
+
assert_equal('O', f.control.get_item_data(8))
|
59
|
+
assert_equal('C', f.control.get_item_data(10))
|
60
|
+
|
61
|
+
GC.start
|
62
|
+
|
63
|
+
# single item insert; no data
|
64
|
+
f.control.insert('integer2', 3)
|
65
|
+
assert_equal(12, f.control.count)
|
66
|
+
assert_equal('integer2', f.control.get_string(3))
|
67
|
+
assert_equal(nil, f.control.get_item_data(3))
|
68
|
+
|
69
|
+
# single item insert; with data
|
70
|
+
f.control.insert('array2', 4, 110)
|
71
|
+
assert_equal(13, f.control.count)
|
72
|
+
assert_equal('array2', f.control.get_string(4))
|
73
|
+
assert_equal(110, f.control.get_item_data(4))
|
74
|
+
|
75
|
+
# array item insert; no data
|
76
|
+
f.control.insert(%w[set2 tree2 bag2], 5)
|
77
|
+
assert_equal(16, f.control.count)
|
78
|
+
assert_equal(nil, f.control.get_item_data(5))
|
79
|
+
assert_equal(nil, f.control.get_item_data(7))
|
80
|
+
|
81
|
+
# array item insert; with data
|
82
|
+
f.control.insert(%w[object2 module2 class2], 8, ['O', 'M', 'C'])
|
83
|
+
assert_equal(19, f.control.count)
|
84
|
+
assert_equal('O', f.control.get_item_data(8))
|
85
|
+
assert_equal('C', f.control.get_item_data(10))
|
86
|
+
|
87
|
+
GC.start
|
88
|
+
|
89
|
+
# item delete
|
90
|
+
f.control.delete(8)
|
91
|
+
assert_equal(18, f.control.count)
|
92
|
+
assert_equal('M', f.control.get_item_data(8))
|
93
|
+
|
94
|
+
GC.start
|
95
|
+
|
96
|
+
# clear all
|
97
|
+
f.control.clear
|
98
|
+
assert_equal(0, f.control.count)
|
99
|
+
|
100
|
+
GC.start
|
34
101
|
end
|
35
102
|
|
36
103
|
def test_treectrl_itemdata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wxruby3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0.pre.beta.
|
4
|
+
version: 0.9.0.pre.beta.10
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Martin Corino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -483,6 +483,7 @@ files:
|
|
483
483
|
- lib/wx/doc/pg/pgeditor.rb
|
484
484
|
- lib/wx/doc/pg/property_grid.rb
|
485
485
|
- lib/wx/doc/pg/property_grid_interface.rb
|
486
|
+
- lib/wx/doc/progress_dialog.rb
|
486
487
|
- lib/wx/doc/prt/page_setup_dialog.rb
|
487
488
|
- lib/wx/doc/prt/print_data.rb
|
488
489
|
- lib/wx/doc/prt/print_dialog.rb
|