fxruby 1.6.8 → 1.6.9

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fox16/kwargs.rb DELETED
@@ -1,2716 +0,0 @@
1
- require 'fox16'
2
-
3
- module Fox
4
-
5
-
6
- class FX4Splitter
7
- alias old_initialize initialize
8
- def initialize(p, *args, &blk)
9
- argument_names = %w{opts x y width height}
10
- default_params = { :opts => FOURSPLITTER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
11
- params = {}
12
- params = args.pop if args.last.is_a? Hash
13
- if args.length > 0 && (args.first.nil? || args.first.is_a?(FXObject))
14
- tgt, sel = args[0], args[1]
15
- args.each_with_index { |e, i| params[argument_names[i-2].intern] = e if i >= 2 }
16
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
17
- params = default_params.merge(params)
18
- old_initialize(p, tgt, sel, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
19
- else
20
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
21
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
22
- params = default_params.merge(params)
23
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
24
- end
25
- end
26
- end
27
-
28
- class FXDockBar
29
- alias old_initialize initialize
30
- def initialize(p, *args, &blk)
31
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
32
- default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
33
- params = {}
34
- params = args.pop if args.last.is_a? Hash
35
- if args.length > 0 && (args.first.nil? || args.first.is_a?(FXComposite))
36
- q = args[0]
37
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
38
- if params.key? :padding
39
- value = params.delete(:padding)
40
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
41
- end
42
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
43
- params = default_params.merge(params)
44
- old_initialize(p, q, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
45
- else
46
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
47
- if params.key? :padding
48
- value = params.delete(:padding)
49
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
50
- end
51
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
52
- params = default_params.merge(params)
53
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
54
- end
55
- end
56
- end
57
-
58
- class FXFont
59
- alias old_initialize initialize
60
- def initialize(a, arg1, *args, &blk)
61
- if args.length > 0
62
- face, size = arg1, args[0]
63
- argument_names = %w{weight slant encoding setWidth hints}
64
- default_params = { :weight => FXFont::Normal, :slant => FXFont::Straight, :encoding => FONTENCODING_DEFAULT, :setWidth => FXFont::NonExpanded, :hints => 0 }
65
- params = {}
66
- params = args.pop if args.last.is_a? Hash
67
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
68
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
69
- params = default_params.merge(params)
70
- old_initialize(a, face, size, params[:weight], params[:slant], params[:encoding], params[:setWidth], params[:hints], &blk)
71
- else
72
- old_initialize(a, arg1, &blk)
73
- end
74
- end
75
- end
76
-
77
- class FXGLCanvas
78
- alias old_initialize initialize
79
- def initialize(parent, vis, *args, &blk)
80
- argument_names = %w{target selector opts x y width height}
81
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
82
- params = {}
83
- params = args.pop if args.last.is_a? Hash
84
- if args.length > 0 && (args[0].is_a?(FXGLCanvas))
85
- sharegroup = args[0]
86
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
87
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
88
- params = default_params.merge(params)
89
- old_initialize(parent, vis, sharegroup, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
90
- else
91
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
92
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
93
- params = default_params.merge(params)
94
- old_initialize(parent, vis, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
95
- end
96
- end
97
- end
98
-
99
- class FXGLViewer
100
- alias old_initialize initialize
101
- def initialize(parent, vis, *args, &blk)
102
- argument_names = %w{target selector opts x y width height}
103
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
104
- params = {}
105
- params = args.pop if args.last.is_a? Hash
106
- if args.length > 0 && (args[0].is_a?(FXGLViewer))
107
- sharegroup = args[0]
108
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
109
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
110
- params = default_params.merge(params)
111
- old_initialize(parent, vis, sharegroup, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
112
- else
113
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
114
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
115
- params = default_params.merge(params)
116
- old_initialize(parent, vis, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
117
- end
118
- end
119
- end
120
-
121
- class FXMenuBar
122
- alias old_initialize initialize
123
- def initialize(p, *args, &blk)
124
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
125
- default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
126
- params = {}
127
- params = args.pop if args.last.is_a? Hash
128
- if args.length > 0 && (args[0].nil? || args[0].is_a?(FXComposite))
129
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
130
- if params.key? :padding
131
- value = params.delete(:padding)
132
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
133
- end
134
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
135
- params = default_params.merge(params)
136
- old_initialize(p, q, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
137
- else
138
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
139
- if params.key? :padding
140
- value = params.delete(:padding)
141
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
142
- end
143
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
144
- params = default_params.merge(params)
145
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
146
- end
147
- end
148
- end
149
-
150
- class FXSplitter
151
- alias old_initialize initialize
152
- def initialize(p, *args, &blk)
153
- argument_names = %w{opts x y width height}
154
- default_params = { :opts => SPLITTER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
155
- params = {}
156
- params = args.pop if args.last.is_a? Hash
157
- if args.length > 0 && (args.first.nil? || args.first.is_a?(FXObject))
158
- tgt, sel = args[0], args[1]
159
- args.each_with_index { |e, i| params[argument_names[i-2].intern] = e if i >= 2 }
160
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
161
- params = default_params.merge(params)
162
- old_initialize(p, tgt, sel, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
163
- else
164
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
165
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
166
- params = default_params.merge(params)
167
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
168
- end
169
- end
170
- end
171
-
172
- class FXToolBar
173
- alias old_initialize initialize
174
- def initialize(p, *args, &blk)
175
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
176
- default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
177
- params = {}
178
- params = args.pop if args.last.is_a? Hash
179
- if args.length > 0 && (args[0].nil? || args[0].is_a?(FXComposite))
180
- q = args[0]
181
- args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
182
- if params.key? :padding
183
- value = params.delete(:padding)
184
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
185
- end
186
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
187
- params = default_params.merge(params)
188
- old_initialize(p, q, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
189
- else
190
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
191
- if params.key? :padding
192
- value = params.delete(:padding)
193
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
194
- end
195
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
196
- params = default_params.merge(params)
197
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
198
- end
199
- end
200
- end
201
-
202
- class FXWindow
203
- alias old_initialize initialize
204
- def initialize(p, *args, &blk)
205
- if p.is_a? FXApp
206
- old_initialize(p, *args, &blk)
207
- else
208
- argument_names = %w{opts x y width height}
209
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
210
- params = {}
211
- params = args.pop if args.last.is_a? Hash
212
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
213
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
214
- params = default_params.merge(params)
215
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
216
- end
217
- end
218
- end
219
-
220
- class FX7Segment
221
- alias old_initialize initialize
222
- def initialize(p, text, *args, &blk)
223
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
224
- default_params = { :opts => SEVENSEGMENT_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
225
- params = {}
226
- params = args.pop if args.last.is_a? Hash
227
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
228
- if params.key? :padding
229
- value = params.delete(:padding)
230
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
231
- end
232
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
233
- params = default_params.merge(params)
234
- old_initialize(p, text, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
235
- end
236
- end
237
-
238
- class FXApp
239
- alias old_initialize initialize
240
- def initialize(*args, &blk)
241
- argument_names = %w{appName vendorName}
242
- default_params = { :appName => "Application", :vendorName => "FoxDefault" }
243
- params = {}
244
- params = args.pop if args.last.is_a? Hash
245
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
246
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
247
- params = default_params.merge(params)
248
- old_initialize(params[:appName], params[:vendorName], &blk)
249
- end
250
- end
251
-
252
- class FXArrowButton
253
- alias old_initialize initialize
254
- def initialize(parent, *args, &blk)
255
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
256
- default_params = { :target => nil, :selector => 0, :opts => ARROW_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
257
- params = {}
258
- params = args.pop if args.last.is_a? Hash
259
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
260
- if params.key? :padding
261
- value = params.delete(:padding)
262
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
263
- end
264
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
265
- params = default_params.merge(params)
266
- old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
267
- end
268
- end
269
-
270
- class FXBitmap
271
- alias old_initialize initialize
272
- def initialize(app, *args, &blk)
273
- argument_names = %w{pixels opts width height}
274
- default_params = { :pixels => nil, :opts => 0, :width => 1, :height => 1 }
275
- params = {}
276
- params = args.pop if args.last.is_a? Hash
277
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
278
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
279
- params = default_params.merge(params)
280
- old_initialize(app, params[:pixels], params[:opts], params[:width], params[:height], &blk)
281
- end
282
- end
283
-
284
- class FXBitmapFrame
285
- alias old_initialize initialize
286
- def initialize(p, bmp, *args, &blk)
287
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
288
- default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
289
- params = {}
290
- params = args.pop if args.last.is_a? Hash
291
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
292
- if params.key? :padding
293
- value = params.delete(:padding)
294
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
295
- end
296
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
297
- params = default_params.merge(params)
298
- old_initialize(p, bmp, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
299
- end
300
- end
301
-
302
- class FXBitmapView
303
- alias old_initialize initialize
304
- def initialize(p, *args, &blk)
305
- argument_names = %w{bmp target selector opts x y width height}
306
- default_params = { :bmp => nil, :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
307
- params = {}
308
- params = args.pop if args.last.is_a? Hash
309
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
310
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
311
- params = default_params.merge(params)
312
- old_initialize(p, params[:bmp], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
313
- end
314
- end
315
-
316
- class FXBMPIcon
317
- alias old_initialize initialize
318
- def initialize(a, *args, &blk)
319
- argument_names = %w{pix clr opts width height}
320
- default_params = { :pix => nil, :clr => FXRGB(192,192,192), :opts => 0, :width => 1, :height => 1 }
321
- params = {}
322
- params = args.pop if args.last.is_a? Hash
323
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
324
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
325
- params = default_params.merge(params)
326
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
327
- end
328
- end
329
-
330
- class FXBMPImage
331
- alias old_initialize initialize
332
- def initialize(a, *args, &blk)
333
- argument_names = %w{pix opts width height}
334
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
335
- params = {}
336
- params = args.pop if args.last.is_a? Hash
337
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
338
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
339
- params = default_params.merge(params)
340
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
341
- end
342
- end
343
-
344
- class FXButton
345
- alias old_initialize initialize
346
- def initialize(parent, text, *args, &blk)
347
- argument_names = %w{icon target selector opts x y width height padLeft padRight padTop padBottom}
348
- default_params = { :icon => nil, :target => nil, :selector => 0, :opts => BUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
349
- params = {}
350
- params = args.pop if args.last.is_a? Hash
351
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
352
- if params.key? :padding
353
- value = params.delete(:padding)
354
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
355
- end
356
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
357
- params = default_params.merge(params)
358
- old_initialize(parent, text, params[:icon], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
359
- end
360
- end
361
-
362
- class FXCanvas
363
- alias old_initialize initialize
364
- def initialize(parent, *args, &blk)
365
- argument_names = %w{target selector opts x y width height}
366
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
367
- params = {}
368
- params = args.pop if args.last.is_a? Hash
369
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
370
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
371
- params = default_params.merge(params)
372
- old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
373
- end
374
- end
375
-
376
- class FXCheckButton
377
- alias old_initialize initialize
378
- def initialize(parent, text, *args, &blk)
379
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
380
- default_params = { :target => nil, :selector => 0, :opts => CHECKBUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
381
- params = {}
382
- params = args.pop if args.last.is_a? Hash
383
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
384
- if params.key? :padding
385
- value = params.delete(:padding)
386
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
387
- end
388
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
389
- params = default_params.merge(params)
390
- old_initialize(parent, text, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
391
- end
392
- end
393
-
394
- class FXChoiceBox
395
- alias old_initialize initialize
396
- def initialize(owner, caption, text, icon, choices, *args, &blk)
397
- argument_names = %w{opts x y width height}
398
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
399
- params = {}
400
- params = args.pop if args.last.is_a? Hash
401
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
402
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
403
- params = default_params.merge(params)
404
- old_initialize(owner, caption, text, icon, choices, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
405
- end
406
- end
407
-
408
- class FXColorBar
409
- alias old_initialize initialize
410
- def initialize(parent, *args, &blk)
411
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
412
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
413
- params = {}
414
- params = args.pop if args.last.is_a? Hash
415
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
416
- if params.key? :padding
417
- value = params.delete(:padding)
418
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
419
- end
420
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
421
- params = default_params.merge(params)
422
- old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
423
- end
424
- end
425
-
426
- class FXColorDialog
427
- alias old_initialize initialize
428
- def initialize(owner, title, *args, &blk)
429
- argument_names = %w{opts x y width height}
430
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
431
- params = {}
432
- params = args.pop if args.last.is_a? Hash
433
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
434
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
435
- params = default_params.merge(params)
436
- old_initialize(owner, title, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
437
- end
438
- end
439
-
440
- class FXColorItem
441
- alias old_initialize initialize
442
- def initialize(text, clr, *args, &blk)
443
- argument_names = %w{data}
444
- default_params = { :data => nil }
445
- params = {}
446
- params = args.pop if args.last.is_a? Hash
447
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
448
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
449
- params = default_params.merge(params)
450
- old_initialize(text, clr, params[:data], &blk)
451
- end
452
- end
453
-
454
- class FXColorList
455
- alias old_initialize initialize
456
- def initialize(p, *args, &blk)
457
- argument_names = %w{target selector opts x y width height}
458
- default_params = { :target => nil, :selector => 0, :opts => LIST_BROWSESELECT, :x => 0, :y => 0, :width => 0, :height => 0 }
459
- params = {}
460
- params = args.pop if args.last.is_a? Hash
461
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
462
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
463
- params = default_params.merge(params)
464
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
465
- end
466
- end
467
-
468
- class FXColorRing
469
- alias old_initialize initialize
470
- def initialize(p, *args, &blk)
471
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
472
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
473
- params = {}
474
- params = args.pop if args.last.is_a? Hash
475
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
476
- if params.key? :padding
477
- value = params.delete(:padding)
478
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
479
- end
480
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
481
- params = default_params.merge(params)
482
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
483
- end
484
- end
485
-
486
- class FXColorSelector
487
- alias old_initialize initialize
488
- def initialize(parent, *args, &blk)
489
- argument_names = %w{target selector opts x y width height}
490
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
491
- params = {}
492
- params = args.pop if args.last.is_a? Hash
493
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
494
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
495
- params = default_params.merge(params)
496
- old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
497
- end
498
- end
499
-
500
- class FXColorWell
501
- alias old_initialize initialize
502
- def initialize(parent, *args, &blk)
503
- argument_names = %w{color target selector opts x y width height padLeft padRight padTop padBottom}
504
- default_params = { :color => 0, :target => nil, :selector => 0, :opts => COLORWELL_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
505
- params = {}
506
- params = args.pop if args.last.is_a? Hash
507
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
508
- if params.key? :padding
509
- value = params.delete(:padding)
510
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
511
- end
512
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
513
- params = default_params.merge(params)
514
- old_initialize(parent, params[:color], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
515
- end
516
- end
517
-
518
- class FXColorWheel
519
- alias old_initialize initialize
520
- def initialize(p, *args, &blk)
521
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
522
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
523
- params = {}
524
- params = args.pop if args.last.is_a? Hash
525
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
526
- if params.key? :padding
527
- value = params.delete(:padding)
528
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
529
- end
530
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
531
- params = default_params.merge(params)
532
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
533
- end
534
- end
535
-
536
- class FXComboBox
537
- alias old_initialize initialize
538
- def initialize(p, cols, *args, &blk)
539
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
540
- default_params = { :target => nil, :selector => 0, :opts => COMBOBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
541
- params = {}
542
- params = args.pop if args.last.is_a? Hash
543
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
544
- if params.key? :padding
545
- value = params.delete(:padding)
546
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
547
- end
548
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
549
- params = default_params.merge(params)
550
- old_initialize(p, cols, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
551
- end
552
- end
553
-
554
- class FXComposite
555
- alias old_initialize initialize
556
- def initialize(parent, *args, &blk)
557
- argument_names = %w{opts x y width height}
558
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
559
- params = {}
560
- params = args.pop if args.last.is_a? Hash
561
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
562
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
563
- params = default_params.merge(params)
564
- old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
565
- end
566
- end
567
-
568
- class FXDataTarget
569
- alias old_initialize initialize
570
- def initialize(*args, &blk)
571
- argument_names = %w{value target selector}
572
- default_params = { :value => nil, :target => nil, :selector => 0 }
573
- params = {}
574
- params = args.pop if args.last.is_a? Hash
575
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
576
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
577
- params = default_params.merge(params)
578
- old_initialize(params[:value], params[:target], params[:selector], &blk)
579
- end
580
- end
581
-
582
- class FXDelegator
583
- alias old_initialize initialize
584
- def initialize(*args, &blk)
585
- argument_names = %w{delegate}
586
- default_params = { :delegate => nil }
587
- params = {}
588
- params = args.pop if args.last.is_a? Hash
589
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
590
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
591
- params = default_params.merge(params)
592
- old_initialize(params[:delegate], &blk)
593
- end
594
- end
595
-
596
- class FXDial
597
- alias old_initialize initialize
598
- def initialize(p, *args, &blk)
599
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
600
- default_params = { :target => nil, :selector => 0, :opts => DIAL_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
601
- params = {}
602
- params = args.pop if args.last.is_a? Hash
603
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
604
- if params.key? :padding
605
- value = params.delete(:padding)
606
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
607
- end
608
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
609
- params = default_params.merge(params)
610
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
611
- end
612
- end
613
-
614
- class FXDialogBox
615
- alias old_initialize initialize
616
- def initialize(owner, title, *args, &blk)
617
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
618
- default_params = { :opts => DECOR_TITLE|DECOR_BORDER, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 10, :padRight => 10, :padTop => 10, :padBottom => 10, :hSpacing => 4, :vSpacing => 4 }
619
- params = {}
620
- params = args.pop if args.last.is_a? Hash
621
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
622
- if params.key? :padding
623
- value = params.delete(:padding)
624
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
625
- end
626
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
627
- params = default_params.merge(params)
628
- old_initialize(owner, title, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
629
- end
630
- end
631
-
632
- class FXDirBox
633
- alias old_initialize initialize
634
- def initialize(p, *args, &blk)
635
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
636
- default_params = { :target => nil, :selector => 0, :opts => FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
637
- params = {}
638
- params = args.pop if args.last.is_a? Hash
639
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
640
- if params.key? :padding
641
- value = params.delete(:padding)
642
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
643
- end
644
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
645
- params = default_params.merge(params)
646
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
647
- end
648
- end
649
-
650
- class FXDirDialog
651
- alias old_initialize initialize
652
- def initialize(owner, name, *args, &blk)
653
- argument_names = %w{opts x y width height}
654
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 500, :height => 300 }
655
- params = {}
656
- params = args.pop if args.last.is_a? Hash
657
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
658
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
659
- params = default_params.merge(params)
660
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
661
- end
662
- end
663
-
664
- class FXDirItem
665
- alias old_initialize initialize
666
- def initialize(text, *args, &blk)
667
- argument_names = %w{oi ci data}
668
- default_params = { :oi => nil, :ci => nil, :data => nil }
669
- params = {}
670
- params = args.pop if args.last.is_a? Hash
671
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
672
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
673
- params = default_params.merge(params)
674
- old_initialize(text, params[:oi], params[:ci], params[:data], &blk)
675
- end
676
- end
677
-
678
- class FXDirList
679
- alias old_initialize initialize
680
- def initialize(p, *args, &blk)
681
- argument_names = %w{target selector opts x y width height}
682
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
683
- params = {}
684
- params = args.pop if args.last.is_a? Hash
685
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
686
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
687
- params = default_params.merge(params)
688
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
689
- end
690
- end
691
-
692
- class FXDirSelector
693
- alias old_initialize initialize
694
- def initialize(p, *args, &blk)
695
- argument_names = %w{target selector opts x y width height}
696
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
697
- params = {}
698
- params = args.pop if args.last.is_a? Hash
699
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
700
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
701
- params = default_params.merge(params)
702
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
703
- end
704
- end
705
-
706
- class FXDockSite
707
- alias old_initialize initialize
708
- def initialize(p, *args, &blk)
709
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
710
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0, :hSpacing => 0, :vSpacing => 0 }
711
- params = {}
712
- params = args.pop if args.last.is_a? Hash
713
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
714
- if params.key? :padding
715
- value = params.delete(:padding)
716
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
717
- end
718
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
719
- params = default_params.merge(params)
720
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
721
- end
722
- end
723
-
724
- class FXDockTitle
725
- alias old_initialize initialize
726
- def initialize(p, text, *args, &blk)
727
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
728
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
729
- params = {}
730
- params = args.pop if args.last.is_a? Hash
731
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
732
- if params.key? :padding
733
- value = params.delete(:padding)
734
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
735
- end
736
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
737
- params = default_params.merge(params)
738
- old_initialize(p, text, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
739
- end
740
- end
741
-
742
- class FXDriveBox
743
- alias old_initialize initialize
744
- def initialize(p, *args, &blk)
745
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
746
- default_params = { :target => nil, :selector => 0, :opts => FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
747
- params = {}
748
- params = args.pop if args.last.is_a? Hash
749
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
750
- if params.key? :padding
751
- value = params.delete(:padding)
752
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
753
- end
754
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
755
- params = default_params.merge(params)
756
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
757
- end
758
- end
759
-
760
- class FXFileDialog
761
- alias old_initialize initialize
762
- def initialize(owner, name, *args, &blk)
763
- argument_names = %w{opts x y width height}
764
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 500, :height => 300 }
765
- params = {}
766
- params = args.pop if args.last.is_a? Hash
767
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
768
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
769
- params = default_params.merge(params)
770
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
771
- end
772
- end
773
-
774
- class FXFileDict
775
- alias old_initialize initialize
776
- def initialize(app, *args, &blk)
777
- argument_names = %w{db}
778
- default_params = { :db => nil }
779
- params = {}
780
- params = args.pop if args.last.is_a? Hash
781
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
782
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
783
- params = default_params.merge(params)
784
- old_initialize(app, params[:db], &blk)
785
- end
786
- end
787
-
788
- class FXFileItem
789
- alias old_initialize initialize
790
- def initialize(text, *args, &blk)
791
- argument_names = %w{bi mi ptr}
792
- default_params = { :bi => nil, :mi => nil, :ptr => nil }
793
- params = {}
794
- params = args.pop if args.last.is_a? Hash
795
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
796
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
797
- params = default_params.merge(params)
798
- old_initialize(text, params[:bi], params[:mi], params[:ptr], &blk)
799
- end
800
- end
801
-
802
- class FXFileList
803
- alias old_initialize initialize
804
- def initialize(p, *args, &blk)
805
- argument_names = %w{target selector opts x y width height}
806
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
807
- params = {}
808
- params = args.pop if args.last.is_a? Hash
809
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
810
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
811
- params = default_params.merge(params)
812
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
813
- end
814
- end
815
-
816
- class FXFileSelector
817
- alias old_initialize initialize
818
- def initialize(p, *args, &blk)
819
- argument_names = %w{target selector opts x y width height}
820
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
821
- params = {}
822
- params = args.pop if args.last.is_a? Hash
823
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
824
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
825
- params = default_params.merge(params)
826
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
827
- end
828
- end
829
-
830
- class FXFileStream
831
- alias old_initialize initialize
832
- def initialize(*args, &blk)
833
- argument_names = %w{cont}
834
- default_params = { :cont => nil }
835
- params = {}
836
- params = args.pop if args.last.is_a? Hash
837
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
838
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
839
- params = default_params.merge(params)
840
- old_initialize(params[:cont], &blk)
841
- end
842
- end
843
-
844
- class FXFoldingItem
845
- alias old_initialize initialize
846
- def initialize(text, *args, &blk)
847
- argument_names = %w{openIcon closedIcon data}
848
- default_params = { :openIcon => nil, :closedIcon => nil, :data => nil }
849
- params = {}
850
- params = args.pop if args.last.is_a? Hash
851
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
852
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
853
- params = default_params.merge(params)
854
- old_initialize(text, params[:openIcon], params[:closedIcon], params[:data], &blk)
855
- end
856
- end
857
-
858
- class FXFoldingList
859
- alias old_initialize initialize
860
- def initialize(p, *args, &blk)
861
- argument_names = %w{target selector opts x y width height}
862
- default_params = { :target => nil, :selector => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
863
- params = {}
864
- params = args.pop if args.last.is_a? Hash
865
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
866
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
867
- params = default_params.merge(params)
868
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
869
- end
870
- end
871
-
872
- class FXFontDialog
873
- alias old_initialize initialize
874
- def initialize(owner, name, *args, &blk)
875
- argument_names = %w{opts x y width height}
876
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 600, :height => 380 }
877
- params = {}
878
- params = args.pop if args.last.is_a? Hash
879
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
880
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
881
- params = default_params.merge(params)
882
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
883
- end
884
- end
885
-
886
- class FXFontSelector
887
- alias old_initialize initialize
888
- def initialize(p, *args, &blk)
889
- argument_names = %w{target selector opts x y width height}
890
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
891
- params = {}
892
- params = args.pop if args.last.is_a? Hash
893
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
894
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
895
- params = default_params.merge(params)
896
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
897
- end
898
- end
899
-
900
- class FXFrame
901
- alias old_initialize initialize
902
- def initialize(parent, *args, &blk)
903
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
904
- default_params = { :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
905
- params = {}
906
- params = args.pop if args.last.is_a? Hash
907
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
908
- if params.key? :padding
909
- value = params.delete(:padding)
910
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
911
- end
912
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
913
- params = default_params.merge(params)
914
- old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
915
- end
916
- end
917
-
918
- class FXGIFCursor
919
- alias old_initialize initialize
920
- def initialize(a, pix, *args, &blk)
921
- argument_names = %w{hx hy}
922
- default_params = { :hx => -1, :hy => -1 }
923
- params = {}
924
- params = args.pop if args.last.is_a? Hash
925
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
926
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
927
- params = default_params.merge(params)
928
- old_initialize(a, pix, params[:hx], params[:hy], &blk)
929
- end
930
- end
931
-
932
- class FXGIFIcon
933
- alias old_initialize initialize
934
- def initialize(a, *args, &blk)
935
- argument_names = %w{pix clr opts width height}
936
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
937
- params = {}
938
- params = args.pop if args.last.is_a? Hash
939
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
940
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
941
- params = default_params.merge(params)
942
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
943
- end
944
- end
945
-
946
- class FXGIFImage
947
- alias old_initialize initialize
948
- def initialize(a, *args, &blk)
949
- argument_names = %w{pix opts width height}
950
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
951
- params = {}
952
- params = args.pop if args.last.is_a? Hash
953
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
954
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
955
- params = default_params.merge(params)
956
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
957
- end
958
- end
959
-
960
- class FXGLContext
961
- alias old_initialize initialize
962
- def initialize(app, visual, *args, &blk)
963
- argument_names = %w{other}
964
- default_params = { :other => nil }
965
- params = {}
966
- params = args.pop if args.last.is_a? Hash
967
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
968
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
969
- params = default_params.merge(params)
970
- old_initialize(app, visual, params[:other], &blk)
971
- end
972
- end
973
-
974
- class FXGradientBar
975
- alias old_initialize initialize
976
- def initialize(p, *args, &blk)
977
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
978
- default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
979
- params = {}
980
- params = args.pop if args.last.is_a? Hash
981
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
982
- if params.key? :padding
983
- value = params.delete(:padding)
984
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
985
- end
986
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
987
- params = default_params.merge(params)
988
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
989
- end
990
- end
991
-
992
- class FXGroupBox
993
- alias old_initialize initialize
994
- def initialize(parent, text, *args, &blk)
995
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
996
- default_params = { :opts => GROUPBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
997
- params = {}
998
- params = args.pop if args.last.is_a? Hash
999
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1000
- if params.key? :padding
1001
- value = params.delete(:padding)
1002
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1003
- end
1004
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1005
- params = default_params.merge(params)
1006
- old_initialize(parent, text, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
1007
- end
1008
- end
1009
-
1010
- class FXHeaderItem
1011
- alias old_initialize initialize
1012
- def initialize(text, *args, &blk)
1013
- argument_names = %w{ic s ptr}
1014
- default_params = { :ic => nil, :s => 0, :ptr => nil }
1015
- params = {}
1016
- params = args.pop if args.last.is_a? Hash
1017
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1018
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1019
- params = default_params.merge(params)
1020
- old_initialize(text, params[:ic], params[:s], params[:ptr], &blk)
1021
- end
1022
- end
1023
-
1024
- class FXHeader
1025
- alias old_initialize initialize
1026
- def initialize(p, *args, &blk)
1027
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1028
- default_params = { :target => nil, :selector => 0, :opts => HEADER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1029
- params = {}
1030
- params = args.pop if args.last.is_a? Hash
1031
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1032
- if params.key? :padding
1033
- value = params.delete(:padding)
1034
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1035
- end
1036
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1037
- params = default_params.merge(params)
1038
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1039
- end
1040
- end
1041
-
1042
- class FXHorizontalFrame
1043
- alias old_initialize initialize
1044
- def initialize(p, *args, &blk)
1045
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1046
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
1047
- params = {}
1048
- params = args.pop if args.last.is_a? Hash
1049
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1050
- if params.key? :padding
1051
- value = params.delete(:padding)
1052
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1053
- end
1054
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1055
- params = default_params.merge(params)
1056
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
1057
- end
1058
- end
1059
-
1060
- class FXICOIcon
1061
- alias old_initialize initialize
1062
- def initialize(a, *args, &blk)
1063
- argument_names = %w{pix clr opts width height}
1064
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1065
- params = {}
1066
- params = args.pop if args.last.is_a? Hash
1067
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1068
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1069
- params = default_params.merge(params)
1070
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1071
- end
1072
- end
1073
-
1074
- class FXICOImage
1075
- alias old_initialize initialize
1076
- def initialize(a, *args, &blk)
1077
- argument_names = %w{pix opts width height}
1078
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1079
- params = {}
1080
- params = args.pop if args.last.is_a? Hash
1081
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1082
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1083
- params = default_params.merge(params)
1084
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1085
- end
1086
- end
1087
-
1088
- class FXIcon
1089
- alias old_initialize initialize
1090
- def initialize(app, *args, &blk)
1091
- argument_names = %w{pix clr opts width height}
1092
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1093
- params = {}
1094
- params = args.pop if args.last.is_a? Hash
1095
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1096
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1097
- params = default_params.merge(params)
1098
- old_initialize(app, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1099
- end
1100
- end
1101
-
1102
- class FXIconDict
1103
- alias old_initialize initialize
1104
- def initialize(app, *args, &blk)
1105
- argument_names = %w{path}
1106
- default_params = { :path => defaultIconPath }
1107
- params = {}
1108
- params = args.pop if args.last.is_a? Hash
1109
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1110
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1111
- params = default_params.merge(params)
1112
- old_initialize(app, params[:path], &blk)
1113
- end
1114
- end
1115
-
1116
- class FXIconItem
1117
- alias old_initialize initialize
1118
- def initialize(text, *args, &blk)
1119
- argument_names = %w{bigIcon miniIcon data}
1120
- default_params = { :bigIcon => nil, :miniIcon => nil, :data => nil }
1121
- params = {}
1122
- params = args.pop if args.last.is_a? Hash
1123
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1124
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1125
- params = default_params.merge(params)
1126
- old_initialize(text, params[:bigIcon], params[:miniIcon], params[:data], &blk)
1127
- end
1128
- end
1129
-
1130
- class FXIconList
1131
- alias old_initialize initialize
1132
- def initialize(p, *args, &blk)
1133
- argument_names = %w{target selector opts x y width height}
1134
- default_params = { :target => nil, :selector => 0, :opts => ICONLIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1135
- params = {}
1136
- params = args.pop if args.last.is_a? Hash
1137
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1138
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1139
- params = default_params.merge(params)
1140
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1141
- end
1142
- end
1143
-
1144
- class FXImage
1145
- alias old_initialize initialize
1146
- def initialize(a, *args, &blk)
1147
- argument_names = %w{pixels opts width height}
1148
- default_params = { :pixels => nil, :opts => 0, :width => 1, :height => 1 }
1149
- params = {}
1150
- params = args.pop if args.last.is_a? Hash
1151
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1152
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1153
- params = default_params.merge(params)
1154
- old_initialize(a, params[:pixels], params[:opts], params[:width], params[:height], &blk)
1155
- end
1156
- end
1157
-
1158
- class FXImageFrame
1159
- alias old_initialize initialize
1160
- def initialize(p, img, *args, &blk)
1161
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
1162
- default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
1163
- params = {}
1164
- params = args.pop if args.last.is_a? Hash
1165
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1166
- if params.key? :padding
1167
- value = params.delete(:padding)
1168
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1169
- end
1170
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1171
- params = default_params.merge(params)
1172
- old_initialize(p, img, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1173
- end
1174
- end
1175
-
1176
- class FXImageView
1177
- alias old_initialize initialize
1178
- def initialize(p, *args, &blk)
1179
- argument_names = %w{img target selector opts x y width height}
1180
- default_params = { :img => nil, :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1181
- params = {}
1182
- params = args.pop if args.last.is_a? Hash
1183
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1184
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1185
- params = default_params.merge(params)
1186
- old_initialize(p, params[:img], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1187
- end
1188
- end
1189
-
1190
- class FXInputDialog
1191
- alias old_initialize initialize
1192
- def initialize(owner, caption, label, *args, &blk)
1193
- argument_names = %w{icon opts x y width height}
1194
- default_params = { :icon => nil, :opts => INPUTDIALOG_STRING, :x => 0, :y => 0, :width => 0, :height => 0 }
1195
- params = {}
1196
- params = args.pop if args.last.is_a? Hash
1197
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1198
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1199
- params = default_params.merge(params)
1200
- old_initialize(owner, caption, label, params[:icon], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1201
- end
1202
- end
1203
-
1204
- class FXJPGIcon
1205
- alias old_initialize initialize
1206
- def initialize(a, *args, &blk)
1207
- argument_names = %w{pix clr opts width height}
1208
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1209
- params = {}
1210
- params = args.pop if args.last.is_a? Hash
1211
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1212
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1213
- params = default_params.merge(params)
1214
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1215
- end
1216
- end
1217
-
1218
- class FXJPGImage
1219
- alias old_initialize initialize
1220
- def initialize(a, *args, &blk)
1221
- argument_names = %w{pix opts width height}
1222
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1223
- params = {}
1224
- params = args.pop if args.last.is_a? Hash
1225
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1226
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1227
- params = default_params.merge(params)
1228
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1229
- end
1230
- end
1231
-
1232
- class FXKnob
1233
- alias old_initialize initialize
1234
- def initialize(p, *args, &blk)
1235
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1236
- default_params = { :target => nil, :selector => 0, :opts => KNOB_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1237
- params = {}
1238
- params = args.pop if args.last.is_a? Hash
1239
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1240
- if params.key? :padding
1241
- value = params.delete(:padding)
1242
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1243
- end
1244
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1245
- params = default_params.merge(params)
1246
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1247
- end
1248
- end
1249
-
1250
- class FXLabel
1251
- alias old_initialize initialize
1252
- def initialize(parent, text, *args, &blk)
1253
- argument_names = %w{icon opts x y width height padLeft padRight padTop padBottom}
1254
- default_params = { :icon => nil, :opts => LABEL_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1255
- params = {}
1256
- params = args.pop if args.last.is_a? Hash
1257
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1258
- if params.key? :padding
1259
- value = params.delete(:padding)
1260
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1261
- end
1262
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1263
- params = default_params.merge(params)
1264
- old_initialize(parent, text, params[:icon], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1265
- end
1266
- end
1267
-
1268
- class FXListItem
1269
- alias old_initialize initialize
1270
- def initialize(text, *args, &blk)
1271
- argument_names = %w{icon data}
1272
- default_params = { :icon => nil, :data => nil }
1273
- params = {}
1274
- params = args.pop if args.last.is_a? Hash
1275
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1276
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1277
- params = default_params.merge(params)
1278
- old_initialize(text, params[:icon], params[:data], &blk)
1279
- end
1280
- end
1281
-
1282
- class FXList
1283
- alias old_initialize initialize
1284
- def initialize(p, *args, &blk)
1285
- argument_names = %w{target selector opts x y width height}
1286
- default_params = { :target => nil, :selector => 0, :opts => LIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1287
- params = {}
1288
- params = args.pop if args.last.is_a? Hash
1289
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1290
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1291
- params = default_params.merge(params)
1292
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1293
- end
1294
- end
1295
-
1296
- class FXListBox
1297
- alias old_initialize initialize
1298
- def initialize(p, *args, &blk)
1299
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1300
- default_params = { :target => nil, :selector => 0, :opts => FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1301
- params = {}
1302
- params = args.pop if args.last.is_a? Hash
1303
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1304
- if params.key? :padding
1305
- value = params.delete(:padding)
1306
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1307
- end
1308
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1309
- params = default_params.merge(params)
1310
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1311
- end
1312
- end
1313
-
1314
- class FXMainWindow
1315
- alias old_initialize initialize
1316
- def initialize(app, title, *args, &blk)
1317
- argument_names = %w{icon miniIcon opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1318
- default_params = { :icon => nil, :miniIcon => nil, :opts => DECOR_ALL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0, :hSpacing => 4, :vSpacing => 4 }
1319
- params = {}
1320
- params = args.pop if args.last.is_a? Hash
1321
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1322
- if params.key? :padding
1323
- value = params.delete(:padding)
1324
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1325
- end
1326
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1327
- params = default_params.merge(params)
1328
- old_initialize(app, title, params[:icon], params[:miniIcon], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
1329
- end
1330
- end
1331
-
1332
- class FXMatrix
1333
- alias old_initialize initialize
1334
- def initialize(parent, *args, &blk)
1335
- argument_names = %w{n opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1336
- default_params = { :n => 1, :opts => MATRIX_BY_ROWS, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
1337
- params = {}
1338
- params = args.pop if args.last.is_a? Hash
1339
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1340
- if params.key? :padding
1341
- value = params.delete(:padding)
1342
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1343
- end
1344
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1345
- params = default_params.merge(params)
1346
- old_initialize(parent, params[:n], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
1347
- end
1348
- end
1349
-
1350
- class FXMDIDeleteButton
1351
- alias old_initialize initialize
1352
- def initialize(p, *args, &blk)
1353
- argument_names = %w{target selector opts x y width height}
1354
- default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1355
- params = {}
1356
- params = args.pop if args.last.is_a? Hash
1357
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1358
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1359
- params = default_params.merge(params)
1360
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1361
- end
1362
- end
1363
-
1364
- class FXMDIRestoreButton
1365
- alias old_initialize initialize
1366
- def initialize(p, *args, &blk)
1367
- argument_names = %w{target selector opts x y width height}
1368
- default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1369
- params = {}
1370
- params = args.pop if args.last.is_a? Hash
1371
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1372
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1373
- params = default_params.merge(params)
1374
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1375
- end
1376
- end
1377
-
1378
- class FXMDIMaximizeButton
1379
- alias old_initialize initialize
1380
- def initialize(p, *args, &blk)
1381
- argument_names = %w{target selector opts x y width height}
1382
- default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1383
- params = {}
1384
- params = args.pop if args.last.is_a? Hash
1385
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1386
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1387
- params = default_params.merge(params)
1388
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1389
- end
1390
- end
1391
-
1392
- class FXMDIMinimizeButton
1393
- alias old_initialize initialize
1394
- def initialize(p, *args, &blk)
1395
- argument_names = %w{target selector opts x y width height}
1396
- default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1397
- params = {}
1398
- params = args.pop if args.last.is_a? Hash
1399
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1400
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1401
- params = default_params.merge(params)
1402
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1403
- end
1404
- end
1405
-
1406
- class FXMDIWindowButton
1407
- alias old_initialize initialize
1408
- def initialize(p, pup, *args, &blk)
1409
- argument_names = %w{target selector opts x y width height}
1410
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1411
- params = {}
1412
- params = args.pop if args.last.is_a? Hash
1413
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1414
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1415
- params = default_params.merge(params)
1416
- old_initialize(p, pup, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1417
- end
1418
- end
1419
-
1420
- class FXMDIMenu
1421
- alias old_initialize initialize
1422
- def initialize(owner, *args, &blk)
1423
- argument_names = %w{target}
1424
- default_params = { :target => nil }
1425
- params = {}
1426
- params = args.pop if args.last.is_a? Hash
1427
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1428
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1429
- params = default_params.merge(params)
1430
- old_initialize(owner, params[:target], &blk)
1431
- end
1432
- end
1433
-
1434
- class FXMDIChild
1435
- alias old_initialize initialize
1436
- def initialize(p, name, *args, &blk)
1437
- argument_names = %w{ic pup opts x y width height}
1438
- default_params = { :ic => nil, :pup => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1439
- params = {}
1440
- params = args.pop if args.last.is_a? Hash
1441
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1442
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1443
- params = default_params.merge(params)
1444
- old_initialize(p, name, params[:ic], params[:pup], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1445
- end
1446
- end
1447
-
1448
- class FXMDIClient
1449
- alias old_initialize initialize
1450
- def initialize(p, *args, &blk)
1451
- argument_names = %w{opts x y width height}
1452
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1453
- params = {}
1454
- params = args.pop if args.last.is_a? Hash
1455
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1456
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1457
- params = default_params.merge(params)
1458
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1459
- end
1460
- end
1461
-
1462
- class FXMemoryStream
1463
- alias old_initialize initialize
1464
- def initialize(*args, &blk)
1465
- argument_names = %w{cont}
1466
- default_params = { :cont => nil }
1467
- params = {}
1468
- params = args.pop if args.last.is_a? Hash
1469
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1470
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1471
- params = default_params.merge(params)
1472
- old_initialize(params[:cont], &blk)
1473
- end
1474
- end
1475
-
1476
- class FXMenuButton
1477
- alias old_initialize initialize
1478
- def initialize(parent, text, *args, &blk)
1479
- argument_names = %w{icon popupMenu opts x y width height padLeft padRight padTop padBottom}
1480
- default_params = { :icon => nil, :popupMenu => nil, :opts => JUSTIFY_NORMAL|ICON_BEFORE_TEXT|MENUBUTTON_DOWN, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING }
1481
- params = {}
1482
- params = args.pop if args.last.is_a? Hash
1483
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1484
- if params.key? :padding
1485
- value = params.delete(:padding)
1486
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1487
- end
1488
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1489
- params = default_params.merge(params)
1490
- old_initialize(parent, text, params[:icon], params[:popupMenu], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1491
- end
1492
- end
1493
-
1494
- class FXMenuCaption
1495
- alias old_initialize initialize
1496
- def initialize(parent, text, *args, &blk)
1497
- argument_names = %w{icon opts}
1498
- default_params = { :icon => nil, :opts => 0 }
1499
- params = {}
1500
- params = args.pop if args.last.is_a? Hash
1501
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1502
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1503
- params = default_params.merge(params)
1504
- old_initialize(parent, text, params[:icon], params[:opts], &blk)
1505
- end
1506
- end
1507
-
1508
- class FXMenuCascade
1509
- alias old_initialize initialize
1510
- def initialize(parent, text, *args, &blk)
1511
- argument_names = %w{icon popupMenu opts}
1512
- default_params = { :icon => nil, :popupMenu => nil, :opts => 0 }
1513
- params = {}
1514
- params = args.pop if args.last.is_a? Hash
1515
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1516
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1517
- params = default_params.merge(params)
1518
- old_initialize(parent, text, params[:icon], params[:popupMenu], params[:opts], &blk)
1519
- end
1520
- end
1521
-
1522
- class FXMenuCheck
1523
- alias old_initialize initialize
1524
- def initialize(p, text, *args, &blk)
1525
- argument_names = %w{target selector opts}
1526
- default_params = { :target => nil, :selector => 0, :opts => 0 }
1527
- params = {}
1528
- params = args.pop if args.last.is_a? Hash
1529
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1530
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1531
- params = default_params.merge(params)
1532
- old_initialize(p, text, params[:target], params[:selector], params[:opts], &blk)
1533
- end
1534
- end
1535
-
1536
- class FXMenuCommand
1537
- alias old_initialize initialize
1538
- def initialize(p, text, *args, &blk)
1539
- argument_names = %w{ic target selector opts}
1540
- default_params = { :ic => nil, :target => nil, :selector => 0, :opts => 0 }
1541
- params = {}
1542
- params = args.pop if args.last.is_a? Hash
1543
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1544
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1545
- params = default_params.merge(params)
1546
- old_initialize(p, text, params[:ic], params[:target], params[:selector], params[:opts], &blk)
1547
- end
1548
- end
1549
-
1550
- class FXMenuPane
1551
- alias old_initialize initialize
1552
- def initialize(owner, *args, &blk)
1553
- argument_names = %w{opts}
1554
- default_params = { :opts => 0 }
1555
- params = {}
1556
- params = args.pop if args.last.is_a? Hash
1557
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1558
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1559
- params = default_params.merge(params)
1560
- old_initialize(owner, params[:opts], &blk)
1561
- end
1562
- end
1563
-
1564
- class FXMenuRadio
1565
- alias old_initialize initialize
1566
- def initialize(p, text, *args, &blk)
1567
- argument_names = %w{target selector opts}
1568
- default_params = { :target => nil, :selector => 0, :opts => 0 }
1569
- params = {}
1570
- params = args.pop if args.last.is_a? Hash
1571
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1572
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1573
- params = default_params.merge(params)
1574
- old_initialize(p, text, params[:target], params[:selector], params[:opts], &blk)
1575
- end
1576
- end
1577
-
1578
- class FXMenuSeparator
1579
- alias old_initialize initialize
1580
- def initialize(parent, *args, &blk)
1581
- argument_names = %w{opts}
1582
- default_params = { :opts => 0 }
1583
- params = {}
1584
- params = args.pop if args.last.is_a? Hash
1585
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1586
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1587
- params = default_params.merge(params)
1588
- old_initialize(parent, params[:opts], &blk)
1589
- end
1590
- end
1591
-
1592
- class FXMenuTitle
1593
- alias old_initialize initialize
1594
- def initialize(parent, text, *args, &blk)
1595
- argument_names = %w{icon popupMenu opts}
1596
- default_params = { :icon => nil, :popupMenu => nil, :opts => 0 }
1597
- params = {}
1598
- params = args.pop if args.last.is_a? Hash
1599
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1600
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1601
- params = default_params.merge(params)
1602
- old_initialize(parent, text, params[:icon], params[:popupMenu], params[:opts], &blk)
1603
- end
1604
- end
1605
-
1606
- class FXMessageBox
1607
- alias old_initialize initialize
1608
- def initialize(owner, caption, text, *args, &blk)
1609
- argument_names = %w{ic opts x y}
1610
- default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0 }
1611
- params = {}
1612
- params = args.pop if args.last.is_a? Hash
1613
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1614
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1615
- params = default_params.merge(params)
1616
- old_initialize(owner, caption, text, params[:ic], params[:opts], params[:x], params[:y], &blk)
1617
- end
1618
- end
1619
-
1620
- class FXOption
1621
- alias old_initialize initialize
1622
- def initialize(p, text, *args, &blk)
1623
- argument_names = %w{ic target selector opts x y width height padLeft padRight padTop padBottom}
1624
- default_params = { :ic => nil, :target => nil, :selector => 0, :opts => JUSTIFY_NORMAL|ICON_BEFORE_TEXT, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1625
- params = {}
1626
- params = args.pop if args.last.is_a? Hash
1627
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1628
- if params.key? :padding
1629
- value = params.delete(:padding)
1630
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1631
- end
1632
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1633
- params = default_params.merge(params)
1634
- old_initialize(p, text, params[:ic], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1635
- end
1636
- end
1637
-
1638
- class FXOptionMenu
1639
- alias old_initialize initialize
1640
- def initialize(p, *args, &blk)
1641
- argument_names = %w{pup opts x y width height padLeft padRight padTop padBottom}
1642
- default_params = { :pup => nil, :opts => JUSTIFY_NORMAL|ICON_BEFORE_TEXT, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1643
- params = {}
1644
- params = args.pop if args.last.is_a? Hash
1645
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1646
- if params.key? :padding
1647
- value = params.delete(:padding)
1648
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1649
- end
1650
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1651
- params = default_params.merge(params)
1652
- old_initialize(p, params[:pup], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1653
- end
1654
- end
1655
-
1656
- class FXPCXIcon
1657
- alias old_initialize initialize
1658
- def initialize(a, *args, &blk)
1659
- argument_names = %w{pix clr opts width height}
1660
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1661
- params = {}
1662
- params = args.pop if args.last.is_a? Hash
1663
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1664
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1665
- params = default_params.merge(params)
1666
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1667
- end
1668
- end
1669
-
1670
- class FXPCXImage
1671
- alias old_initialize initialize
1672
- def initialize(a, *args, &blk)
1673
- argument_names = %w{pix opts width height}
1674
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1675
- params = {}
1676
- params = args.pop if args.last.is_a? Hash
1677
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1678
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1679
- params = default_params.merge(params)
1680
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1681
- end
1682
- end
1683
-
1684
- class FXPicker
1685
- alias old_initialize initialize
1686
- def initialize(p, text, *args, &blk)
1687
- argument_names = %w{ic target selector opts x y width height padLeft padRight padTop padBottom}
1688
- default_params = { :ic => nil, :target => nil, :selector => 0, :opts => BUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1689
- params = {}
1690
- params = args.pop if args.last.is_a? Hash
1691
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1692
- if params.key? :padding
1693
- value = params.delete(:padding)
1694
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1695
- end
1696
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1697
- params = default_params.merge(params)
1698
- old_initialize(p, text, params[:ic], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1699
- end
1700
- end
1701
-
1702
- class FXPNGIcon
1703
- alias old_initialize initialize
1704
- def initialize(a, *args, &blk)
1705
- argument_names = %w{pix clr opts width height}
1706
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1707
- params = {}
1708
- params = args.pop if args.last.is_a? Hash
1709
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1710
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1711
- params = default_params.merge(params)
1712
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1713
- end
1714
- end
1715
-
1716
- class FXPNGImage
1717
- alias old_initialize initialize
1718
- def initialize(a, *args, &blk)
1719
- argument_names = %w{pix opts width height}
1720
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1721
- params = {}
1722
- params = args.pop if args.last.is_a? Hash
1723
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1724
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1725
- params = default_params.merge(params)
1726
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1727
- end
1728
- end
1729
-
1730
- class FXPopup
1731
- alias old_initialize initialize
1732
- def initialize(owner, *args, &blk)
1733
- argument_names = %w{opts x y width height}
1734
- default_params = { :opts => POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0 }
1735
- params = {}
1736
- params = args.pop if args.last.is_a? Hash
1737
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1738
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1739
- params = default_params.merge(params)
1740
- old_initialize(owner, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1741
- end
1742
- end
1743
-
1744
- class FXPPMIcon
1745
- alias old_initialize initialize
1746
- def initialize(a, *args, &blk)
1747
- argument_names = %w{pix clr opts width height}
1748
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1749
- params = {}
1750
- params = args.pop if args.last.is_a? Hash
1751
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1752
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1753
- params = default_params.merge(params)
1754
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1755
- end
1756
- end
1757
-
1758
- class FXPPMImage
1759
- alias old_initialize initialize
1760
- def initialize(a, *args, &blk)
1761
- argument_names = %w{pix opts width height}
1762
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1763
- params = {}
1764
- params = args.pop if args.last.is_a? Hash
1765
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1766
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1767
- params = default_params.merge(params)
1768
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1769
- end
1770
- end
1771
-
1772
- class FXPrintDialog
1773
- alias old_initialize initialize
1774
- def initialize(owner, name, *args, &blk)
1775
- argument_names = %w{opts x y width height}
1776
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1777
- params = {}
1778
- params = args.pop if args.last.is_a? Hash
1779
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1780
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1781
- params = default_params.merge(params)
1782
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1783
- end
1784
- end
1785
-
1786
- class FXProgressBar
1787
- alias old_initialize initialize
1788
- def initialize(p, *args, &blk)
1789
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1790
- default_params = { :target => nil, :selector => 0, :opts => PROGRESSBAR_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1791
- params = {}
1792
- params = args.pop if args.last.is_a? Hash
1793
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1794
- if params.key? :padding
1795
- value = params.delete(:padding)
1796
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1797
- end
1798
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1799
- params = default_params.merge(params)
1800
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1801
- end
1802
- end
1803
-
1804
- class FXProgressDialog
1805
- alias old_initialize initialize
1806
- def initialize(owner, caption, label, *args, &blk)
1807
- argument_names = %w{opts x y width height}
1808
- default_params = { :opts => PROGRESSDIALOG_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1809
- params = {}
1810
- params = args.pop if args.last.is_a? Hash
1811
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1812
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1813
- params = default_params.merge(params)
1814
- old_initialize(owner, caption, label, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1815
- end
1816
- end
1817
-
1818
- class FXRadioButton
1819
- alias old_initialize initialize
1820
- def initialize(parent, text, *args, &blk)
1821
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1822
- default_params = { :target => nil, :selector => 0, :opts => RADIOBUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1823
- params = {}
1824
- params = args.pop if args.last.is_a? Hash
1825
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1826
- if params.key? :padding
1827
- value = params.delete(:padding)
1828
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1829
- end
1830
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1831
- params = default_params.merge(params)
1832
- old_initialize(parent, text, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1833
- end
1834
- end
1835
-
1836
- class FXRealSlider
1837
- alias old_initialize initialize
1838
- def initialize(p, *args, &blk)
1839
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1840
- default_params = { :target => nil, :selector => 0, :opts => REALSLIDER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
1841
- params = {}
1842
- params = args.pop if args.last.is_a? Hash
1843
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1844
- if params.key? :padding
1845
- value = params.delete(:padding)
1846
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1847
- end
1848
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1849
- params = default_params.merge(params)
1850
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1851
- end
1852
- end
1853
-
1854
- class FXRealSpinner
1855
- alias old_initialize initialize
1856
- def initialize(p, cols, *args, &blk)
1857
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1858
- default_params = { :target => nil, :selector => 0, :opts => REALSPIN_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1859
- params = {}
1860
- params = args.pop if args.last.is_a? Hash
1861
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1862
- if params.key? :padding
1863
- value = params.delete(:padding)
1864
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1865
- end
1866
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1867
- params = default_params.merge(params)
1868
- old_initialize(p, cols, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1869
- end
1870
- end
1871
-
1872
- class FXRegistry
1873
- alias old_initialize initialize
1874
- def initialize(*args, &blk)
1875
- argument_names = %w{appKey vendorKey}
1876
- default_params = { :appKey => "", :vendorKey => "" }
1877
- params = {}
1878
- params = args.pop if args.last.is_a? Hash
1879
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1880
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1881
- params = default_params.merge(params)
1882
- old_initialize(params[:appKey], params[:vendorKey], &blk)
1883
- end
1884
- end
1885
-
1886
- class FXReplaceDialog
1887
- alias old_initialize initialize
1888
- def initialize(owner, caption, *args, &blk)
1889
- argument_names = %w{ic opts x y width height}
1890
- default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1891
- params = {}
1892
- params = args.pop if args.last.is_a? Hash
1893
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1894
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1895
- params = default_params.merge(params)
1896
- old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1897
- end
1898
- end
1899
-
1900
- class FXRGBIcon
1901
- alias old_initialize initialize
1902
- def initialize(a, *args, &blk)
1903
- argument_names = %w{pix clr opts width height}
1904
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1905
- params = {}
1906
- params = args.pop if args.last.is_a? Hash
1907
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1908
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1909
- params = default_params.merge(params)
1910
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
1911
- end
1912
- end
1913
-
1914
- class FXRGBImage
1915
- alias old_initialize initialize
1916
- def initialize(a, *args, &blk)
1917
- argument_names = %w{pix opts width height}
1918
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1919
- params = {}
1920
- params = args.pop if args.last.is_a? Hash
1921
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1922
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1923
- params = default_params.merge(params)
1924
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
1925
- end
1926
- end
1927
-
1928
- class FXRuler
1929
- alias old_initialize initialize
1930
- def initialize(p, *args, &blk)
1931
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1932
- default_params = { :target => nil, :selector => 0, :opts => RULER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
1933
- params = {}
1934
- params = args.pop if args.last.is_a? Hash
1935
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1936
- if params.key? :padding
1937
- value = params.delete(:padding)
1938
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
1939
- end
1940
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1941
- params = default_params.merge(params)
1942
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
1943
- end
1944
- end
1945
-
1946
- class FXRulerView
1947
- alias old_initialize initialize
1948
- def initialize(p, *args, &blk)
1949
- argument_names = %w{target selector opts x y width height}
1950
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1951
- params = {}
1952
- params = args.pop if args.last.is_a? Hash
1953
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1954
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1955
- params = default_params.merge(params)
1956
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1957
- end
1958
- end
1959
-
1960
- class FXScintilla
1961
- alias old_initialize initialize
1962
- def initialize(p, *args, &blk)
1963
- argument_names = %w{target selector opts x y width height}
1964
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1965
- params = {}
1966
- params = args.pop if args.last.is_a? Hash
1967
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1968
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1969
- params = default_params.merge(params)
1970
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1971
- end
1972
- end
1973
-
1974
- class FXScrollArea
1975
- alias old_initialize initialize
1976
- def initialize(parent, *args, &blk)
1977
- argument_names = %w{opts x y width height}
1978
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1979
- params = {}
1980
- params = args.pop if args.last.is_a? Hash
1981
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1982
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1983
- params = default_params.merge(params)
1984
- old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1985
- end
1986
- end
1987
-
1988
- class FXScrollBar
1989
- alias old_initialize initialize
1990
- def initialize(p, *args, &blk)
1991
- argument_names = %w{target selector opts x y width height}
1992
- default_params = { :target => nil, :selector => 0, :opts => SCROLLBAR_VERTICAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1993
- params = {}
1994
- params = args.pop if args.last.is_a? Hash
1995
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1996
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1997
- params = default_params.merge(params)
1998
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
1999
- end
2000
- end
2001
-
2002
- class FXScrollPane
2003
- alias old_initialize initialize
2004
- def initialize(owner, nvis, *args, &blk)
2005
- argument_names = %w{opts}
2006
- default_params = { :opts => 0 }
2007
- params = {}
2008
- params = args.pop if args.last.is_a? Hash
2009
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2010
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2011
- params = default_params.merge(params)
2012
- old_initialize(owner, nvis, params[:opts], &blk)
2013
- end
2014
- end
2015
-
2016
- class FXScrollWindow
2017
- alias old_initialize initialize
2018
- def initialize(p, *args, &blk)
2019
- argument_names = %w{opts x y width height}
2020
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
2021
- params = {}
2022
- params = args.pop if args.last.is_a? Hash
2023
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2024
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2025
- params = default_params.merge(params)
2026
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2027
- end
2028
- end
2029
-
2030
- class FXSearchDialog
2031
- alias old_initialize initialize
2032
- def initialize(owner, caption, *args, &blk)
2033
- argument_names = %w{ic opts x y width height}
2034
- default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
2035
- params = {}
2036
- params = args.pop if args.last.is_a? Hash
2037
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2038
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2039
- params = default_params.merge(params)
2040
- old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2041
- end
2042
- end
2043
-
2044
- class FXSeparator
2045
- alias old_initialize initialize
2046
- def initialize(p, *args, &blk)
2047
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
2048
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
2049
- params = {}
2050
- params = args.pop if args.last.is_a? Hash
2051
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2052
- if params.key? :padding
2053
- value = params.delete(:padding)
2054
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2055
- end
2056
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2057
- params = default_params.merge(params)
2058
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2059
- end
2060
- end
2061
-
2062
- class FXHorizontalSeparator
2063
- alias old_initialize initialize
2064
- def initialize(p, *args, &blk)
2065
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
2066
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 1, :padRight => 1, :padTop => 0, :padBottom => 0 }
2067
- params = {}
2068
- params = args.pop if args.last.is_a? Hash
2069
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2070
- if params.key? :padding
2071
- value = params.delete(:padding)
2072
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2073
- end
2074
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2075
- params = default_params.merge(params)
2076
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2077
- end
2078
- end
2079
-
2080
- class FXVerticalSeparator
2081
- alias old_initialize initialize
2082
- def initialize(p, *args, &blk)
2083
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
2084
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_Y, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 1, :padBottom => 1 }
2085
- params = {}
2086
- params = args.pop if args.last.is_a? Hash
2087
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2088
- if params.key? :padding
2089
- value = params.delete(:padding)
2090
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2091
- end
2092
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2093
- params = default_params.merge(params)
2094
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2095
- end
2096
- end
2097
-
2098
- class FXShutterItem
2099
- alias old_initialize initialize
2100
- def initialize(p, *args, &blk)
2101
- argument_names = %w{text icon opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2102
- default_params = { :text => "", :icon => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
2103
- params = {}
2104
- params = args.pop if args.last.is_a? Hash
2105
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2106
- if params.key? :padding
2107
- value = params.delete(:padding)
2108
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2109
- end
2110
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2111
- params = default_params.merge(params)
2112
- old_initialize(p, params[:text], params[:icon], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2113
- end
2114
- end
2115
-
2116
- class FXShutter
2117
- alias old_initialize initialize
2118
- def initialize(p, *args, &blk)
2119
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2120
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
2121
- params = {}
2122
- params = args.pop if args.last.is_a? Hash
2123
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2124
- if params.key? :padding
2125
- value = params.delete(:padding)
2126
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2127
- end
2128
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2129
- params = default_params.merge(params)
2130
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2131
- end
2132
- end
2133
-
2134
- class FXSlider
2135
- alias old_initialize initialize
2136
- def initialize(p, *args, &blk)
2137
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2138
- default_params = { :target => nil, :selector => 0, :opts => SLIDER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
2139
- params = {}
2140
- params = args.pop if args.last.is_a? Hash
2141
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2142
- if params.key? :padding
2143
- value = params.delete(:padding)
2144
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2145
- end
2146
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2147
- params = default_params.merge(params)
2148
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2149
- end
2150
- end
2151
-
2152
- class FXSpinner
2153
- alias old_initialize initialize
2154
- def initialize(p, cols, *args, &blk)
2155
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2156
- default_params = { :target => nil, :selector => 0, :opts => SPIN_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2157
- params = {}
2158
- params = args.pop if args.last.is_a? Hash
2159
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2160
- if params.key? :padding
2161
- value = params.delete(:padding)
2162
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2163
- end
2164
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2165
- params = default_params.merge(params)
2166
- old_initialize(p, cols, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2167
- end
2168
- end
2169
-
2170
- class FXSplashWindow
2171
- alias old_initialize initialize
2172
- def initialize(owner, icon, *args, &blk)
2173
- argument_names = %w{opts ms}
2174
- default_params = { :opts => SPLASH_SIMPLE, :ms => 5000 }
2175
- params = {}
2176
- params = args.pop if args.last.is_a? Hash
2177
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2178
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2179
- params = default_params.merge(params)
2180
- old_initialize(owner, icon, params[:opts], params[:ms], &blk)
2181
- end
2182
- end
2183
-
2184
- class FXSpring
2185
- alias old_initialize initialize
2186
- def initialize(p, *args, &blk)
2187
- argument_names = %w{opts relw relh x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2188
- default_params = { :opts => 0, :relw => 0, :relh => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
2189
- params = {}
2190
- params = args.pop if args.last.is_a? Hash
2191
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2192
- if params.key? :padding
2193
- value = params.delete(:padding)
2194
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2195
- end
2196
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2197
- params = default_params.merge(params)
2198
- old_initialize(p, params[:opts], params[:relw], params[:relh], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2199
- end
2200
- end
2201
-
2202
- class FXStatusBar
2203
- alias old_initialize initialize
2204
- def initialize(p, *args, &blk)
2205
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2206
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2, :hSpacing => 4, :vSpacing => 0 }
2207
- params = {}
2208
- params = args.pop if args.last.is_a? Hash
2209
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2210
- if params.key? :padding
2211
- value = params.delete(:padding)
2212
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2213
- end
2214
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2215
- params = default_params.merge(params)
2216
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2217
- end
2218
- end
2219
-
2220
- class FXStatusLine
2221
- alias old_initialize initialize
2222
- def initialize(p, *args, &blk)
2223
- argument_names = %w{target selector}
2224
- default_params = { :target => nil, :selector => 0 }
2225
- params = {}
2226
- params = args.pop if args.last.is_a? Hash
2227
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2228
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2229
- params = default_params.merge(params)
2230
- old_initialize(p, params[:target], params[:selector], &blk)
2231
- end
2232
- end
2233
-
2234
- class FXStream
2235
- alias old_initialize initialize
2236
- def initialize(*args, &blk)
2237
- argument_names = %w{cont}
2238
- default_params = { :cont => nil }
2239
- params = {}
2240
- params = args.pop if args.last.is_a? Hash
2241
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2242
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2243
- params = default_params.merge(params)
2244
- old_initialize(params[:cont], &blk)
2245
- end
2246
- end
2247
-
2248
- class FXSwitcher
2249
- alias old_initialize initialize
2250
- def initialize(p, *args, &blk)
2251
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
2252
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING }
2253
- params = {}
2254
- params = args.pop if args.last.is_a? Hash
2255
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2256
- if params.key? :padding
2257
- value = params.delete(:padding)
2258
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2259
- end
2260
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2261
- params = default_params.merge(params)
2262
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2263
- end
2264
- end
2265
-
2266
- class FXTabBar
2267
- alias old_initialize initialize
2268
- def initialize(p, *args, &blk)
2269
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2270
- default_params = { :target => nil, :selector => 0, :opts => TABBOOK_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING }
2271
- params = {}
2272
- params = args.pop if args.last.is_a? Hash
2273
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2274
- if params.key? :padding
2275
- value = params.delete(:padding)
2276
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2277
- end
2278
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2279
- params = default_params.merge(params)
2280
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2281
- end
2282
- end
2283
-
2284
- class FXTabBook
2285
- alias old_initialize initialize
2286
- def initialize(p, *args, &blk)
2287
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2288
- default_params = { :target => nil, :selector => 0, :opts => TABBOOK_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING }
2289
- params = {}
2290
- params = args.pop if args.last.is_a? Hash
2291
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2292
- if params.key? :padding
2293
- value = params.delete(:padding)
2294
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2295
- end
2296
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2297
- params = default_params.merge(params)
2298
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2299
- end
2300
- end
2301
-
2302
- class FXTabItem
2303
- alias old_initialize initialize
2304
- def initialize(p, text, *args, &blk)
2305
- argument_names = %w{ic opts x y width height padLeft padRight padTop padBottom}
2306
- default_params = { :ic => nil, :opts => TAB_TOP_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2307
- params = {}
2308
- params = args.pop if args.last.is_a? Hash
2309
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2310
- if params.key? :padding
2311
- value = params.delete(:padding)
2312
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2313
- end
2314
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2315
- params = default_params.merge(params)
2316
- old_initialize(p, text, params[:ic], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2317
- end
2318
- end
2319
-
2320
- class FXTableItem
2321
- alias old_initialize initialize
2322
- def initialize(text, *args, &blk)
2323
- argument_names = %w{icon data}
2324
- default_params = { :icon => nil, :data => nil }
2325
- params = {}
2326
- params = args.pop if args.last.is_a? Hash
2327
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2328
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2329
- params = default_params.merge(params)
2330
- old_initialize(text, params[:icon], params[:data], &blk)
2331
- end
2332
- end
2333
-
2334
- class FXTable
2335
- alias old_initialize initialize
2336
- def initialize(p, *args, &blk)
2337
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2338
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_MARGIN, :padRight => DEFAULT_MARGIN, :padTop => DEFAULT_MARGIN, :padBottom => DEFAULT_MARGIN }
2339
- params = {}
2340
- params = args.pop if args.last.is_a? Hash
2341
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2342
- if params.key? :padding
2343
- value = params.delete(:padding)
2344
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2345
- end
2346
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2347
- params = default_params.merge(params)
2348
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2349
- end
2350
- end
2351
-
2352
- class FXText
2353
- alias old_initialize initialize
2354
- def initialize(p, *args, &blk)
2355
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2356
- default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2 }
2357
- params = {}
2358
- params = args.pop if args.last.is_a? Hash
2359
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2360
- if params.key? :padding
2361
- value = params.delete(:padding)
2362
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2363
- end
2364
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2365
- params = default_params.merge(params)
2366
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2367
- end
2368
- end
2369
-
2370
- class FXTextField
2371
- alias old_initialize initialize
2372
- def initialize(p, ncols, *args, &blk)
2373
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2374
- default_params = { :target => nil, :selector => 0, :opts => TEXTFIELD_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2375
- params = {}
2376
- params = args.pop if args.last.is_a? Hash
2377
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2378
- if params.key? :padding
2379
- value = params.delete(:padding)
2380
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2381
- end
2382
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2383
- params = default_params.merge(params)
2384
- old_initialize(p, ncols, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2385
- end
2386
- end
2387
-
2388
- class FXTGAIcon
2389
- alias old_initialize initialize
2390
- def initialize(a, *args, &blk)
2391
- argument_names = %w{pix clr opts width height}
2392
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2393
- params = {}
2394
- params = args.pop if args.last.is_a? Hash
2395
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2396
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2397
- params = default_params.merge(params)
2398
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
2399
- end
2400
- end
2401
-
2402
- class FXTGAImage
2403
- alias old_initialize initialize
2404
- def initialize(a, *args, &blk)
2405
- argument_names = %w{pix opts width height}
2406
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2407
- params = {}
2408
- params = args.pop if args.last.is_a? Hash
2409
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2410
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2411
- params = default_params.merge(params)
2412
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
2413
- end
2414
- end
2415
-
2416
- class FXTIFIcon
2417
- alias old_initialize initialize
2418
- def initialize(a, *args, &blk)
2419
- argument_names = %w{pix clr opts width height}
2420
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2421
- params = {}
2422
- params = args.pop if args.last.is_a? Hash
2423
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2424
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2425
- params = default_params.merge(params)
2426
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
2427
- end
2428
- end
2429
-
2430
- class FXTIFImage
2431
- alias old_initialize initialize
2432
- def initialize(a, *args, &blk)
2433
- argument_names = %w{pix opts width height}
2434
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2435
- params = {}
2436
- params = args.pop if args.last.is_a? Hash
2437
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2438
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2439
- params = default_params.merge(params)
2440
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
2441
- end
2442
- end
2443
-
2444
- class FXToggleButton
2445
- alias old_initialize initialize
2446
- def initialize(p, text1, text2, *args, &blk)
2447
- argument_names = %w{icon1 icon2 target selector opts x y width height padLeft padRight padTop padBottom}
2448
- default_params = { :icon1 => nil, :icon2 => nil, :target => nil, :selector => 0, :opts => TOGGLEBUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2449
- params = {}
2450
- params = args.pop if args.last.is_a? Hash
2451
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2452
- if params.key? :padding
2453
- value = params.delete(:padding)
2454
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2455
- end
2456
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2457
- params = default_params.merge(params)
2458
- old_initialize(p, text1, text2, params[:icon1], params[:icon2], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2459
- end
2460
- end
2461
-
2462
- class FXToolBarGrip
2463
- alias old_initialize initialize
2464
- def initialize(p, *args, &blk)
2465
- argument_names = %w{target selector opts x y width height}
2466
- default_params = { :target => nil, :selector => 0, :opts => TOOLBARGRIP_SINGLE, :x => 0, :y => 0, :width => 0, :height => 0 }
2467
- params = {}
2468
- params = args.pop if args.last.is_a? Hash
2469
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2470
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2471
- params = default_params.merge(params)
2472
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2473
- end
2474
- end
2475
-
2476
- class FXToolBarShell
2477
- alias old_initialize initialize
2478
- def initialize(owner, *args, &blk)
2479
- argument_names = %w{opts x y width height hSpacing vSpacing}
2480
- default_params = { :opts => FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :hSpacing => 4, :vSpacing => 4 }
2481
- params = {}
2482
- params = args.pop if args.last.is_a? Hash
2483
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2484
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2485
- params = default_params.merge(params)
2486
- old_initialize(owner, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:hSpacing], params[:vSpacing], &blk)
2487
- end
2488
- end
2489
-
2490
- class FXToolBarTab
2491
- alias old_initialize initialize
2492
- def initialize(p, *args, &blk)
2493
- argument_names = %w{target selector opts x y width height}
2494
- default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
2495
- params = {}
2496
- params = args.pop if args.last.is_a? Hash
2497
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2498
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2499
- params = default_params.merge(params)
2500
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2501
- end
2502
- end
2503
-
2504
- class FXToolTip
2505
- alias old_initialize initialize
2506
- def initialize(app, *args, &blk)
2507
- argument_names = %w{opts x y width height}
2508
- default_params = { :opts => TOOLTIP_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
2509
- params = {}
2510
- params = args.pop if args.last.is_a? Hash
2511
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2512
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2513
- params = default_params.merge(params)
2514
- old_initialize(app, params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2515
- end
2516
- end
2517
-
2518
- class FXTreeItem
2519
- alias old_initialize initialize
2520
- def initialize(text, *args, &blk)
2521
- argument_names = %w{openIcon closedIcon data}
2522
- default_params = { :openIcon => nil, :closedIcon => nil, :data => nil }
2523
- params = {}
2524
- params = args.pop if args.last.is_a? Hash
2525
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2526
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2527
- params = default_params.merge(params)
2528
- old_initialize(text, params[:openIcon], params[:closedIcon], params[:data], &blk)
2529
- end
2530
- end
2531
-
2532
- class FXTreeList
2533
- alias old_initialize initialize
2534
- def initialize(p, *args, &blk)
2535
- argument_names = %w{target selector opts x y width height}
2536
- default_params = { :target => nil, :selector => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
2537
- params = {}
2538
- params = args.pop if args.last.is_a? Hash
2539
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2540
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2541
- params = default_params.merge(params)
2542
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], &blk)
2543
- end
2544
- end
2545
-
2546
- class FXTreeListBox
2547
- alias old_initialize initialize
2548
- def initialize(p, *args, &blk)
2549
- argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2550
- default_params = { :target => nil, :selector => 0, :opts => FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2551
- params = {}
2552
- params = args.pop if args.last.is_a? Hash
2553
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2554
- if params.key? :padding
2555
- value = params.delete(:padding)
2556
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2557
- end
2558
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2559
- params = default_params.merge(params)
2560
- old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2561
- end
2562
- end
2563
-
2564
- class FXTriStateButton
2565
- alias old_initialize initialize
2566
- def initialize(p, text1, text2, text3, *args, &blk)
2567
- argument_names = %w{icon1 icon2 icon3 target selector opts x y width height padLeft padRight padTop padBottom}
2568
- default_params = { :icon1 => nil, :icon2 => nil, :icon3 => nil, :target => nil, :selector => 0, :opts => TOGGLEBUTTON_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_PAD, :padRight => DEFAULT_PAD, :padTop => DEFAULT_PAD, :padBottom => DEFAULT_PAD }
2569
- params = {}
2570
- params = args.pop if args.last.is_a? Hash
2571
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2572
- if params.key? :padding
2573
- value = params.delete(:padding)
2574
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2575
- end
2576
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2577
- params = default_params.merge(params)
2578
- old_initialize(p, text1, text2, text3, params[:icon1], params[:icon2], params[:icon3], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], &blk)
2579
- end
2580
- end
2581
-
2582
- class FXVec4d
2583
- alias old_initialize initialize
2584
- def initialize(xx, yy, zz, *args, &blk)
2585
- argument_names = %w{ww}
2586
- default_params = { :ww => 1.0 }
2587
- params = {}
2588
- params = args.pop if args.last.is_a? Hash
2589
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2590
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2591
- params = default_params.merge(params)
2592
- old_initialize(xx, yy, zz, params[:ww], &blk)
2593
- end
2594
- end
2595
-
2596
- class FXVec4f
2597
- alias old_initialize initialize
2598
- def initialize(xx, yy, zz, *args, &blk)
2599
- argument_names = %w{ww}
2600
- default_params = { :ww => 1.0 }
2601
- params = {}
2602
- params = args.pop if args.last.is_a? Hash
2603
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2604
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2605
- params = default_params.merge(params)
2606
- old_initialize(xx, yy, zz, params[:ww], &blk)
2607
- end
2608
- end
2609
-
2610
- class FXVerticalFrame
2611
- alias old_initialize initialize
2612
- def initialize(p, *args, &blk)
2613
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2614
- default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => DEFAULT_SPACING, :padRight => DEFAULT_SPACING, :padTop => DEFAULT_SPACING, :padBottom => DEFAULT_SPACING, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
2615
- params = {}
2616
- params = args.pop if args.last.is_a? Hash
2617
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2618
- if params.key? :padding
2619
- value = params.delete(:padding)
2620
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2621
- end
2622
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2623
- params = default_params.merge(params)
2624
- old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2625
- end
2626
- end
2627
-
2628
- class FXVisual
2629
- alias old_initialize initialize
2630
- def initialize(a, flgs, *args, &blk)
2631
- argument_names = %w{d}
2632
- default_params = { :d => 32 }
2633
- params = {}
2634
- params = args.pop if args.last.is_a? Hash
2635
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2636
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2637
- params = default_params.merge(params)
2638
- old_initialize(a, flgs, params[:d], &blk)
2639
- end
2640
- end
2641
-
2642
- class FXWizard
2643
- alias old_initialize initialize
2644
- def initialize(owner, name, image, *args, &blk)
2645
- argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2646
- default_params = { :opts => DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 10, :padRight => 10, :padTop => 10, :padBottom => 10, :hSpacing => 10, :vSpacing => 10 }
2647
- params = {}
2648
- params = args.pop if args.last.is_a? Hash
2649
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2650
- if params.key? :padding
2651
- value = params.delete(:padding)
2652
- [:padLeft, :padRight, :padTop, :padBottom].each { |s| params[s] ||= value }
2653
- end
2654
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2655
- params = default_params.merge(params)
2656
- old_initialize(owner, name, image, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing], &blk)
2657
- end
2658
- end
2659
-
2660
- class FXXBMIcon
2661
- alias old_initialize initialize
2662
- def initialize(a, *args, &blk)
2663
- argument_names = %w{pixels mask clr opts width height}
2664
- default_params = { :pixels => nil, :mask => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2665
- params = {}
2666
- params = args.pop if args.last.is_a? Hash
2667
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2668
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2669
- params = default_params.merge(params)
2670
- old_initialize(a, params[:pixels], params[:mask], params[:clr], params[:opts], params[:width], params[:height], &blk)
2671
- end
2672
- end
2673
-
2674
- class FXXBMImage
2675
- alias old_initialize initialize
2676
- def initialize(a, *args, &blk)
2677
- argument_names = %w{pixels mask opts width height}
2678
- default_params = { :pixels => nil, :mask => nil, :opts => 0, :width => 1, :height => 1 }
2679
- params = {}
2680
- params = args.pop if args.last.is_a? Hash
2681
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2682
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2683
- params = default_params.merge(params)
2684
- old_initialize(a, params[:pixels], params[:mask], params[:opts], params[:width], params[:height], &blk)
2685
- end
2686
- end
2687
-
2688
- class FXXPMIcon
2689
- alias old_initialize initialize
2690
- def initialize(a, *args, &blk)
2691
- argument_names = %w{pix clr opts width height}
2692
- default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2693
- params = {}
2694
- params = args.pop if args.last.is_a? Hash
2695
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2696
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2697
- params = default_params.merge(params)
2698
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height], &blk)
2699
- end
2700
- end
2701
-
2702
- class FXXPMImage
2703
- alias old_initialize initialize
2704
- def initialize(a, *args, &blk)
2705
- argument_names = %w{pix opts width height}
2706
- default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2707
- params = {}
2708
- params = args.pop if args.last.is_a? Hash
2709
- args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2710
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2711
- params = default_params.merge(params)
2712
- old_initialize(a, params[:pix], params[:opts], params[:width], params[:height], &blk)
2713
- end
2714
- end
2715
-
2716
- end