wxruby3 0.9.0.pre.beta.9-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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/ext/wxbase32u_gcc_custom.dll +0 -0
  3. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  4. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  5. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  6. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  7. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  8. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  9. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  10. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  17. data/lib/wx/core/bitmap.rb +7 -0
  18. data/lib/wx/core/choice.rb +3 -0
  19. data/lib/wx/core/combobox.rb +3 -0
  20. data/lib/wx/core/controlwithitems.rb +98 -2
  21. data/lib/wx/core/icon.rb +7 -1
  22. data/lib/wx/core/imagelist.rb +11 -0
  23. data/lib/wx/core/listbox.rb +3 -0
  24. data/lib/wx/doc/gen/control_with_items.rb +3 -131
  25. data/lib/wx/doc/gen/core.rb +2 -2
  26. data/lib/wx/doc/gen/image_list.rb +9 -10
  27. data/lib/wx/doc/gen/progress_dialog.rb +0 -20
  28. data/lib/wx/doc/gen/prt/print_data.rb +5 -0
  29. data/lib/wx/doc/progress_dialog.rb +37 -0
  30. data/lib/wx/version.rb +1 -1
  31. data/lib/wxruby_aui.so +0 -0
  32. data/lib/wxruby_core.so +0 -0
  33. data/lib/wxruby_grid.so +0 -0
  34. data/lib/wxruby_html.so +0 -0
  35. data/lib/wxruby_pg.so +0 -0
  36. data/lib/wxruby_prt.so +0 -0
  37. data/lib/wxruby_rbn.so +0 -0
  38. data/lib/wxruby_rtc.so +0 -0
  39. data/lib/wxruby_stc.so +0 -0
  40. data/rakelib/lib/config/mingw.rb +3 -0
  41. data/samples/dialogs/dialogs.rb +70 -50
  42. data/samples/drawing/maths_images.rb +1 -1
  43. data/samples/sampler/ext.rb +3 -3
  44. data/samples/sampler/stc_editor.rb +19 -19
  45. data/samples/sampler/txt_editor.rb +2 -2
  46. data/samples/treectrl/treectrl.rb +32 -30
  47. data/tests/test_item_data.rb +67 -0
  48. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67bec337bf61091235deb1a9c5fbefc8498791550ab3d84149000e8be01cd506
4
- data.tar.gz: 9fb4b2a4a770a6d1fe0f53540e70a0c2fc3190e89e8a2ff642fae848b1c74575
3
+ metadata.gz: 7f6e7941faf953aaccbdd3190c6620f078e864099d452047cf549275a288bf89
4
+ data.tar.gz: ff440fc245055bd4ea02623335c4c00068b808b2c2a1314761f3c8f9a8486cbc
5
5
  SHA512:
6
- metadata.gz: 36408e9a7d31a4209d13ac54db02a8686bcb4f8f8a07c3772f1b537cc2200be0c94e0d2faea3fc91a2c9ed1598a83b0a649f6036c70eb4110e86956554b5abec
7
- data.tar.gz: 2c14907e3c38f1ed47de3148f27f3b9cf8bf1c0ef634d9fa08603fd0ac629bdf4aad14a6e1f7184caf5bc03ea222cffbfb1a070dfee065f7c7c934cd964e0f8c
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
@@ -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
 
@@ -1,3 +1,6 @@
1
+
2
+ require_relative './controlwithitems'
3
+
1
4
  class Wx::Choice
2
5
  alias :get_item_data :get_client_data
3
6
  alias :set_item_data :set_client_data
@@ -1,3 +1,6 @@
1
+
2
+ require_relative './controlwithitems'
3
+
1
4
  class Wx::ComboBox
2
5
  alias :get_item_data :get_client_data
3
6
  alias :set_item_data :set_client_data
@@ -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
- # Make these ruby enumerables so find, find_all, map etc are available
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
- 0.upto(get_count - 1) { | i | yield i }
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
@@ -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
@@ -1,3 +1,6 @@
1
+
2
+ require_relative './controlwithitems'
3
+
1
4
  class Wx::ListBox
2
5
  alias :get_item_data :get_client_data
3
6
  alias :set_item_data :set_client_data
@@ -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 [void] Array of client data pointers of the same size as items to associate with the new items.
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 [void] Array of client data pointers of the same size as items to associate with the new items.
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 [void] Array of client data pointers of the same size as items to associate with the new items.
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
@@ -7,10 +7,10 @@
7
7
  module Wx
8
8
 
9
9
  # wxRuby version string
10
- Wx::WXRUBY_VERSION = '0.9.0-beta.9'
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.9'
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
@@ -1,3 +1,3 @@
1
1
  module Wx
2
- WXRUBY_VERSION = '0.9.0-beta.9'
2
+ WXRUBY_VERSION = '0.9.0-beta.10'
3
3
  end
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
@@ -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
@@ -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
- self.sheet_style = Wx::PROPSHEET_BUTTONTOOLBOOK
154
- self.sheet_outer_border = 1
155
- self.sheet_inner_border = 2
156
- img_list = Wx::ImageList.new(32, 32)
157
- img_list << std_bitmap(Wx::ART_NORMAL_FILE)
158
- img_list << std_bitmap(Wx::ART_CDROM)
159
- img_list << std_bitmap(Wx::ART_REPORT_VIEW)
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 = 10
253
+ @max = 100
251
254
 
252
255
  create_status_bar()
253
256
 
254
- evt_menu(DIALOGS_CHOOSE_COLOUR) {|event| on_choose_colour(event) }
255
- evt_menu(DIALOGS_CHOOSE_FONT) {|event| on_choose_font(event) }
256
- evt_menu(DIALOGS_LOG_DIALOG) {|event| on_log_dialog(event) }
257
- evt_menu(DIALOGS_MESSAGE_BOX) {|event| on_message_box(event) }
258
- evt_menu(DIALOGS_TEXT_ENTRY) {|event| on_text_entry(event) }
259
- evt_menu(DIALOGS_PASSWORD_ENTRY) {|event| on_password_entry(event) }
260
- evt_menu(DIALOGS_NUM_ENTRY) {|event| on_numeric_entry(event) }
261
- evt_menu(DIALOGS_SINGLE_CHOICE) {|event| on_single_choice(event) }
262
- evt_menu(DIALOGS_MULTI_CHOICE) {|event| on_multi_choice(event) }
263
- evt_menu(DIALOGS_FILE_OPEN) {|event| on_file_open(event) }
264
- evt_menu(DIALOGS_FILE_OPEN2) {|event| on_file_open2(event) }
265
- evt_menu(DIALOGS_FILES_OPEN) {|event| on_files_open(event) }
266
- evt_menu(DIALOGS_FILE_SAVE) {|event| on_file_save(event) }
267
- evt_menu(DIALOGS_DIR_CHOOSE) {|event| on_dir_choose(event) }
268
- evt_menu(DIALOGS_MODAL) {|event| on_modal_dlg(event) }
269
- evt_menu(DIALOGS_MODELESS) {|event| on_modeless_dlg(event) }
270
- evt_menu(DIALOGS_TIP) {|event| on_show_tip(event) }
271
- evt_menu(DIALOGS_CUSTOM_TIP) {|event| on_show_custom_tip(event) }
272
- evt_menu(DIALOGS_PROGRESS) {|event| on_show_progress(event) }
273
- evt_menu(DIALOGS_BUSYINFO) {|event| on_show_busy_info(event) }
274
- evt_menu(DIALOGS_STYLED_BUSYINFO) {|event| on_show_styled_busy_info(event) }
275
- evt_menu(DIALOGS_PREFS) {|event| on_show_prefs(event) }
276
- evt_menu(DIALOGS_FIND) {|event| on_show_find_dialog(event) }
277
- evt_menu(DIALOGS_REPLACE) {|event| on_show_replace_dialog(event) }
278
- evt_find(-1) {|event| on_find_dialog(event) }
279
- evt_find_next(-1) {|event| on_find_dialog(event) }
280
- evt_find_replace(-1) {|event| on_find_dialog(event) }
281
- evt_find_replace_all(-1) {|event| on_find_dialog(event) }
282
- evt_find_close(-1) {|event| on_find_dialog(event) }
283
- evt_menu(ID_EXIT) {|event| on_exit(event) }
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
- (@max+1).times do |i|
631
- if i == @max
632
- cont = dialog.update(i, "That's all, folks!")
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, "Propert&y sheet dialog\tCtrl-Y")
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|
@@ -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,21 +117,21 @@ 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('SlateGray'))
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('DarkSlateGray'))
124
- style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('DARKGREEN'))
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('Teal'))
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('GREY'))
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('DARKBLUE'))
134
+ style_set_foreground(SCE_RB_SYMBOL, Wx::Colour.new('Navy'))
135
135
  style_set_bold(SCE_RB_SYMBOL, true)
136
136
  if Wx::WXWIDGETS_VERSION >= '3.3.0'
137
137
  style_set_foreground(SCE_RB_HERE_DELIM, Wx::BLACK)
@@ -145,8 +145,8 @@ module WxRuby
145
145
  style_set_foreground(SCE_RB_STRING_QR, c_maroon)
146
146
  style_set_foreground(SCE_RB_STRING_QW, c_maroon)
147
147
  end
148
- bg = Wx::Colour.new('LightGray')
149
- fg = Wx::Colour.new('DarkCyan')
148
+ bg = Wx::Colour.new('Light Grey')
149
+ fg = Wx::Colour.new('Cadet Blue')
150
150
  set_fold_margin_colour(true, bg)
151
151
  set_fold_margin_hi_colour(true, bg)
152
152
  marker_set_foreground(Wx::STC::STC_MARKNUM_FOLDER, fg)
@@ -156,8 +156,8 @@ module WxRuby
156
156
  end
157
157
 
158
158
  def dark_theme
159
- bg = Wx::Colour.new('DarkSlateGray')
160
- c_str = Wx::Colour.new('LimeGreen')
159
+ bg = Wx::Colour.new('Dark Slate Grey')
160
+ c_str = Wx::Colour.new('Lime Green')
161
161
  style_set_background(Wx::STC::STC_STYLE_DEFAULT, bg)
162
162
  style_set_foreground(Wx::STC::STC_STYLE_DEFAULT, Wx::WHITE)
163
163
  style_clear_all
@@ -166,28 +166,28 @@ module WxRuby
166
166
  style_set_foreground(Wx::STC::STC_STYLE_INDENTGUIDE, bg);
167
167
  set_whitespace_background(true, bg)
168
168
  style_set_eol_filled(SCE_RB_DEFAULT, true)
169
- style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('Silver'))
169
+ style_set_foreground(SCE_RB_COMMENTLINE, Wx::Colour.new('Light Grey'))
170
170
  style_set_background(SCE_RB_COMMENTLINE, bg)
171
171
  style_set_bold(SCE_RB_COMMENTLINE, true)
172
- style_set_foreground(SCE_RB_WORD, Wx::Colour.new('Chocolate'))
172
+ style_set_foreground(SCE_RB_WORD, Wx::Colour.new('Coral'))
173
173
  style_set_background(SCE_RB_WORD, bg)
174
174
  style_set_bold(SCE_RB_WORD, true)
175
- style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('LightCyan'))
175
+ style_set_foreground(SCE_RB_OPERATOR, Wx::Colour.new('Light Grey'))
176
176
  style_set_background(SCE_RB_OPERATOR, bg)
177
177
  style_set_bold(SCE_RB_OPERATOR, true)
178
- style_set_foreground(SCE_RB_POD, Wx::Colour.new('Gray'))
178
+ style_set_foreground(SCE_RB_POD, Wx::Colour.new('Grey'))
179
179
  style_set_background(SCE_RB_POD, bg)
180
- style_set_foreground(SCE_RB_NUMBER, Wx::Colour.new('DeepSkyBlue'))
180
+ style_set_foreground(SCE_RB_NUMBER, Wx::Colour.new('Cyan'))
181
181
  style_set_background(SCE_RB_NUMBER, bg)
182
182
  style_set_foreground(SCE_RB_STRING, c_str)
183
183
  style_set_background(SCE_RB_STRING, bg)
184
- style_set_foreground(SCE_RB_CHARACTER, Wx::Colour.new('YellowGreen'))
184
+ style_set_foreground(SCE_RB_CHARACTER, Wx::Colour.new('Yellow Green'))
185
185
  style_set_background(SCE_RB_CHARACTER, bg)
186
186
  style_set_foreground(SCE_RB_SYMBOL, Wx::Colour.new('Gold'))
187
187
  style_set_background(SCE_RB_SYMBOL, bg)
188
188
  style_set_bold(SCE_RB_SYMBOL, true)
189
189
  if Wx::WXWIDGETS_VERSION >= '3.3.0'
190
- style_set_foreground(SCE_RB_HERE_DELIM, Wx::Colour.new('Chocolate'))
190
+ style_set_foreground(SCE_RB_HERE_DELIM, Wx::Colour.new('Coral'))
191
191
  style_set_bold(SCE_RB_HERE_DELIM, true)
192
192
  style_set_foreground(SCE_RB_HERE_Q, c_str)
193
193
  style_set_foreground(SCE_RB_HERE_QQ, c_str)
@@ -198,8 +198,8 @@ module WxRuby
198
198
  style_set_foreground(SCE_RB_STRING_QR, c_str)
199
199
  style_set_foreground(SCE_RB_STRING_QW, c_str)
200
200
  end
201
- bg = Wx::Colour.new('CadetBlue')
202
- fg = Wx::Colour.new('Chocolate')
201
+ bg = Wx::Colour.new('Cadet Blue')
202
+ fg = Wx::Colour.new('Coral')
203
203
  set_fold_margin_colour(true, bg)
204
204
  set_fold_margin_hi_colour(true, bg)
205
205
  marker_set_foreground(Wx::STC::STC_MARKNUM_FOLDER, fg)
@@ -35,9 +35,9 @@ module WxRuby
35
35
  end
36
36
 
37
37
  def dark_theme
38
- self.background_colour = Wx::Colour.new('DarkSlateGray')
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('DarkSlateGray'), self.font))
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
 
@@ -262,39 +262,41 @@ class MyTreeCtrl < Wx::TreeCtrl
262
262
  end
263
263
 
264
264
  def create_buttons_image_list(size)
265
- if size < 0
266
- self.buttons_image_list = nil
267
- return
268
- end
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
- # should correspond to TreeCtrlIcon_xxx enum
274
- Wx::BusyCursor.busy do
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
- icons.each do |ic|
289
- if ic.width == size
290
- images.add(ic)
291
- else
292
- resized = ic.convert_to_image.rescale(size, size)
293
- images.add(Wx::Bitmap.new(resized))
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
- self.buttons_image_list = images
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.has_feature?(:WXMSW)
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
@@ -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.9
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-04-28 00:00:00.000000000 Z
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