fxruby 1.6.5 → 1.6.6

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