fxruby 1.6.4 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. data/doc/apes02.html +2 -2
  2. data/doc/apes03.html +2 -2
  3. data/doc/book.html +1 -1
  4. data/doc/changes.html +40 -20
  5. data/doc/differences.html +183 -4
  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 +21 -0
  12. data/examples/raabrowser.rb +1 -1
  13. data/ext/fox16/table_wrap.cpp +3 -10
  14. data/lib/fox16/iterators.rb +37 -0
  15. data/lib/fox16/kwargs.rb +1160 -960
  16. data/lib/fox16/timeout.rb +1 -1
  17. data/lib/fox16/version.rb +1 -1
  18. data/rdoc-sources/FX4Splitter.rb +8 -8
  19. data/rdoc-sources/FX7Segment.rb +1 -1
  20. data/rdoc-sources/FXAccelTable.rb +2 -2
  21. data/rdoc-sources/FXBMPIcon.rb +3 -3
  22. data/rdoc-sources/FXBMPImage.rb +3 -3
  23. data/rdoc-sources/FXBitmapFrame.rb +1 -1
  24. data/rdoc-sources/FXBitmapView.rb +1 -1
  25. data/rdoc-sources/FXChoiceBox.rb +3 -3
  26. data/rdoc-sources/FXColorList.rb +1 -1
  27. data/rdoc-sources/FXColorRing.rb +1 -1
  28. data/rdoc-sources/FXColorWheel.rb +9 -9
  29. data/rdoc-sources/FXComboBox.rb +9 -9
  30. data/rdoc-sources/FXDC.rb +10 -10
  31. data/rdoc-sources/FXDataTarget.rb +1 -1
  32. data/rdoc-sources/FXDial.rb +9 -9
  33. data/rdoc-sources/FXDialogBox.rb +1 -1
  34. data/rdoc-sources/FXDirBox.rb +1 -1
  35. data/rdoc-sources/FXDirDialog.rb +1 -1
  36. data/rdoc-sources/FXDirList.rb +1 -1
  37. data/rdoc-sources/FXDirSelector.rb +1 -1
  38. data/rdoc-sources/FXDockBar.rb +20 -20
  39. data/rdoc-sources/FXDockSite.rb +1 -1
  40. data/rdoc-sources/FXDockTitle.rb +1 -1
  41. data/rdoc-sources/FXDrawable.rb +2 -2
  42. data/rdoc-sources/FXDriveBox.rb +1 -1
  43. data/rdoc-sources/FXFileDialog.rb +1 -1
  44. data/rdoc-sources/FXFileList.rb +1 -1
  45. data/rdoc-sources/FXFileSelector.rb +1 -1
  46. data/rdoc-sources/FXFoldingList.rb +6 -6
  47. data/rdoc-sources/FXFontDialog.rb +1 -1
  48. data/rdoc-sources/FXFontSelector.rb +1 -1
  49. data/rdoc-sources/FXGIFIcon.rb +3 -3
  50. data/rdoc-sources/FXGIFImage.rb +3 -3
  51. data/rdoc-sources/FXGLCanvas.rb +2 -2
  52. data/rdoc-sources/FXGLViewer.rb +2 -2
  53. data/rdoc-sources/FXGradientBar.rb +1 -1
  54. data/rdoc-sources/FXHeader.rb +1 -1
  55. data/rdoc-sources/FXHorizontalFrame.rb +9 -9
  56. data/rdoc-sources/FXICOIcon.rb +3 -3
  57. data/rdoc-sources/FXICOImage.rb +3 -3
  58. data/rdoc-sources/FXIcon.rb +3 -3
  59. data/rdoc-sources/FXIconList.rb +1 -1
  60. data/rdoc-sources/FXImage.rb +7 -7
  61. data/rdoc-sources/FXImageFrame.rb +1 -1
  62. data/rdoc-sources/FXImageView.rb +1 -1
  63. data/rdoc-sources/FXInputDialog.rb +1 -1
  64. data/rdoc-sources/FXJPGIcon.rb +3 -3
  65. data/rdoc-sources/FXJPGImage.rb +3 -3
  66. data/rdoc-sources/FXKnob.rb +1 -1
  67. data/rdoc-sources/FXList.rb +1 -1
  68. data/rdoc-sources/FXListBox.rb +1 -1
  69. data/rdoc-sources/FXMDIButton.rb +6 -6
  70. data/rdoc-sources/FXMDIChild.rb +1 -1
  71. data/rdoc-sources/FXMDIClient.rb +2 -2
  72. data/rdoc-sources/FXMenuBar.rb +1 -1
  73. data/rdoc-sources/FXMenuCheck.rb +1 -1
  74. data/rdoc-sources/FXMenuCommand.rb +1 -1
  75. data/rdoc-sources/FXMenuRadio.rb +1 -1
  76. data/rdoc-sources/FXOptionMenu.rb +2 -2
  77. data/rdoc-sources/FXPCXIcon.rb +3 -3
  78. data/rdoc-sources/FXPCXImage.rb +3 -3
  79. data/rdoc-sources/FXPNGIcon.rb +3 -3
  80. data/rdoc-sources/FXPNGImage.rb +3 -3
  81. data/rdoc-sources/FXPPMIcon.rb +3 -3
  82. data/rdoc-sources/FXPPMImage.rb +3 -3
  83. data/rdoc-sources/FXPicker.rb +1 -1
  84. data/rdoc-sources/FXPopup.rb +2 -2
  85. data/rdoc-sources/FXPrintDialog.rb +1 -1
  86. data/rdoc-sources/FXProgressBar.rb +1 -1
  87. data/rdoc-sources/FXProgressDialog.rb +1 -1
  88. data/rdoc-sources/FXQuatd.rb +1 -1
  89. data/rdoc-sources/FXQuatf.rb +1 -1
  90. data/rdoc-sources/FXRGBIcon.rb +3 -3
  91. data/rdoc-sources/FXRGBImage.rb +3 -3
  92. data/rdoc-sources/FXRealSlider.rb +9 -9
  93. data/rdoc-sources/FXRealSpinner.rb +9 -9
  94. data/rdoc-sources/FXRecentFiles.rb +1 -1
  95. data/rdoc-sources/FXReplaceDialog.rb +3 -3
  96. data/rdoc-sources/FXRuler.rb +1 -1
  97. data/rdoc-sources/FXRulerView.rb +1 -1
  98. data/rdoc-sources/FXScintilla.rb +1 -1
  99. data/rdoc-sources/FXScrollBar.rb +5 -5
  100. data/rdoc-sources/FXScrollWindow.rb +3 -3
  101. data/rdoc-sources/FXSearchDialog.rb +3 -3
  102. data/rdoc-sources/FXSeparator.rb +15 -15
  103. data/rdoc-sources/FXShutter.rb +20 -20
  104. data/rdoc-sources/FXSlider.rb +9 -9
  105. data/rdoc-sources/FXSpinner.rb +9 -9
  106. data/rdoc-sources/FXSplitter.rb +8 -8
  107. data/rdoc-sources/FXSpring.rb +9 -9
  108. data/rdoc-sources/FXStatusBar.rb +9 -9
  109. data/rdoc-sources/FXStatusLine.rb +3 -3
  110. data/rdoc-sources/FXSwitcher.rb +7 -7
  111. data/rdoc-sources/FXTGAIcon.rb +3 -3
  112. data/rdoc-sources/FXTGAImage.rb +3 -3
  113. data/rdoc-sources/FXTIFIcon.rb +3 -3
  114. data/rdoc-sources/FXTIFImage.rb +3 -3
  115. data/rdoc-sources/FXTabBar.rb +9 -9
  116. data/rdoc-sources/FXTabBook.rb +9 -9
  117. data/rdoc-sources/FXTabItem.rb +7 -7
  118. data/rdoc-sources/FXTable.rb +10 -10
  119. data/rdoc-sources/FXText.rb +5 -5
  120. data/rdoc-sources/FXTextField.rb +9 -9
  121. data/rdoc-sources/FXToggleButton.rb +9 -9
  122. data/rdoc-sources/FXToolBar.rb +20 -20
  123. data/rdoc-sources/FXToolBarGrip.rb +5 -5
  124. data/rdoc-sources/FXToolBarShell.rb +5 -5
  125. data/rdoc-sources/FXToolBarTab.rb +5 -5
  126. data/rdoc-sources/FXToolTip.rb +1 -1
  127. data/rdoc-sources/FXTreeList.rb +5 -5
  128. data/rdoc-sources/FXTreeListBox.rb +10 -10
  129. data/rdoc-sources/FXTriStateButton.rb +9 -9
  130. data/rdoc-sources/FXVerticalFrame.rb +9 -9
  131. data/rdoc-sources/FXWindow.rb +5 -5
  132. data/rdoc-sources/FXWizard.rb +1 -1
  133. data/rdoc-sources/FXXBMIcon.rb +3 -3
  134. data/rdoc-sources/FXXBMImage.rb +3 -3
  135. data/rdoc-sources/FXXPMIcon.rb +3 -3
  136. data/rdoc-sources/FXXPMImage.rb +3 -3
  137. metadata +5 -4
  138. data/doc/cvs.html +0 -35
data/doc/opengl.html CHANGED
@@ -5,10 +5,10 @@
5
5
  widgets, and FXRuby in turn provides interfaces to those classes. By
6
6
  combining FXRuby with the OpenGL interface for Ruby (described below) you
7
7
  can develop very powerful 3-D graphics applications. This chapter gives
8
- you the information you'll need to get started.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4042"></a>What is OpenGL?</h2></div></div></div><p>OpenGL is a platform-independent API for 2D and 3D graphics. The
8
+ you the information you'll need to get started.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4118"></a>What is OpenGL?</h2></div></div></div><p>OpenGL is a platform-independent API for 2D and 3D graphics. The
9
9
  home page is <a href="http://www.opengl.org" target="_top">http://www.opengl.org</a>. Because it's a
10
10
  fairly open standard, highly optimized OpenGL drivers are available for
11
- most operating systems (including Windows and Linux).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4050"></a>OpenGL Extensions for Ruby</h2></div></div></div><p>This extension module, developed by Yoshiyuki Kusano, provides
11
+ most operating systems (including Windows and Linux).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4126"></a>OpenGL Extensions for Ruby</h2></div></div></div><p>This extension module, developed by Yoshiyuki Kusano, provides
12
12
  interfaces to not only the basic OpenGL API, but also the GLU and GLUT
13
13
  APIs. As of this writing, the currently released version is 0.32d and is
14
14
  available for download from <a href="http://www2.giganet.net/~yoshi/rbogl-0.32b.tgz" target="_top">http://www2.giganet.net/~yoshi/rbogl-0.32d.tgz</a>.
@@ -25,7 +25,7 @@
25
25
  extensions by typing:</p><pre class="screen">$ <span><strong class="command">make site-install</strong></span></pre><p>Please note that I'm not the maintainer of this particular Ruby
26
26
  extension, so I can't really accept bug fixes for it. But if you're having
27
27
  trouble integrating Ruby/OpenGL with FXRuby, let me know and we'll see
28
- what we can do.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4105"></a>The FXGLVisual Class</h2></div></div></div><p>An <code class="classname">FXGLVisual</code> object describes the
28
+ what we can do.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4181"></a>The FXGLVisual Class</h2></div></div></div><p>An <code class="classname">FXGLVisual</code> object describes the
29
29
  capabilities of an <code class="classname">FXGLCanvas</code> or
30
30
  <code class="classname">FXGLViewer</code> window. Typically, an X server supports
31
31
  many different visuals with varying capabilities, but the ones with
@@ -58,13 +58,13 @@ end</pre><p>Some <code class="classname">FXGLVisual</code> object must be associ
58
58
  separate <code class="classname">FXGLVisual</code> object for each window. For
59
59
  most applications, you can just construct a single
60
60
  <code class="classname">FXGLVisual</code> object that's shared among all the
61
- OpenGL windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4164"></a>The FXGLCanvas Class</h2></div></div></div><p>The <code class="classname">FXGLCanvas</code> widget provides a very simple
61
+ OpenGL windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4240"></a>The FXGLCanvas Class</h2></div></div></div><p>The <code class="classname">FXGLCanvas</code> widget provides a very simple
62
62
  OpenGL-capable window with minimal functionality. To construct an
63
63
  <code class="classname">FXGLCanvas</code>, call
64
64
  <code class="methodname">FXGLCanvas.new</code>:</p><pre class="programlisting">glCanvas = FXGLCanvas.new(parent, vis)</pre><p>The first argument to <code class="methodname">FXGLCanvas.new</code> is the
65
65
  parent (container) widget and the second argument is the
66
66
  <code class="classname">FXGLVisual</code> that should be used for this
67
- window.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4188"></a>OpenGL objects and the FXGLViewer</h2></div></div></div><p>The <code class="classname">FXGLViewer</code> widget provides a higher-level
67
+ window.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4264"></a>OpenGL objects and the FXGLViewer</h2></div></div></div><p>The <code class="classname">FXGLViewer</code> widget provides a higher-level
68
68
  OpenGL-capable window with a lot of built-in functionality. To construct
69
69
  an <code class="classname">FXGLViewer</code>, call
70
70
  <code class="methodname">FXGLViewer.new</code>:</p><pre class="programlisting">glViewer = FXGLViewer.new(parent, vis)</pre><p>The first argument to <code class="methodname">FXGLViewer.new</code> is the
data/doc/pt02.html CHANGED
@@ -1,3 +1,3 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Part&nbsp;II.&nbsp;Appendices</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="prev" href="changes.html" title="Chapter&nbsp;11.&nbsp;Change History"><link rel="next" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part&nbsp;II.&nbsp;Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr></table><hr></div><div class="part" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e4027"></a>Appendices</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="appendix"><a href="opengl.html">A. Using OpenGL with FXRuby</a></span></dt><dt><span class="appendix"><a href="scintilla.html">B. Using Scintilla with FXRuby</a></span></dt><dt><span class="appendix"><a href="differences.html">C. Differences between FOX and FXRuby</a></span></dt><dt><span class="appendix"><a href="library.html">D. The FXRuby Standard Library</a></span></dt><dt><span class="appendix"><a href="implementation.html">E. Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="implementation.html#d0e5037">Code Generation</a></span></dt><dt><span class="section"><a href="apes02.html">Object Life Cycles and Garbage Collection</a></span></dt><dd><dl><dt><span class="section"><a href="apes02.html#d0e5075">GL Objects</a></span></dt></dl></dd><dt><span class="section"><a href="apes03.html">Virtual Functions</a></span></dt></dl></dd><dt><span class="appendix"><a href="cvs.html">F. Getting the Sources from CVS</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;11.&nbsp;Change History&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby</td></tr></table></div></body></html>
3
+ <title>Part&nbsp;II.&nbsp;Appendices</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="prev" href="changes.html" title="Chapter&nbsp;11.&nbsp;Change History"><link rel="next" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part&nbsp;II.&nbsp;Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr></table><hr></div><div class="part" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e4103"></a>Appendices</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="appendix"><a href="opengl.html">A. Using OpenGL with FXRuby</a></span></dt><dt><span class="appendix"><a href="scintilla.html">B. Using Scintilla with FXRuby</a></span></dt><dt><span class="appendix"><a href="differences.html">C. Differences between FOX and FXRuby</a></span></dt><dt><span class="appendix"><a href="library.html">D. The FXRuby Standard Library</a></span></dt><dt><span class="appendix"><a href="implementation.html">E. Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="implementation.html#d0e5154">Code Generation</a></span></dt><dt><span class="section"><a href="apes02.html">Object Life Cycles and Garbage Collection</a></span></dt><dd><dl><dt><span class="section"><a href="apes02.html#d0e5192">GL Objects</a></span></dt></dl></dd><dt><span class="section"><a href="apes03.html">Virtual Functions</a></span></dt></dl></dd><dt><span class="appendix"><a href="subversion.html">F. Getting the Sources from Subversion</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;11.&nbsp;Change History&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby</td></tr></table></div></body></html>
data/doc/scintilla.html CHANGED
@@ -1,12 +1,12 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part&nbsp;II.&nbsp;Appendices"><link rel="prev" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="differences.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="scintilla"></a>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</h2></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4215"></a>What is Scintilla?</h2></div></div></div><p><a href="http://www.scintilla.org" target="_top">Scintilla</a> is a free
3
+ <title>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part&nbsp;II.&nbsp;Appendices"><link rel="prev" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="differences.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="scintilla"></a>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</h2></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4291"></a>What is Scintilla?</h2></div></div></div><p><a href="http://www.scintilla.org" target="_top">Scintilla</a> is a free
4
4
  source code editing component developed by Neil Hodgson for the Win32 and
5
- GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4222"></a>What is FXScintilla?</h2></div></div></div><p><a href="http://savannah.gnu.org/projects/fxscintilla" target="_top">FXScintilla </a> is
5
+ GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4298"></a>What is FXScintilla?</h2></div></div></div><p><a href="http://savannah.gnu.org/projects/fxscintilla" target="_top">FXScintilla </a> is
6
6
  a FOX widget that wraps around the Scintilla component, or, if you wish,
7
7
  the FOX "port" of Scintilla. It is being developed by Gilles Filippini,
8
8
  and as of this writing the latest release is available for download from
9
- <a href="http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.63.tar.gz" target="_top">http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.63.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4232"></a>Compiling FXScintilla</h2></div></div></div><p>The FXScintilla distribution contains everything you need to build
9
+ <a href="http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.63.tar.gz" target="_top">http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.63.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4308"></a>Compiling FXScintilla</h2></div></div></div><p>The FXScintilla distribution contains everything you need to build
10
10
  the FXScintilla widget and begin using it in your C++-based FOX
11
11
  applications. That is to say, you do not have to separately download the
12
12
  Scintilla source code from the Scintilla home page. When you unpack the
@@ -17,7 +17,7 @@
17
17
  other open-source software (like FOX) from the source code. The
18
18
  <code class="filename">INSTALL</code> file in the top-level directory should
19
19
  provide enough instruction for you to build and install FXScintilla for
20
- either Unix or Microsoft Windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4245"></a>Enabling FXScintilla Support in FXRuby</h2></div></div></div><p>The next step is to build a version of FXRuby (from its source code)
20
+ either Unix or Microsoft Windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4321"></a>Enabling FXScintilla Support in FXRuby</h2></div></div></div><p>The next step is to build a version of FXRuby (from its source code)
21
21
  with the optional FXScintilla support enabled. If you're working on a Unix
22
22
  or Linux system and have installed FXScintilla in one of the standard
23
23
  installation directories (e.g. under <code class="filename">/usr/include</code> or <code class="filename">/usr/local/include</code>), the regular FXRuby build
@@ -0,0 +1,21 @@
1
+ <html><head>
2
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
+ <title>Appendix&nbsp;F.&nbsp;Getting the Sources from Subversion</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part&nbsp;II.&nbsp;Appendices"><link rel="prev" href="apes03.html" title="Virtual Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix&nbsp;F.&nbsp;Getting the Sources from Subversion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apes03.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="subversion"></a>Appendix&nbsp;F.&nbsp;Getting the Sources from Subversion</h2></div></div></div><p>All of the source code for FXRuby is available for anonymous,
4
+ read-only <a href="http://subversion.tigris.org/" target="_top">Subversion</a>
5
+ access. This chapter describes how to check out the sources for the
6
+ development release of FXRuby and then build FXRuby from those sources. The
7
+ information in this chapter builds on the basic Subversion instructions
8
+ provided for any RubyForge hosted project, and specifically those <a href="http://rubyforge.org/scm/?group_id=300" target="_top">instructions</a> for the
9
+ FXRuby project hosted at RubyForge.</p><p>There are some prerequisites. Obviously, you're going to need to have
10
+ some kind of Subversion client installed on your system and have a clue
11
+ about how to use it to check out code from a remote repository. Please do
12
+ not send me questions about how to install or use Subversion. A good
13
+ starting point for documentation about Subversion is the <a href="http://subversion.tigris.org/" target="_top">home page</a>, and especially the
14
+ <a href="http://svnbook.red-bean.com/" target="_top">book</a>.</p><p>You're also going to need to have a working <a href="http://www.swig.org/" target="_top">SWIG</a> installation so that you can
15
+ generate the C++ source files from the SWIG interface files. As of this
16
+ writing, FXRuby requires SWIG version 1.3.22; later versions of SWIG will
17
+ not work, nor will versions earlier than about 1.3.15.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5337"></a>Checking out the code</h2></div></div></div><p>To check out the development version (i.e. the trunk) for FXRuby,
18
+ type the following command:</p><pre class="screen">svn checkout svn://rubyforge.org/var/svn/fxruby/trunk/FXRuby</pre><p>Next, you'll need to use SWIG to generate the C++ source code from
19
+ the SWIG interface files. To do that, type:</p><pre class="screen">rake swig</pre><p>At this point, you should be ready to change to the top-level
20
+ directory and go through the normal build and installation process, as
21
+ described in an earlier chapter.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apes03.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">Virtual Functions&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
@@ -33,7 +33,7 @@ class RAABrowserWindow < FXMainWindow
33
33
  LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
34
34
 
35
35
  # Create the empty tree list
36
- @treeList = FXTreeList.new(frame, 0, nil, 0,
36
+ @treeList = FXTreeList.new(frame, nil, 0,
37
37
  (TREELIST_BROWSESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|
38
38
  TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y))
39
39
  @treeList.connect(SEL_COMMAND) do |sender, sel, item|
@@ -2448,10 +2448,7 @@ static VALUE _wrap_FXTable_setCurrentItem(int argc, VALUE *argv, VALUE self) { F
2448
2448
  FXint arg3 ; FXbool arg4 = (FXbool) 0 ; if ((argc < 2) || (argc > 3))
2449
2449
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2450
2450
  SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXTable, 1); arg2 = NUM2INT(argv[0]); arg3 = NUM2INT(argv[1]);
2451
- if (argc > 2) { arg4 = to_FXbool(argv[2]); } { if (arg2 < 0 || arg2 >= arg1->getNumRows()) {
2452
- rb_raise(rb_eIndexError, "table row out of bounds"); } } { if (arg3 < 0 || arg3 >= arg1->getNumColumns()) {
2453
- rb_raise(rb_eIndexError, "table column out of bounds"); } } FXTable_setCurrentItem(arg1,arg2,arg3,arg4);
2454
- return Qnil; }
2451
+ if (argc > 2) { arg4 = to_FXbool(argv[2]); } FXTable_setCurrentItem(arg1,arg2,arg3,arg4); return Qnil; }
2455
2452
  static VALUE _wrap_FXTable_selectRow(int argc, VALUE *argv, VALUE self) { FXTable *arg1 = (FXTable *) 0 ; FXint arg2 ;
2456
2453
  FXbool arg3 = (FXbool) 0 ; FXbool result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 2))
2457
2454
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
@@ -2489,9 +2486,7 @@ static VALUE _wrap_FXTable_killSelection(int argc, VALUE *argv, VALUE self) { FX
2489
2486
  result = (FXbool)FXTable_killSelection(arg1,arg2); vresult = result ? Qtrue : Qfalse; return vresult; }
2490
2487
  static VALUE _wrap_FXTable_startInput(int argc, VALUE *argv, VALUE self) { FXTable *arg1 = (FXTable *) 0 ; FXint arg2 ;
2491
2488
  FXint arg3 ; if ((argc < 2) || (argc > 2)) rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2492
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXTable, 1); arg2 = NUM2INT(argv[0]); arg3 = NUM2INT(argv[1]); {
2493
- if (arg2 < 0 || arg2 >= arg1->getNumRows()) { rb_raise(rb_eIndexError, "table row out of bounds"); } } {
2494
- if (arg3 < 0 || arg3 >= arg1->getNumColumns()) { rb_raise(rb_eIndexError, "table column out of bounds"); } }
2489
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXTable, 1); arg2 = NUM2INT(argv[0]); arg3 = NUM2INT(argv[1]);
2495
2490
  FXTable_startInput(arg1,arg2,arg3); return Qnil; }
2496
2491
  static VALUE _wrap_FXTable_cancelInput(int argc, VALUE *argv, VALUE self) { FXTable *arg1 = (FXTable *) 0 ;
2497
2492
  if ((argc < 0) || (argc > 0)) rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
@@ -2502,9 +2497,7 @@ static VALUE _wrap_FXTable_acceptInput(int argc, VALUE *argv, VALUE self) { FXTa
2502
2497
  FXTable_acceptInput(arg1,arg2); return Qnil; }
2503
2498
  static VALUE _wrap_FXTable_makePositionVisible(int argc, VALUE *argv, VALUE self) { FXTable *arg1 = (FXTable *) 0 ; FXint arg2 ;
2504
2499
  FXint arg3 ; if ((argc < 2) || (argc > 2)) rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2505
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXTable, 1); arg2 = NUM2INT(argv[0]); arg3 = NUM2INT(argv[1]); {
2506
- if (arg2 < 0 || arg2 >= arg1->getNumRows()) { rb_raise(rb_eIndexError, "table row out of bounds"); } } {
2507
- if (arg3 < 0 || arg3 >= arg1->getNumColumns()) { rb_raise(rb_eIndexError, "table column out of bounds"); } }
2500
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXTable, 1); arg2 = NUM2INT(argv[0]); arg3 = NUM2INT(argv[1]);
2508
2501
  FXTable_makePositionVisible(arg1,arg2,arg3); return Qnil; }
2509
2502
  static VALUE _wrap_FXTable_enableItem(int argc, VALUE *argv, VALUE self) { FXTable *arg1 = (FXTable *) 0 ; FXint arg2 ;
2510
2503
  FXint arg3 ; FXbool result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2))
@@ -1,4 +1,5 @@
1
1
  module Fox
2
+
2
3
  class FXComboBox
3
4
 
4
5
  include Enumerable
@@ -15,6 +16,42 @@ module Fox
15
16
  end
16
17
  end
17
18
 
19
+ class FXFoldingList
20
+
21
+ include Enumerable
22
+
23
+ #
24
+ # Calls block once for each root-level folding list item, passing a
25
+ # reference to that item as a parameter.
26
+ #
27
+ def each # :yields: aFoldingItem
28
+ current = firstItem
29
+ while current != nil
30
+ yield current
31
+ current = current.next
32
+ end
33
+ self
34
+ end
35
+ end
36
+
37
+ class FXFoldingItem
38
+
39
+ include Enumerable
40
+
41
+ #
42
+ # Calls block once for each child of this folding list item, passing a
43
+ # reference to that child item as a parameter.
44
+ #
45
+ def each # :yields: aFoldingItem
46
+ current = first
47
+ while current != nil
48
+ yield current
49
+ current = current.next
50
+ end
51
+ self
52
+ end
53
+ end
54
+
18
55
  class FXHeader
19
56
 
20
57
  include Enumerable
data/lib/fox16/kwargs.rb CHANGED
@@ -5,234 +5,216 @@ module Fox
5
5
 
6
6
  class FX4Splitter
7
7
  alias old_initialize initialize
8
- def initialize(*args)
9
- default_params = { :opts => FOURSPLITTER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
10
- case args.length
11
- when 1,2
12
- params = (args.length == 2) ? args[1] : {}
8
+ def initialize(p, *args)
9
+ argument_names = %w{opts x y width height}
10
+ default_params = { :opts => FOURSPLITTER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
11
+ params = {}
12
+ params = args.pop if args.last.is_a? Hash
13
+ if args.length > 0 && (args.first.nil? || args.first.is_a?(FXObject))
14
+ tgt, sel = args[0], args[1]
15
+ args.each_with_index { |e, i| params[argument_names[i-2].intern] = e if i >= 2 }
13
16
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
14
17
  params = default_params.merge(params)
15
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h])
16
- when 3,4
17
- params = (args.length == 4) ? args[3] : {}
18
+ old_initialize(p, tgt, sel, params[:opts], params[:x], params[:y], params[:width], params[:height])
19
+ else
20
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
18
21
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
19
22
  params = default_params.merge(params)
20
- old_initialize(args[0], args[1], args[2], params[:opts], params[:x], params[:y], params[:w], params[:h])
23
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height])
21
24
  end
22
25
  end
23
26
  end
24
27
 
25
28
  class FXDockBar
26
29
  alias old_initialize initialize
27
- def initialize(*args)
28
- default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 3, :pr => 3, :pt => 2, :pb => 2, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
29
- case args.length
30
- when 1
31
- params = default_params
32
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
33
- when 2
34
- if args[1].is_a? Hash
35
- params = args[1]
36
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
37
- params = default_params.merge(params)
38
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
39
- else
40
- params = default_params
41
- old_initialize(args[0], args[1], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
42
- end
43
- when 3
44
- params = args[2]
30
+ def initialize(p, *args)
31
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
32
+ default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 3, :padRight => 3, :padTop => 2, :padBottom => 2, :hSpacing => DEFAULT_SPACING, :vSpacing => DEFAULT_SPACING }
33
+ params = {}
34
+ params = args.pop if args.last.is_a? Hash
35
+ if args.length > 0 && (args.first.nil? || args.first.is_a?(FXComposite))
36
+ q = args[0]
37
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
38
+ params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
39
+ 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])
41
+ else
42
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
45
43
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
46
44
  params = default_params.merge(params)
47
- old_initialize(args[0], args[1], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
48
46
  end
49
47
  end
50
48
  end
51
49
 
52
50
  class FXFont
53
51
  alias old_initialize initialize
54
- def initialize(*args)
55
- case args.length
56
- when 2
57
- old_initialize(*args)
58
- when 3,4
52
+ def initialize(a, arg1, *args)
53
+ if args.length > 0
54
+ face, size = arg1, args[0]
55
+ argument_names = %w{weight slant encoding setWidth hints}
59
56
  default_params = { :weight => FXFont::Normal, :slant => Font::Straight, :encoding => FONTENCODING_DEFAULT, :setWidth => FXFont::NonExpanded, :hints => 0 }
60
- params = (args.length == 4) ? args[3] : {}
57
+ params = {}
58
+ params = args.pop if args.last.is_a? Hash
59
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
61
60
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
62
61
  params = default_params.merge(params)
63
- old_initialize(args[0], args[1], args[2], params[:weight], params[:slant], params[:encoding], params[:setWidth], params[:hints])
62
+ old_initialize(a, face, size, params[:weight], params[:slant], params[:encoding], params[:setWidth], params[:hints])
63
+ else
64
+ old_initialize(a, arg1)
64
65
  end
65
66
  end
66
67
  end
67
68
 
68
69
  class FXGLCanvas
69
70
  alias old_initialize initialize
70
- def initialize(*args)
71
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
72
- case args.length
73
- when 2
74
- params = default_params
75
- old_initialize(args[0], args[1], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
76
- when 3
77
- if args[2].is_a? Hash
78
- params = args[2]
79
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
80
- params = default_params.merge(params)
81
- old_initialize(args[0], args[1], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
82
- else
83
- params = default_params
84
- old_initialize(args[0], args[1], args[2], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
85
- end
86
- when 4
87
- params = args[3]
71
+ def initialize(parent, vis, *args)
72
+ argument_names = %w{target selector opts x y width height}
73
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
74
+ params = {}
75
+ params = args.pop if args.last.is_a? Hash
76
+ if args.length > 0 && (args[0].is_a?(FXGLCanvas))
77
+ sharegroup = args[0]
78
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
88
79
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
89
80
  params = default_params.merge(params)
90
- old_initialize(args[0], args[1], args[2], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
81
+ old_initialize(parent, vis, sharegroup, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
82
+ else
83
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
84
+ params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
85
+ params = default_params.merge(params)
86
+ old_initialize(parent, vis, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
91
87
  end
92
88
  end
93
89
  end
94
90
 
95
91
  class FXGLViewer
96
92
  alias old_initialize initialize
97
- def initialize(*args)
98
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
99
- case args.length
100
- when 2
101
- params = default_params
102
- old_initialize(args[0], args[1], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
103
- when 3
104
- if args[2].is_a? Hash
105
- params = args[2]
106
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
107
- params = default_params.merge(params)
108
- old_initialize(args[0], args[1], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
109
- else
110
- params = default_params
111
- old_initialize(args[0], args[1], args[2], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
112
- end
113
- when 4
114
- params = args[3]
93
+ def initialize(parent, vis, *args)
94
+ argument_names = %w{target selector opts x y width height}
95
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
96
+ params = {}
97
+ params = args.pop if args.last.is_a? Hash
98
+ if args.length > 0 && (args[0].is_a?(FXGLViewer))
99
+ sharegroup = args[0]
100
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
101
+ params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
102
+ 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])
104
+ else
105
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
115
106
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
116
107
  params = default_params.merge(params)
117
- old_initialize(args[0], args[1], args[2], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
108
+ old_initialize(parent, vis, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
118
109
  end
119
110
  end
120
111
  end
121
112
 
122
113
  class FXMenuBar
123
114
  alias old_initialize initialize
124
- def initialize(*args)
125
- if args.length == 2
126
- old_initialize(*args)
115
+ def initialize(p, *args)
116
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
117
+ 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
+ params = {}
119
+ params = args.pop if args.last.is_a? Hash
120
+ if args.length > 0 && (args[0].nil? || args[0].is_a?(FXComposite))
121
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
122
+ params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
123
+ 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])
127
125
  else
128
- 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 }
129
- params = args[2]
126
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
130
127
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
131
128
  params = default_params.merge(params)
132
- if (args[1].nil?) || (args[1].is_a? FXComposite)
133
- old_initialize(args[0], args[1], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing])
134
- else
135
- old_initialize(args[0], args[1], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing])
136
- end
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])
137
130
  end
138
131
  end
139
132
  end
140
133
 
141
134
  class FXSplitter
142
135
  alias old_initialize initialize
143
- def initialize(*args)
144
- default_params = { :opts => SPLITTER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
145
- case args.length
146
- when 1,2
147
- params = (args.length == 2) ? args[1] : {}
136
+ def initialize(p, *args)
137
+ argument_names = %w{opts x y width height}
138
+ default_params = { :opts => SPLITTER_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
139
+ params = {}
140
+ params = args.pop if args.last.is_a? Hash
141
+ if args.length > 0 && (args.first.nil? || args.first.is_a?(FXObject))
142
+ tgt, sel = args[0], args[1]
143
+ args.each_with_index { |e, i| params[argument_names[i-2].intern] = e if i >= 2 }
148
144
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
149
145
  params = default_params.merge(params)
150
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h])
151
- when 3,4
152
- params = (args.length == 4) ? args[3] : {}
146
+ old_initialize(p, tgt, sel, params[:opts], params[:x], params[:y], params[:width], params[:height])
147
+ else
148
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
153
149
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
154
150
  params = default_params.merge(params)
155
- old_initialize(args[0], args[1], args[2], params[:opts], params[:x], params[:y], params[:w], params[:h])
151
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height])
156
152
  end
157
153
  end
158
154
  end
159
155
 
160
156
  class FXToolBar
161
157
  alias old_initialize initialize
162
- def initialize(*args)
163
- default_params = { :opts => LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 3, :pr => 3, :pt => 2, :pb => 2, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
164
- case args.length
165
- when 1
166
- params = default_params
167
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
168
- when 2
169
- if args[1].is_a? Hash
170
- params = args[1]
171
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
172
- params = default_params.merge(params)
173
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
174
- else
175
- params = default_params
176
- old_initialize(args[0], args[1], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
177
- end
178
- when 3
179
- params = args[2]
158
+ def initialize(p, *args)
159
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
160
+ 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
+ params = {}
162
+ params = args.pop if args.last.is_a? Hash
163
+ if args.length > 0 && (args[0].nil? || args[0].is_a?(FXComposite))
164
+ q = args[0]
165
+ args.each_with_index { |e, i| params[argument_names[i-1].intern] = e if i >= 1 }
166
+ params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
167
+ 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])
169
+ else
170
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
180
171
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
181
172
  params = default_params.merge(params)
182
- old_initialize(args[0], args[1], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
183
174
  end
184
175
  end
185
176
  end
186
177
 
187
178
  class FXWindow
188
179
  alias old_initialize initialize
189
- def initialize(*args)
190
- if (args.length == 2) && (args[1].is_a? Hash)
191
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
192
- params = args[1]
180
+ def initialize(p, *args)
181
+ if p.is_a? FXApp
182
+ old_initialize(p, *args)
183
+ else
184
+ argument_names = %w{opts x y width height}
185
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
186
+ params = {}
187
+ params = args.pop if args.last.is_a? Hash
188
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
193
189
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
194
190
  params = default_params.merge(params)
195
- old_initialize(args[0], params[:opts], params[:x], params[:y], params[:w], params[:h])
196
- else
197
- old_initialize(*args)
191
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height])
198
192
  end
199
193
  end
200
194
  end
201
195
 
202
196
  class FX7Segment
203
197
  alias old_initialize initialize
204
- def initialize(p, text, params={})
205
- default_params = { :opts => SEVENSEGMENT_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
206
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
207
- params = default_params.merge(params)
208
- old_initialize(p, text, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
209
- end
210
- end
211
-
212
- class FXAccelTable
213
- alias old_initialize initialize
214
- def initialize(params={})
215
- default_params = { }
198
+ def initialize(p, text, *args)
199
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
200
+ 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
+ params = {}
202
+ params = args.pop if args.last.is_a? Hash
203
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
216
204
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
217
205
  params = default_params.merge(params)
218
- old_initialize()
219
- end
220
- end
221
-
222
- class FXEvent
223
- alias old_initialize initialize
224
- def initialize(params={})
225
- default_params = { }
226
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
227
- params = default_params.merge(params)
228
- old_initialize()
206
+ old_initialize(p, text, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
229
207
  end
230
208
  end
231
209
 
232
210
  class FXApp
233
211
  alias old_initialize initialize
234
- def initialize(params={})
212
+ def initialize(*args)
213
+ argument_names = %w{appName vendorName}
235
214
  default_params = { :appName => "Application", :vendorName => "FoxDefault" }
215
+ params = {}
216
+ params = args.pop if args.last.is_a? Hash
217
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
236
218
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
237
219
  params = default_params.merge(params)
238
220
  old_initialize(params[:appName], params[:vendorName])
@@ -241,8 +223,12 @@ module Fox
241
223
 
242
224
  class FXArrowButton
243
225
  alias old_initialize initialize
244
- def initialize(parent, params={})
226
+ def initialize(parent, *args)
227
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
245
228
  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
+ params = {}
230
+ params = args.pop if args.last.is_a? Hash
231
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
246
232
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
247
233
  params = default_params.merge(params)
248
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])
@@ -251,8 +237,12 @@ module Fox
251
237
 
252
238
  class FXBitmap
253
239
  alias old_initialize initialize
254
- def initialize(app, params={})
240
+ def initialize(app, *args)
241
+ argument_names = %w{pixels opts width height}
255
242
  default_params = { :pixels => nil, :opts => 0, :width => 1, :height => 1 }
243
+ params = {}
244
+ params = args.pop if args.last.is_a? Hash
245
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
256
246
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
257
247
  params = default_params.merge(params)
258
248
  old_initialize(app, params[:pixels], params[:opts], params[:width], params[:height])
@@ -261,48 +251,68 @@ module Fox
261
251
 
262
252
  class FXBitmapFrame
263
253
  alias old_initialize initialize
264
- def initialize(p, bmp, params={})
265
- default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
254
+ def initialize(p, bmp, *args)
255
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
256
+ default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
257
+ params = {}
258
+ params = args.pop if args.last.is_a? Hash
259
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
266
260
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
267
261
  params = default_params.merge(params)
268
- old_initialize(p, bmp, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
262
+ old_initialize(p, bmp, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
269
263
  end
270
264
  end
271
265
 
272
266
  class FXBitmapView
273
267
  alias old_initialize initialize
274
- def initialize(p, params={})
275
- default_params = { :bmp => nil, :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
268
+ def initialize(p, *args)
269
+ argument_names = %w{bmp target selector opts x y width height}
270
+ default_params = { :bmp => nil, :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
271
+ params = {}
272
+ params = args.pop if args.last.is_a? Hash
273
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
276
274
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
277
275
  params = default_params.merge(params)
278
- old_initialize(p, params[:bmp], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
276
+ old_initialize(p, params[:bmp], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
279
277
  end
280
278
  end
281
279
 
282
280
  class FXBMPIcon
283
281
  alias old_initialize initialize
284
- def initialize(a, params={})
285
- default_params = { :pix => nil, :clr => FXRGB(192,192,192), :opts => 0, :w => 1, :h => 1 }
282
+ def initialize(a, *args)
283
+ argument_names = %w{pix clr opts width height}
284
+ default_params = { :pix => nil, :clr => FXRGB(192,192,192), :opts => 0, :width => 1, :height => 1 }
285
+ params = {}
286
+ params = args.pop if args.last.is_a? Hash
287
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
286
288
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
287
289
  params = default_params.merge(params)
288
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
290
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
289
291
  end
290
292
  end
291
293
 
292
294
  class FXBMPImage
293
295
  alias old_initialize initialize
294
- def initialize(a, params={})
295
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
296
+ def initialize(a, *args)
297
+ argument_names = %w{pix opts width height}
298
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
299
+ params = {}
300
+ params = args.pop if args.last.is_a? Hash
301
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
296
302
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
297
303
  params = default_params.merge(params)
298
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
304
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
299
305
  end
300
306
  end
301
307
 
302
308
  class FXButton
303
309
  alias old_initialize initialize
304
- def initialize(parent, text, params={})
310
+ def initialize(parent, text, *args)
311
+ argument_names = %w{icon target selector opts x y width height padLeft padRight padTop padBottom}
305
312
  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
+ params = {}
314
+ params = args.pop if args.last.is_a? Hash
315
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
306
316
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
307
317
  params = default_params.merge(params)
308
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])
@@ -311,8 +321,12 @@ module Fox
311
321
 
312
322
  class FXCanvas
313
323
  alias old_initialize initialize
314
- def initialize(parent, params={})
324
+ def initialize(parent, *args)
325
+ argument_names = %w{target selector opts x y width height}
315
326
  default_params = { :target => nil, :selector => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
327
+ params = {}
328
+ params = args.pop if args.last.is_a? Hash
329
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
316
330
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
317
331
  params = default_params.merge(params)
318
332
  old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
@@ -321,8 +335,12 @@ module Fox
321
335
 
322
336
  class FXCheckButton
323
337
  alias old_initialize initialize
324
- def initialize(parent, text, params={})
338
+ def initialize(parent, text, *args)
339
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
325
340
  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
+ params = {}
342
+ params = args.pop if args.last.is_a? Hash
343
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
326
344
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
327
345
  params = default_params.merge(params)
328
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])
@@ -331,18 +349,26 @@ module Fox
331
349
 
332
350
  class FXChoiceBox
333
351
  alias old_initialize initialize
334
- def initialize(owner, caption, text, icon, choices, params={})
335
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
352
+ def initialize(owner, caption, text, icon, choices, *args)
353
+ argument_names = %w{opts x y width height}
354
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
355
+ params = {}
356
+ params = args.pop if args.last.is_a? Hash
357
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
336
358
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
337
359
  params = default_params.merge(params)
338
- old_initialize(owner, caption, text, icon, choices, params[:opts], params[:x], params[:y], params[:w], params[:h])
360
+ old_initialize(owner, caption, text, icon, choices, params[:opts], params[:x], params[:y], params[:width], params[:height])
339
361
  end
340
362
  end
341
363
 
342
364
  class FXColorBar
343
365
  alias old_initialize initialize
344
- def initialize(parent, params={})
366
+ def initialize(parent, *args)
367
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
345
368
  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
+ params = {}
370
+ params = args.pop if args.last.is_a? Hash
371
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
346
372
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
347
373
  params = default_params.merge(params)
348
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])
@@ -351,8 +377,12 @@ module Fox
351
377
 
352
378
  class FXColorDialog
353
379
  alias old_initialize initialize
354
- def initialize(owner, title, params={})
380
+ def initialize(owner, title, *args)
381
+ argument_names = %w{opts x y width height}
355
382
  default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
383
+ params = {}
384
+ params = args.pop if args.last.is_a? Hash
385
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
356
386
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
357
387
  params = default_params.merge(params)
358
388
  old_initialize(owner, title, params[:opts], params[:x], params[:y], params[:width], params[:height])
@@ -361,8 +391,12 @@ module Fox
361
391
 
362
392
  class FXColorItem
363
393
  alias old_initialize initialize
364
- def initialize(text, clr, params={})
394
+ def initialize(text, clr, *args)
395
+ argument_names = %w{data}
365
396
  default_params = { :data => nil }
397
+ params = {}
398
+ params = args.pop if args.last.is_a? Hash
399
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
366
400
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
367
401
  params = default_params.merge(params)
368
402
  old_initialize(text, clr, params[:data])
@@ -371,28 +405,40 @@ module Fox
371
405
 
372
406
  class FXColorList
373
407
  alias old_initialize initialize
374
- def initialize(p, params={})
375
- default_params = { :tgt => nil, :sel => 0, :opts => LIST_BROWSESELECT, :x => 0, :y => 0, :w => 0, :h => 0 }
408
+ def initialize(p, *args)
409
+ argument_names = %w{target selector opts x y width height}
410
+ default_params = { :target => nil, :selector => 0, :opts => LIST_BROWSESELECT, :x => 0, :y => 0, :width => 0, :height => 0 }
411
+ params = {}
412
+ params = args.pop if args.last.is_a? Hash
413
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
376
414
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
377
415
  params = default_params.merge(params)
378
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
416
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
379
417
  end
380
418
  end
381
419
 
382
420
  class FXColorRing
383
421
  alias old_initialize initialize
384
- def initialize(p, params={})
385
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
422
+ def initialize(p, *args)
423
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
424
+ 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
+ params = {}
426
+ params = args.pop if args.last.is_a? Hash
427
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
386
428
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
387
429
  params = default_params.merge(params)
388
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
389
431
  end
390
432
  end
391
433
 
392
434
  class FXColorSelector
393
435
  alias old_initialize initialize
394
- def initialize(parent, params={})
436
+ def initialize(parent, *args)
437
+ argument_names = %w{target selector opts x y width height}
395
438
  default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
439
+ params = {}
440
+ params = args.pop if args.last.is_a? Hash
441
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
396
442
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
397
443
  params = default_params.merge(params)
398
444
  old_initialize(parent, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
@@ -401,8 +447,12 @@ module Fox
401
447
 
402
448
  class FXColorWell
403
449
  alias old_initialize initialize
404
- def initialize(parent, params={})
450
+ def initialize(parent, *args)
451
+ argument_names = %w{color target selector opts x y width height padLeft padRight padTop padBottom}
405
452
  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
+ params = {}
454
+ params = args.pop if args.last.is_a? Hash
455
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
406
456
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
407
457
  params = default_params.merge(params)
408
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])
@@ -411,138 +461,82 @@ module Fox
411
461
 
412
462
  class FXColorWheel
413
463
  alias old_initialize initialize
414
- def initialize(p, params={})
415
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
464
+ def initialize(p, *args)
465
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
466
+ 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
+ params = {}
468
+ params = args.pop if args.last.is_a? Hash
469
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
416
470
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
417
471
  params = default_params.merge(params)
418
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
419
473
  end
420
474
  end
421
475
 
422
476
  class FXComboBox
423
477
  alias old_initialize initialize
424
- def initialize(p, cols, params={})
425
- default_params = { :tgt => nil, :sel => 0, :opts => COMBOBOX_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
478
+ def initialize(p, cols, *args)
479
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
480
+ 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
+ params = {}
482
+ params = args.pop if args.last.is_a? Hash
483
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
426
484
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
427
485
  params = default_params.merge(params)
428
- old_initialize(p, cols, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
429
487
  end
430
488
  end
431
489
 
432
490
  class FXComposite
433
491
  alias old_initialize initialize
434
- def initialize(parent, params={})
492
+ def initialize(parent, *args)
493
+ argument_names = %w{opts x y width height}
435
494
  default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
495
+ params = {}
496
+ params = args.pop if args.last.is_a? Hash
497
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
436
498
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
437
499
  params = default_params.merge(params)
438
500
  old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height])
439
501
  end
440
502
  end
441
503
 
442
- class FXCURCursor
443
- alias old_initialize initialize
444
- def initialize(app, pixels, params={})
445
- default_params = { }
446
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
447
- params = default_params.merge(params)
448
- old_initialize(app, pixels)
449
- end
450
- end
451
-
452
504
  class FXDataTarget
453
505
  alias old_initialize initialize
454
- def initialize(params={})
455
- default_params = { :value => nil, :tgt => nil, :sel => 0 }
456
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
457
- params = default_params.merge(params)
458
- old_initialize(params[:value], params[:tgt], params[:sel])
459
- end
460
- end
461
-
462
- class FXSegment
463
- alias old_initialize initialize
464
- def initialize(params={})
465
- default_params = { }
466
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
467
- params = default_params.merge(params)
468
- old_initialize()
469
- end
470
- end
471
-
472
- class FXArc
473
- alias old_initialize initialize
474
- def initialize(params={})
475
- default_params = { }
476
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
477
- params = default_params.merge(params)
478
- old_initialize()
479
- end
480
- end
481
-
482
- class FXDC
483
- alias old_initialize initialize
484
- def initialize(app, params={})
485
- default_params = { }
486
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
487
- params = default_params.merge(params)
488
- old_initialize(app)
489
- end
490
- end
491
-
492
- class FXPSBounds
493
- alias old_initialize initialize
494
- def initialize(params={})
495
- default_params = { }
496
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
497
- params = default_params.merge(params)
498
- old_initialize()
499
- end
500
- end
501
-
502
- class FXPrinter
503
- alias old_initialize initialize
504
- def initialize(params={})
505
- default_params = { }
506
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
507
- params = default_params.merge(params)
508
- old_initialize()
509
- end
510
- end
511
-
512
- class FXDCPrint
513
- alias old_initialize initialize
514
- def initialize(app, params={})
515
- default_params = { }
506
+ def initialize(*args)
507
+ argument_names = %w{value target selector}
508
+ default_params = { :value => nil, :target => nil, :selector => 0 }
509
+ params = {}
510
+ params = args.pop if args.last.is_a? Hash
511
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
516
512
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
517
513
  params = default_params.merge(params)
518
- old_initialize(app)
514
+ old_initialize(params[:value], params[:target], params[:selector])
519
515
  end
520
516
  end
521
517
 
522
518
  class FXDCWindow
523
519
  alias old_initialize initialize
524
- def initialize(drawable, params={})
520
+ def initialize(drawable, *args)
521
+ argument_names = %w{event}
525
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
526
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
527
527
  params = default_params.merge(params)
528
528
  old_initialize(drawable, params[:event])
529
529
  end
530
530
  end
531
531
 
532
- class FXDebugTarget
533
- alias old_initialize initialize
534
- def initialize(params={})
535
- default_params = { }
536
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
537
- params = default_params.merge(params)
538
- old_initialize()
539
- end
540
- end
541
-
542
532
  class FXDelegator
543
533
  alias old_initialize initialize
544
- def initialize(params={})
534
+ def initialize(*args)
535
+ argument_names = %w{delegate}
545
536
  default_params = { :delegate => nil }
537
+ params = {}
538
+ params = args.pop if args.last.is_a? Hash
539
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
546
540
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
547
541
  params = default_params.merge(params)
548
542
  old_initialize(params[:delegate])
@@ -551,58 +545,68 @@ module Fox
551
545
 
552
546
  class FXDial
553
547
  alias old_initialize initialize
554
- def initialize(p, params={})
555
- default_params = { :tgt => nil, :sel => 0, :opts => DIAL_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
548
+ def initialize(p, *args)
549
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
550
+ 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
+ params = {}
552
+ params = args.pop if args.last.is_a? Hash
553
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
556
554
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
557
555
  params = default_params.merge(params)
558
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
559
557
  end
560
558
  end
561
559
 
562
560
  class FXDialogBox
563
561
  alias old_initialize initialize
564
- def initialize(owner, title, params={})
565
- default_params = { :opts => DECOR_TITLE|DECOR_BORDER, :x => 0, :y => 0, :w => 0, :h => 0, :padLeft => 10, :padRight => 10, :padTop => 10, :padBottom => 10, :hSpacing => 4, :vSpacing => 4 }
566
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
567
- params = default_params.merge(params)
568
- old_initialize(owner, title, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom], params[:hSpacing], params[:vSpacing])
569
- end
570
- end
571
-
572
- class FXDict
573
- alias old_initialize initialize
574
- def initialize(params={})
575
- default_params = { }
562
+ def initialize(owner, title, *args)
563
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
564
+ 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
+ params = {}
566
+ params = args.pop if args.last.is_a? Hash
567
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
576
568
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
577
569
  params = default_params.merge(params)
578
- old_initialize()
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])
579
571
  end
580
572
  end
581
573
 
582
574
  class FXDirBox
583
575
  alias old_initialize initialize
584
- def initialize(p, params={})
585
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
576
+ def initialize(p, *args)
577
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
578
+ 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
+ params = {}
580
+ params = args.pop if args.last.is_a? Hash
581
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
586
582
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
587
583
  params = default_params.merge(params)
588
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
589
585
  end
590
586
  end
591
587
 
592
588
  class FXDirDialog
593
589
  alias old_initialize initialize
594
- def initialize(owner, name, params={})
595
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 500, :h => 300 }
590
+ def initialize(owner, name, *args)
591
+ argument_names = %w{opts x y width height}
592
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 500, :height => 300 }
593
+ params = {}
594
+ params = args.pop if args.last.is_a? Hash
595
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
596
596
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
597
597
  params = default_params.merge(params)
598
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:w], params[:h])
598
+ old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height])
599
599
  end
600
600
  end
601
601
 
602
602
  class FXDirItem
603
603
  alias old_initialize initialize
604
- def initialize(text, params={})
604
+ def initialize(text, *args)
605
+ argument_names = %w{oi ci data}
605
606
  default_params = { :oi => nil, :ci => nil, :data => nil }
607
+ params = {}
608
+ params = args.pop if args.last.is_a? Hash
609
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
606
610
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
607
611
  params = default_params.merge(params)
608
612
  old_initialize(text, params[:oi], params[:ci], params[:data])
@@ -611,118 +615,96 @@ module Fox
611
615
 
612
616
  class FXDirList
613
617
  alias old_initialize initialize
614
- def initialize(p, params={})
615
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
618
+ def initialize(p, *args)
619
+ argument_names = %w{target selector opts x y width height}
620
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
621
+ params = {}
622
+ params = args.pop if args.last.is_a? Hash
623
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
616
624
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
617
625
  params = default_params.merge(params)
618
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
626
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
619
627
  end
620
628
  end
621
629
 
622
630
  class FXDirSelector
623
631
  alias old_initialize initialize
624
- def initialize(p, params={})
625
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
626
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
627
- params = default_params.merge(params)
628
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
629
- end
630
- end
631
-
632
- class FXDockHandler
633
- alias old_initialize initialize
634
- def initialize(p, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb, params={})
635
- default_params = { }
632
+ def initialize(p, *args)
633
+ argument_names = %w{target selector opts x y width height}
634
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
635
+ params = {}
636
+ params = args.pop if args.last.is_a? Hash
637
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
636
638
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
637
639
  params = default_params.merge(params)
638
- old_initialize(p, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb)
640
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
639
641
  end
640
642
  end
641
643
 
642
644
  class FXDockSite
643
645
  alias old_initialize initialize
644
- def initialize(p, params={})
645
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0, :hs => 0, :vs => 0 }
646
+ def initialize(p, *args)
647
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
648
+ 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
+ params = {}
650
+ params = args.pop if args.last.is_a? Hash
651
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
646
652
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
647
653
  params = default_params.merge(params)
648
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
649
655
  end
650
656
  end
651
657
 
652
658
  class FXDockTitle
653
659
  alias old_initialize initialize
654
- def initialize(p, text, params={})
655
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_NORMAL|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
656
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
657
- params = default_params.merge(params)
658
- old_initialize(p, text, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
659
- end
660
- end
661
-
662
- class FXDocument
663
- alias old_initialize initialize
664
- def initialize(params={})
665
- default_params = { }
666
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
667
- params = default_params.merge(params)
668
- old_initialize()
669
- end
670
- end
671
-
672
- class FXDragCorner
673
- alias old_initialize initialize
674
- def initialize(p, params={})
675
- default_params = { }
660
+ def initialize(p, text, *args)
661
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
662
+ 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
+ params = {}
664
+ params = args.pop if args.last.is_a? Hash
665
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
676
666
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
677
667
  params = default_params.merge(params)
678
- old_initialize(p)
679
- end
680
- end
681
-
682
- class FXDrawable
683
- alias old_initialize initialize
684
- def initialize(params={})
685
- default_params = { }
686
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
687
- params = default_params.merge(params)
688
- old_initialize()
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])
689
669
  end
690
670
  end
691
671
 
692
672
  class FXDriveBox
693
673
  alias old_initialize initialize
694
- def initialize(p, params={})
695
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
674
+ def initialize(p, *args)
675
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
676
+ 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
+ params = {}
678
+ params = args.pop if args.last.is_a? Hash
679
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
696
680
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
697
681
  params = default_params.merge(params)
698
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
699
683
  end
700
684
  end
701
685
 
702
686
  class FXFileDialog
703
687
  alias old_initialize initialize
704
- def initialize(owner, name, params={})
705
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 500, :h => 300 }
706
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
707
- params = default_params.merge(params)
708
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:w], params[:h])
709
- end
710
- end
711
-
712
- class FXFileAssoc
713
- alias old_initialize initialize
714
- def initialize(params={})
715
- default_params = { }
688
+ def initialize(owner, name, *args)
689
+ argument_names = %w{opts x y width height}
690
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 500, :height => 300 }
691
+ params = {}
692
+ params = args.pop if args.last.is_a? Hash
693
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
716
694
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
717
695
  params = default_params.merge(params)
718
- old_initialize()
696
+ old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height])
719
697
  end
720
698
  end
721
699
 
722
700
  class FXFileDict
723
701
  alias old_initialize initialize
724
- def initialize(app, params={})
702
+ def initialize(app, *args)
703
+ argument_names = %w{db}
725
704
  default_params = { :db => nil }
705
+ params = {}
706
+ params = args.pop if args.last.is_a? Hash
707
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
726
708
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
727
709
  params = default_params.merge(params)
728
710
  old_initialize(app, params[:db])
@@ -731,8 +713,12 @@ module Fox
731
713
 
732
714
  class FXFileItem
733
715
  alias old_initialize initialize
734
- def initialize(text, params={})
716
+ def initialize(text, *args)
717
+ argument_names = %w{bi mi ptr}
735
718
  default_params = { :bi => nil, :mi => nil, :ptr => nil }
719
+ params = {}
720
+ params = args.pop if args.last.is_a? Hash
721
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
736
722
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
737
723
  params = default_params.merge(params)
738
724
  old_initialize(text, params[:bi], params[:mi], params[:ptr])
@@ -741,28 +727,40 @@ module Fox
741
727
 
742
728
  class FXFileList
743
729
  alias old_initialize initialize
744
- def initialize(p, params={})
745
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
730
+ def initialize(p, *args)
731
+ argument_names = %w{target selector opts x y width height}
732
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
733
+ params = {}
734
+ params = args.pop if args.last.is_a? Hash
735
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
746
736
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
747
737
  params = default_params.merge(params)
748
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
738
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
749
739
  end
750
740
  end
751
741
 
752
742
  class FXFileSelector
753
743
  alias old_initialize initialize
754
- def initialize(p, params={})
755
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
744
+ def initialize(p, *args)
745
+ argument_names = %w{target selector opts x y width height}
746
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
747
+ params = {}
748
+ params = args.pop if args.last.is_a? Hash
749
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
756
750
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
757
751
  params = default_params.merge(params)
758
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
752
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
759
753
  end
760
754
  end
761
755
 
762
756
  class FXFileStream
763
757
  alias old_initialize initialize
764
- def initialize(params={})
758
+ def initialize(*args)
759
+ argument_names = %w{cont}
765
760
  default_params = { :cont => nil }
761
+ params = {}
762
+ params = args.pop if args.last.is_a? Hash
763
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
766
764
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
767
765
  params = default_params.merge(params)
768
766
  old_initialize(params[:cont])
@@ -771,8 +769,12 @@ module Fox
771
769
 
772
770
  class FXFoldingItem
773
771
  alias old_initialize initialize
774
- def initialize(text, params={})
772
+ def initialize(text, *args)
773
+ argument_names = %w{openIcon closedIcon data}
775
774
  default_params = { :openIcon => nil, :closedIcon => nil, :data => nil }
775
+ params = {}
776
+ params = args.pop if args.last.is_a? Hash
777
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
776
778
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
777
779
  params = default_params.merge(params)
778
780
  old_initialize(text, params[:openIcon], params[:closedIcon], params[:data])
@@ -781,48 +783,54 @@ module Fox
781
783
 
782
784
  class FXFoldingList
783
785
  alias old_initialize initialize
784
- def initialize(p, params={})
785
- default_params = { :tgt => nil, :sel => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
786
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
787
- params = default_params.merge(params)
788
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
789
- end
790
- end
791
-
792
- class FXFontDesc
793
- alias old_initialize initialize
794
- def initialize(params={})
795
- default_params = { }
786
+ def initialize(p, *args)
787
+ argument_names = %w{target selector opts x y width height}
788
+ default_params = { :target => nil, :selector => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
789
+ params = {}
790
+ params = args.pop if args.last.is_a? Hash
791
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
796
792
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
797
793
  params = default_params.merge(params)
798
- old_initialize()
794
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
799
795
  end
800
796
  end
801
797
 
802
798
  class FXFontDialog
803
799
  alias old_initialize initialize
804
- def initialize(owner, name, params={})
805
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 600, :h => 380 }
800
+ def initialize(owner, name, *args)
801
+ argument_names = %w{opts x y width height}
802
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 600, :height => 380 }
803
+ params = {}
804
+ params = args.pop if args.last.is_a? Hash
805
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
806
806
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
807
807
  params = default_params.merge(params)
808
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:w], params[:h])
808
+ old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height])
809
809
  end
810
810
  end
811
811
 
812
812
  class FXFontSelector
813
813
  alias old_initialize initialize
814
- def initialize(p, params={})
815
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
814
+ def initialize(p, *args)
815
+ argument_names = %w{target selector opts x y width height}
816
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
817
+ params = {}
818
+ params = args.pop if args.last.is_a? Hash
819
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
816
820
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
817
821
  params = default_params.merge(params)
818
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
822
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
819
823
  end
820
824
  end
821
825
 
822
826
  class FXFrame
823
827
  alias old_initialize initialize
824
- def initialize(parent, params={})
828
+ def initialize(parent, *args)
829
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
825
830
  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
+ params = {}
832
+ params = args.pop if args.last.is_a? Hash
833
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
826
834
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
827
835
  params = default_params.merge(params)
828
836
  old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
@@ -831,8 +839,12 @@ module Fox
831
839
 
832
840
  class FXGIFCursor
833
841
  alias old_initialize initialize
834
- def initialize(a, pix, params={})
842
+ def initialize(a, pix, *args)
843
+ argument_names = %w{hx hy}
835
844
  default_params = { :hx => -1, :hy => -1 }
845
+ params = {}
846
+ params = args.pop if args.last.is_a? Hash
847
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
836
848
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
837
849
  params = default_params.merge(params)
838
850
  old_initialize(a, pix, params[:hx], params[:hy])
@@ -841,118 +853,82 @@ module Fox
841
853
 
842
854
  class FXGIFIcon
843
855
  alias old_initialize initialize
844
- def initialize(a, params={})
845
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
856
+ def initialize(a, *args)
857
+ argument_names = %w{pix clr opts width height}
858
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
859
+ params = {}
860
+ params = args.pop if args.last.is_a? Hash
861
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
846
862
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
847
863
  params = default_params.merge(params)
848
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
864
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
849
865
  end
850
866
  end
851
867
 
852
868
  class FXGIFImage
853
869
  alias old_initialize initialize
854
- def initialize(a, params={})
855
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
870
+ def initialize(a, *args)
871
+ argument_names = %w{pix opts width height}
872
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
873
+ params = {}
874
+ params = args.pop if args.last.is_a? Hash
875
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
856
876
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
857
877
  params = default_params.merge(params)
858
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
878
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
859
879
  end
860
880
  end
861
881
 
862
882
  class FXGLContext
863
883
  alias old_initialize initialize
864
- def initialize(app, visual, params={})
884
+ def initialize(app, visual, *args)
885
+ argument_names = %w{other}
865
886
  default_params = { :other => nil }
887
+ params = {}
888
+ params = args.pop if args.last.is_a? Hash
889
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
866
890
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
867
891
  params = default_params.merge(params)
868
892
  old_initialize(app, visual, params[:other])
869
893
  end
870
894
  end
871
895
 
872
- class FXGLObject
873
- alias old_initialize initialize
874
- def initialize(params={})
875
- default_params = { }
876
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
877
- params = default_params.merge(params)
878
- old_initialize()
879
- end
880
- end
881
-
882
896
  class FXGLShape
883
897
  alias old_initialize initialize
884
- def initialize(x, y, z, opts, params={})
898
+ def initialize(x, y, z, opts, *args)
899
+ argument_names = %w{front back}
885
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 }
886
904
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
887
905
  params = default_params.merge(params)
888
906
  old_initialize(x, y, z, opts, params[:front], params[:back])
889
907
  end
890
908
  end
891
909
 
892
- class FXViewport
893
- alias old_initialize initialize
894
- def initialize(params={})
895
- default_params = { }
896
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
897
- params = default_params.merge(params)
898
- old_initialize()
899
- end
900
- end
901
-
902
- class FXLight
903
- alias old_initialize initialize
904
- def initialize(params={})
905
- default_params = { }
906
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
907
- params = default_params.merge(params)
908
- old_initialize()
909
- end
910
- end
911
-
912
- class FXMaterial
913
- alias old_initialize initialize
914
- def initialize(params={})
915
- default_params = { }
916
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
917
- params = default_params.merge(params)
918
- old_initialize()
919
- end
920
- end
921
-
922
- class FXGLVisual
923
- alias old_initialize initialize
924
- def initialize(app, flags, params={})
925
- default_params = { }
926
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
927
- params = default_params.merge(params)
928
- old_initialize(app, flags)
929
- end
930
- end
931
-
932
- class FXGradient
933
- alias old_initialize initialize
934
- def initialize(params={})
935
- default_params = { }
936
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
937
- params = default_params.merge(params)
938
- old_initialize()
939
- end
940
- end
941
-
942
910
  class FXGradientBar
943
911
  alias old_initialize initialize
944
- def initialize(p, params={})
945
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
912
+ def initialize(p, *args)
913
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
914
+ 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
+ params = {}
916
+ params = args.pop if args.last.is_a? Hash
917
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
946
918
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
947
919
  params = default_params.merge(params)
948
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
949
921
  end
950
922
  end
951
923
 
952
924
  class FXGroupBox
953
925
  alias old_initialize initialize
954
- def initialize(parent, text, params={})
926
+ def initialize(parent, text, *args)
927
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
955
928
  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
+ params = {}
930
+ params = args.pop if args.last.is_a? Hash
931
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
956
932
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
957
933
  params = default_params.merge(params)
958
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])
@@ -961,8 +937,12 @@ module Fox
961
937
 
962
938
  class FXHeaderItem
963
939
  alias old_initialize initialize
964
- def initialize(text, params={})
940
+ def initialize(text, *args)
941
+ argument_names = %w{ic s ptr}
965
942
  default_params = { :ic => nil, :s => 0, :ptr => nil }
943
+ params = {}
944
+ params = args.pop if args.last.is_a? Hash
945
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
966
946
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
967
947
  params = default_params.merge(params)
968
948
  old_initialize(text, params[:ic], params[:s], params[:ptr])
@@ -971,58 +951,82 @@ module Fox
971
951
 
972
952
  class FXHeader
973
953
  alias old_initialize initialize
974
- def initialize(p, params={})
975
- default_params = { :tgt => nil, :sel => 0, :opts => HEADER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
954
+ def initialize(p, *args)
955
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
956
+ 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
+ params = {}
958
+ params = args.pop if args.last.is_a? Hash
959
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
976
960
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
977
961
  params = default_params.merge(params)
978
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
979
963
  end
980
964
  end
981
965
 
982
966
  class FXHorizontalFrame
983
967
  alias old_initialize initialize
984
- def initialize(p, params={})
985
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
968
+ def initialize(p, *args)
969
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
970
+ 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
+ params = {}
972
+ params = args.pop if args.last.is_a? Hash
973
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
986
974
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
987
975
  params = default_params.merge(params)
988
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
989
977
  end
990
978
  end
991
979
 
992
980
  class FXICOIcon
993
981
  alias old_initialize initialize
994
- def initialize(a, params={})
995
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
982
+ def initialize(a, *args)
983
+ argument_names = %w{pix clr opts width height}
984
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
985
+ params = {}
986
+ params = args.pop if args.last.is_a? Hash
987
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
996
988
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
997
989
  params = default_params.merge(params)
998
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
990
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
999
991
  end
1000
992
  end
1001
993
 
1002
994
  class FXICOImage
1003
995
  alias old_initialize initialize
1004
- def initialize(a, params={})
1005
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
996
+ def initialize(a, *args)
997
+ argument_names = %w{pix opts width height}
998
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
999
+ params = {}
1000
+ params = args.pop if args.last.is_a? Hash
1001
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1006
1002
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1007
1003
  params = default_params.merge(params)
1008
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1004
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1009
1005
  end
1010
1006
  end
1011
1007
 
1012
1008
  class FXIcon
1013
1009
  alias old_initialize initialize
1014
- def initialize(app, params={})
1015
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1010
+ def initialize(app, *args)
1011
+ argument_names = %w{pix clr opts width height}
1012
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1013
+ params = {}
1014
+ params = args.pop if args.last.is_a? Hash
1015
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1016
1016
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1017
1017
  params = default_params.merge(params)
1018
- old_initialize(app, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1018
+ old_initialize(app, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1019
1019
  end
1020
1020
  end
1021
1021
 
1022
1022
  class FXIconDict
1023
1023
  alias old_initialize initialize
1024
- def initialize(app, params={})
1024
+ def initialize(app, *args)
1025
+ argument_names = %w{path}
1025
1026
  default_params = { :path => defaultIconPath }
1027
+ params = {}
1028
+ params = args.pop if args.last.is_a? Hash
1029
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1026
1030
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1027
1031
  params = default_params.merge(params)
1028
1032
  old_initialize(app, params[:path])
@@ -1031,8 +1035,12 @@ module Fox
1031
1035
 
1032
1036
  class FXIconItem
1033
1037
  alias old_initialize initialize
1034
- def initialize(text, params={})
1038
+ def initialize(text, *args)
1039
+ argument_names = %w{bigIcon miniIcon data}
1035
1040
  default_params = { :bigIcon => nil, :miniIcon => nil, :data => nil }
1041
+ params = {}
1042
+ params = args.pop if args.last.is_a? Hash
1043
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1036
1044
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1037
1045
  params = default_params.merge(params)
1038
1046
  old_initialize(text, params[:bigIcon], params[:miniIcon], params[:data])
@@ -1041,108 +1049,124 @@ module Fox
1041
1049
 
1042
1050
  class FXIconList
1043
1051
  alias old_initialize initialize
1044
- def initialize(p, params={})
1045
- default_params = { :tgt => nil, :sel => 0, :opts => ICONLIST_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
1052
+ def initialize(p, *args)
1053
+ argument_names = %w{target selector opts x y width height}
1054
+ default_params = { :target => nil, :selector => 0, :opts => ICONLIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1055
+ params = {}
1056
+ params = args.pop if args.last.is_a? Hash
1057
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1046
1058
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1047
1059
  params = default_params.merge(params)
1048
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1049
- end
1050
- end
1051
-
1052
- class FXIconSource
1053
- alias old_initialize initialize
1054
- def initialize(app, params={})
1055
- default_params = { }
1056
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1057
- params = default_params.merge(params)
1058
- old_initialize(app)
1059
- end
1060
- end
1061
-
1062
- class FXId
1063
- alias old_initialize initialize
1064
- def initialize(params={})
1065
- default_params = { }
1066
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1067
- params = default_params.merge(params)
1068
- old_initialize()
1060
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1069
1061
  end
1070
1062
  end
1071
1063
 
1072
1064
  class FXImage
1073
1065
  alias old_initialize initialize
1074
- def initialize(a, params={})
1075
- default_params = { :pixels => nil, :opts => 0, :w => 1, :h => 1 }
1066
+ def initialize(a, *args)
1067
+ argument_names = %w{pixels opts width height}
1068
+ default_params = { :pixels => nil, :opts => 0, :width => 1, :height => 1 }
1069
+ params = {}
1070
+ params = args.pop if args.last.is_a? Hash
1071
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1076
1072
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1077
1073
  params = default_params.merge(params)
1078
- old_initialize(a, params[:pixels], params[:opts], params[:w], params[:h])
1074
+ old_initialize(a, params[:pixels], params[:opts], params[:width], params[:height])
1079
1075
  end
1080
1076
  end
1081
1077
 
1082
1078
  class FXImageFrame
1083
1079
  alias old_initialize initialize
1084
- def initialize(p, img, params={})
1085
- default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
1080
+ def initialize(p, img, *args)
1081
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
1082
+ default_params = { :opts => FRAME_SUNKEN|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0 }
1083
+ params = {}
1084
+ params = args.pop if args.last.is_a? Hash
1085
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1086
1086
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1087
1087
  params = default_params.merge(params)
1088
- old_initialize(p, img, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1088
+ old_initialize(p, img, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1089
1089
  end
1090
1090
  end
1091
1091
 
1092
1092
  class FXImageView
1093
1093
  alias old_initialize initialize
1094
- def initialize(p, params={})
1095
- default_params = { :img => nil, :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1094
+ def initialize(p, *args)
1095
+ argument_names = %w{img target selector opts x y width height}
1096
+ default_params = { :img => nil, :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1097
+ params = {}
1098
+ params = args.pop if args.last.is_a? Hash
1099
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1096
1100
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1097
1101
  params = default_params.merge(params)
1098
- old_initialize(p, params[:img], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1102
+ old_initialize(p, params[:img], params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1099
1103
  end
1100
1104
  end
1101
1105
 
1102
1106
  class FXInputDialog
1103
1107
  alias old_initialize initialize
1104
- def initialize(owner, caption, label, params={})
1105
- default_params = { :icon => nil, :opts => INPUTDIALOG_STRING, :x => 0, :y => 0, :w => 0, :h => 0 }
1108
+ def initialize(owner, caption, label, *args)
1109
+ argument_names = %w{icon opts x y width height}
1110
+ default_params = { :icon => nil, :opts => INPUTDIALOG_STRING, :x => 0, :y => 0, :width => 0, :height => 0 }
1111
+ params = {}
1112
+ params = args.pop if args.last.is_a? Hash
1113
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1106
1114
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1107
1115
  params = default_params.merge(params)
1108
- old_initialize(owner, caption, label, params[:icon], params[:opts], params[:x], params[:y], params[:w], params[:h])
1116
+ old_initialize(owner, caption, label, params[:icon], params[:opts], params[:x], params[:y], params[:width], params[:height])
1109
1117
  end
1110
1118
  end
1111
1119
 
1112
1120
  class FXJPGIcon
1113
1121
  alias old_initialize initialize
1114
- def initialize(a, params={})
1115
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1122
+ def initialize(a, *args)
1123
+ argument_names = %w{pix clr opts width height}
1124
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1125
+ params = {}
1126
+ params = args.pop if args.last.is_a? Hash
1127
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1116
1128
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1117
1129
  params = default_params.merge(params)
1118
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1130
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1119
1131
  end
1120
1132
  end
1121
1133
 
1122
1134
  class FXJPGImage
1123
1135
  alias old_initialize initialize
1124
- def initialize(a, params={})
1125
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
1136
+ def initialize(a, *args)
1137
+ argument_names = %w{pix opts width height}
1138
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1139
+ params = {}
1140
+ params = args.pop if args.last.is_a? Hash
1141
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1126
1142
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1127
1143
  params = default_params.merge(params)
1128
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1144
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1129
1145
  end
1130
1146
  end
1131
1147
 
1132
1148
  class FXKnob
1133
1149
  alias old_initialize initialize
1134
- def initialize(p, params={})
1135
- default_params = { :tgt => nil, :sel => 0, :opts => KNOB_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1150
+ def initialize(p, *args)
1151
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1152
+ 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
+ params = {}
1154
+ params = args.pop if args.last.is_a? Hash
1155
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1136
1156
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1137
1157
  params = default_params.merge(params)
1138
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1139
1159
  end
1140
1160
  end
1141
1161
 
1142
1162
  class FXLabel
1143
1163
  alias old_initialize initialize
1144
- def initialize(parent, text, params={})
1164
+ def initialize(parent, text, *args)
1165
+ argument_names = %w{icon opts x y width height padLeft padRight padTop padBottom}
1145
1166
  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
+ params = {}
1168
+ params = args.pop if args.last.is_a? Hash
1169
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1146
1170
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1147
1171
  params = default_params.merge(params)
1148
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])
@@ -1151,8 +1175,12 @@ module Fox
1151
1175
 
1152
1176
  class FXListItem
1153
1177
  alias old_initialize initialize
1154
- def initialize(text, params={})
1178
+ def initialize(text, *args)
1179
+ argument_names = %w{icon data}
1155
1180
  default_params = { :icon => nil, :data => nil }
1181
+ params = {}
1182
+ params = args.pop if args.last.is_a? Hash
1183
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1156
1184
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1157
1185
  params = default_params.merge(params)
1158
1186
  old_initialize(text, params[:icon], params[:data])
@@ -1161,28 +1189,40 @@ module Fox
1161
1189
 
1162
1190
  class FXList
1163
1191
  alias old_initialize initialize
1164
- def initialize(p, params={})
1165
- default_params = { :tgt => nil, :sel => 0, :opts => LIST_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
1192
+ def initialize(p, *args)
1193
+ argument_names = %w{target selector opts x y width height}
1194
+ default_params = { :target => nil, :selector => 0, :opts => LIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1195
+ params = {}
1196
+ params = args.pop if args.last.is_a? Hash
1197
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1166
1198
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1167
1199
  params = default_params.merge(params)
1168
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1200
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1169
1201
  end
1170
1202
  end
1171
1203
 
1172
1204
  class FXListBox
1173
1205
  alias old_initialize initialize
1174
- def initialize(p, params={})
1175
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1206
+ def initialize(p, *args)
1207
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1208
+ 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
+ params = {}
1210
+ params = args.pop if args.last.is_a? Hash
1211
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1176
1212
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1177
1213
  params = default_params.merge(params)
1178
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1179
1215
  end
1180
1216
  end
1181
1217
 
1182
1218
  class FXMainWindow
1183
1219
  alias old_initialize initialize
1184
- def initialize(app, title, params={})
1220
+ def initialize(app, title, *args)
1221
+ argument_names = %w{icon miniIcon opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1185
1222
  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
+ params = {}
1224
+ params = args.pop if args.last.is_a? Hash
1225
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1186
1226
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1187
1227
  params = default_params.merge(params)
1188
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])
@@ -1191,8 +1231,12 @@ module Fox
1191
1231
 
1192
1232
  class FXMatrix
1193
1233
  alias old_initialize initialize
1194
- def initialize(parent, params={})
1234
+ def initialize(parent, *args)
1235
+ argument_names = %w{n opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1195
1236
  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
+ params = {}
1238
+ params = args.pop if args.last.is_a? Hash
1239
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1196
1240
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1197
1241
  params = default_params.merge(params)
1198
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])
@@ -1201,98 +1245,124 @@ module Fox
1201
1245
 
1202
1246
  class FXMDIDeleteButton
1203
1247
  alias old_initialize initialize
1204
- def initialize(p, params={})
1205
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :w => 0, :h => 0 }
1248
+ def initialize(p, *args)
1249
+ argument_names = %w{target selector opts x y width height}
1250
+ default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1251
+ params = {}
1252
+ params = args.pop if args.last.is_a? Hash
1253
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1206
1254
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1207
1255
  params = default_params.merge(params)
1208
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1256
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1209
1257
  end
1210
1258
  end
1211
1259
 
1212
1260
  class FXMDIRestoreButton
1213
1261
  alias old_initialize initialize
1214
- def initialize(p, params={})
1215
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :w => 0, :h => 0 }
1262
+ def initialize(p, *args)
1263
+ argument_names = %w{target selector opts x y width height}
1264
+ default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1265
+ params = {}
1266
+ params = args.pop if args.last.is_a? Hash
1267
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1216
1268
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1217
1269
  params = default_params.merge(params)
1218
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1270
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1219
1271
  end
1220
1272
  end
1221
1273
 
1222
1274
  class FXMDIMaximizeButton
1223
1275
  alias old_initialize initialize
1224
- def initialize(p, params={})
1225
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :w => 0, :h => 0 }
1276
+ def initialize(p, *args)
1277
+ argument_names = %w{target selector opts x y width height}
1278
+ default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1279
+ params = {}
1280
+ params = args.pop if args.last.is_a? Hash
1281
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1226
1282
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1227
1283
  params = default_params.merge(params)
1228
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1284
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1229
1285
  end
1230
1286
  end
1231
1287
 
1232
1288
  class FXMDIMinimizeButton
1233
1289
  alias old_initialize initialize
1234
- def initialize(p, params={})
1235
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :w => 0, :h => 0 }
1290
+ def initialize(p, *args)
1291
+ argument_names = %w{target selector opts x y width height}
1292
+ default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
1293
+ params = {}
1294
+ params = args.pop if args.last.is_a? Hash
1295
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1236
1296
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1237
1297
  params = default_params.merge(params)
1238
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1298
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1239
1299
  end
1240
1300
  end
1241
1301
 
1242
1302
  class FXMDIWindowButton
1243
1303
  alias old_initialize initialize
1244
- def initialize(p, pup, params={})
1245
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1304
+ def initialize(p, pup, *args)
1305
+ argument_names = %w{target selector opts x y width height}
1306
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1307
+ params = {}
1308
+ params = args.pop if args.last.is_a? Hash
1309
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1246
1310
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1247
1311
  params = default_params.merge(params)
1248
- old_initialize(p, pup, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1312
+ old_initialize(p, pup, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1249
1313
  end
1250
1314
  end
1251
1315
 
1252
1316
  class FXMDIMenu
1253
1317
  alias old_initialize initialize
1254
- def initialize(owner, params={})
1255
- default_params = { :tgt => nil }
1318
+ def initialize(owner, *args)
1319
+ argument_names = %w{target}
1320
+ default_params = { :target => nil }
1321
+ params = {}
1322
+ params = args.pop if args.last.is_a? Hash
1323
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1256
1324
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1257
1325
  params = default_params.merge(params)
1258
- old_initialize(owner, params[:tgt])
1326
+ old_initialize(owner, params[:target])
1259
1327
  end
1260
1328
  end
1261
1329
 
1262
1330
  class FXMDIChild
1263
1331
  alias old_initialize initialize
1264
- def initialize(p, name, params={})
1265
- default_params = { :ic => nil, :pup => nil, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1332
+ def initialize(p, name, *args)
1333
+ argument_names = %w{ic pup opts x y width height}
1334
+ default_params = { :ic => nil, :pup => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1335
+ params = {}
1336
+ params = args.pop if args.last.is_a? Hash
1337
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1266
1338
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1267
1339
  params = default_params.merge(params)
1268
- old_initialize(p, name, params[:ic], params[:pup], params[:opts], params[:x], params[:y], params[:w], params[:h])
1340
+ old_initialize(p, name, params[:ic], params[:pup], params[:opts], params[:x], params[:y], params[:width], params[:height])
1269
1341
  end
1270
1342
  end
1271
1343
 
1272
1344
  class FXMDIClient
1273
1345
  alias old_initialize initialize
1274
- def initialize(p, params={})
1275
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1276
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1277
- params = default_params.merge(params)
1278
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h])
1279
- end
1280
- end
1281
-
1282
- class FXMemoryBuffer
1283
- alias old_initialize initialize
1284
- def initialize(data, params={})
1285
- default_params = { }
1346
+ def initialize(p, *args)
1347
+ argument_names = %w{opts x y width height}
1348
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1349
+ params = {}
1350
+ params = args.pop if args.last.is_a? Hash
1351
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1286
1352
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1287
1353
  params = default_params.merge(params)
1288
- old_initialize(data)
1354
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height])
1289
1355
  end
1290
1356
  end
1291
1357
 
1292
1358
  class FXMemoryStream
1293
1359
  alias old_initialize initialize
1294
- def initialize(params={})
1360
+ def initialize(*args)
1361
+ argument_names = %w{cont}
1295
1362
  default_params = { :cont => nil }
1363
+ params = {}
1364
+ params = args.pop if args.last.is_a? Hash
1365
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1296
1366
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1297
1367
  params = default_params.merge(params)
1298
1368
  old_initialize(params[:cont])
@@ -1301,8 +1371,12 @@ module Fox
1301
1371
 
1302
1372
  class FXMenuButton
1303
1373
  alias old_initialize initialize
1304
- def initialize(parent, text, params={})
1374
+ def initialize(parent, text, *args)
1375
+ argument_names = %w{icon popupMenu opts x y width height padLeft padRight padTop padBottom}
1305
1376
  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
+ params = {}
1378
+ params = args.pop if args.last.is_a? Hash
1379
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1306
1380
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1307
1381
  params = default_params.merge(params)
1308
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])
@@ -1311,8 +1385,12 @@ module Fox
1311
1385
 
1312
1386
  class FXMenuCaption
1313
1387
  alias old_initialize initialize
1314
- def initialize(parent, text, params={})
1388
+ def initialize(parent, text, *args)
1389
+ argument_names = %w{icon opts}
1315
1390
  default_params = { :icon => nil, :opts => 0 }
1391
+ params = {}
1392
+ params = args.pop if args.last.is_a? Hash
1393
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1316
1394
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1317
1395
  params = default_params.merge(params)
1318
1396
  old_initialize(parent, text, params[:icon], params[:opts])
@@ -1321,8 +1399,12 @@ module Fox
1321
1399
 
1322
1400
  class FXMenuCascade
1323
1401
  alias old_initialize initialize
1324
- def initialize(parent, text, params={})
1402
+ def initialize(parent, text, *args)
1403
+ argument_names = %w{icon popupMenu opts}
1325
1404
  default_params = { :icon => nil, :popupMenu => nil, :opts => 0 }
1405
+ params = {}
1406
+ params = args.pop if args.last.is_a? Hash
1407
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1326
1408
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1327
1409
  params = default_params.merge(params)
1328
1410
  old_initialize(parent, text, params[:icon], params[:popupMenu], params[:opts])
@@ -1331,28 +1413,40 @@ module Fox
1331
1413
 
1332
1414
  class FXMenuCheck
1333
1415
  alias old_initialize initialize
1334
- def initialize(p, text, params={})
1335
- default_params = { :tgt => nil, :sel => 0, :opts => 0 }
1416
+ def initialize(p, text, *args)
1417
+ argument_names = %w{target selector opts}
1418
+ default_params = { :target => nil, :selector => 0, :opts => 0 }
1419
+ params = {}
1420
+ params = args.pop if args.last.is_a? Hash
1421
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1336
1422
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1337
1423
  params = default_params.merge(params)
1338
- old_initialize(p, text, params[:tgt], params[:sel], params[:opts])
1424
+ old_initialize(p, text, params[:target], params[:selector], params[:opts])
1339
1425
  end
1340
1426
  end
1341
1427
 
1342
1428
  class FXMenuCommand
1343
1429
  alias old_initialize initialize
1344
- def initialize(p, text, params={})
1345
- default_params = { :ic => nil, :tgt => nil, :sel => 0, :opts => 0 }
1430
+ def initialize(p, text, *args)
1431
+ argument_names = %w{ic target selector opts}
1432
+ default_params = { :ic => nil, :target => nil, :selector => 0, :opts => 0 }
1433
+ params = {}
1434
+ params = args.pop if args.last.is_a? Hash
1435
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1346
1436
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1347
1437
  params = default_params.merge(params)
1348
- old_initialize(p, text, params[:ic], params[:tgt], params[:sel], params[:opts])
1438
+ old_initialize(p, text, params[:ic], params[:target], params[:selector], params[:opts])
1349
1439
  end
1350
1440
  end
1351
1441
 
1352
1442
  class FXMenuPane
1353
1443
  alias old_initialize initialize
1354
- def initialize(owner, params={})
1444
+ def initialize(owner, *args)
1445
+ argument_names = %w{opts}
1355
1446
  default_params = { :opts => 0 }
1447
+ params = {}
1448
+ params = args.pop if args.last.is_a? Hash
1449
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1356
1450
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1357
1451
  params = default_params.merge(params)
1358
1452
  old_initialize(owner, params[:opts])
@@ -1361,18 +1455,26 @@ module Fox
1361
1455
 
1362
1456
  class FXMenuRadio
1363
1457
  alias old_initialize initialize
1364
- def initialize(p, text, params={})
1365
- default_params = { :tgt => nil, :sel => 0, :opts => 0 }
1458
+ def initialize(p, text, *args)
1459
+ argument_names = %w{target selector opts}
1460
+ default_params = { :target => nil, :selector => 0, :opts => 0 }
1461
+ params = {}
1462
+ params = args.pop if args.last.is_a? Hash
1463
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1366
1464
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1367
1465
  params = default_params.merge(params)
1368
- old_initialize(p, text, params[:tgt], params[:sel], params[:opts])
1466
+ old_initialize(p, text, params[:target], params[:selector], params[:opts])
1369
1467
  end
1370
1468
  end
1371
1469
 
1372
1470
  class FXMenuSeparator
1373
1471
  alias old_initialize initialize
1374
- def initialize(parent, params={})
1472
+ def initialize(parent, *args)
1473
+ argument_names = %w{opts}
1375
1474
  default_params = { :opts => 0 }
1475
+ params = {}
1476
+ params = args.pop if args.last.is_a? Hash
1477
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1376
1478
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1377
1479
  params = default_params.merge(params)
1378
1480
  old_initialize(parent, params[:opts])
@@ -1381,8 +1483,12 @@ module Fox
1381
1483
 
1382
1484
  class FXMenuTitle
1383
1485
  alias old_initialize initialize
1384
- def initialize(parent, text, params={})
1486
+ def initialize(parent, text, *args)
1487
+ argument_names = %w{icon popupMenu opts}
1385
1488
  default_params = { :icon => nil, :popupMenu => nil, :opts => 0 }
1489
+ params = {}
1490
+ params = args.pop if args.last.is_a? Hash
1491
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1386
1492
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1387
1493
  params = default_params.merge(params)
1388
1494
  old_initialize(parent, text, params[:icon], params[:popupMenu], params[:opts])
@@ -1391,158 +1497,208 @@ module Fox
1391
1497
 
1392
1498
  class FXMessageBox
1393
1499
  alias old_initialize initialize
1394
- def initialize(owner, caption, text, params={})
1500
+ def initialize(owner, caption, text, *args)
1501
+ argument_names = %w{ic opts x y}
1395
1502
  default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0 }
1503
+ params = {}
1504
+ params = args.pop if args.last.is_a? Hash
1505
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1396
1506
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1397
1507
  params = default_params.merge(params)
1398
1508
  old_initialize(owner, caption, text, params[:ic], params[:opts], params[:x], params[:y])
1399
1509
  end
1400
1510
  end
1401
1511
 
1402
- class FXObject
1403
- alias old_initialize initialize
1404
- def initialize(params={})
1405
- default_params = { }
1406
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1407
- params = default_params.merge(params)
1408
- old_initialize()
1409
- end
1410
- end
1411
-
1412
1512
  class FXOption
1413
1513
  alias old_initialize initialize
1414
- def initialize(p, text, params={})
1415
- default_params = { :ic => nil, :tgt => nil, :sel => 0, :opts => JUSTIFY_NORMAL|ICON_BEFORE_TEXT, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1514
+ def initialize(p, text, *args)
1515
+ argument_names = %w{ic target selector opts x y width height padLeft padRight padTop padBottom}
1516
+ 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
+ params = {}
1518
+ params = args.pop if args.last.is_a? Hash
1519
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1416
1520
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1417
1521
  params = default_params.merge(params)
1418
- old_initialize(p, text, params[:ic], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1419
1523
  end
1420
1524
  end
1421
1525
 
1422
1526
  class FXOptionMenu
1423
1527
  alias old_initialize initialize
1424
- def initialize(p, params={})
1425
- default_params = { :pup => nil, :opts => JUSTIFY_NORMAL|ICON_BEFORE_TEXT, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1528
+ def initialize(p, *args)
1529
+ argument_names = %w{pup opts x y width height padLeft padRight padTop padBottom}
1530
+ 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
+ params = {}
1532
+ params = args.pop if args.last.is_a? Hash
1533
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1426
1534
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1427
1535
  params = default_params.merge(params)
1428
- old_initialize(p, params[:pup], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1536
+ old_initialize(p, params[:pup], params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1429
1537
  end
1430
1538
  end
1431
1539
 
1432
1540
  class FXPCXIcon
1433
1541
  alias old_initialize initialize
1434
- def initialize(a, params={})
1435
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1542
+ def initialize(a, *args)
1543
+ argument_names = %w{pix clr opts width height}
1544
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1545
+ params = {}
1546
+ params = args.pop if args.last.is_a? Hash
1547
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1436
1548
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1437
1549
  params = default_params.merge(params)
1438
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1550
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1439
1551
  end
1440
1552
  end
1441
1553
 
1442
1554
  class FXPCXImage
1443
1555
  alias old_initialize initialize
1444
- def initialize(a, params={})
1445
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
1556
+ def initialize(a, *args)
1557
+ argument_names = %w{pix opts width height}
1558
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1559
+ params = {}
1560
+ params = args.pop if args.last.is_a? Hash
1561
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1446
1562
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1447
1563
  params = default_params.merge(params)
1448
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1564
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1449
1565
  end
1450
1566
  end
1451
1567
 
1452
1568
  class FXPicker
1453
1569
  alias old_initialize initialize
1454
- def initialize(p, text, params={})
1455
- default_params = { :ic => nil, :tgt => nil, :sel => 0, :opts => BUTTON_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1570
+ def initialize(p, text, *args)
1571
+ argument_names = %w{ic target selector opts x y width height padLeft padRight padTop padBottom}
1572
+ 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
+ params = {}
1574
+ params = args.pop if args.last.is_a? Hash
1575
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1456
1576
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1457
1577
  params = default_params.merge(params)
1458
- old_initialize(p, text, params[:ic], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1459
1579
  end
1460
1580
  end
1461
1581
 
1462
1582
  class FXPNGIcon
1463
1583
  alias old_initialize initialize
1464
- def initialize(a, params={})
1465
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1584
+ def initialize(a, *args)
1585
+ argument_names = %w{pix clr opts width height}
1586
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1587
+ params = {}
1588
+ params = args.pop if args.last.is_a? Hash
1589
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1466
1590
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1467
1591
  params = default_params.merge(params)
1468
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1592
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1469
1593
  end
1470
1594
  end
1471
1595
 
1472
1596
  class FXPNGImage
1473
1597
  alias old_initialize initialize
1474
- def initialize(a, params={})
1475
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
1598
+ def initialize(a, *args)
1599
+ argument_names = %w{pix opts width height}
1600
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1601
+ params = {}
1602
+ params = args.pop if args.last.is_a? Hash
1603
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1476
1604
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1477
1605
  params = default_params.merge(params)
1478
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1606
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1479
1607
  end
1480
1608
  end
1481
1609
 
1482
1610
  class FXPopup
1483
1611
  alias old_initialize initialize
1484
- def initialize(owner, params={})
1485
- default_params = { :opts => POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :w => 0, :h => 0 }
1612
+ def initialize(owner, *args)
1613
+ argument_names = %w{opts x y width height}
1614
+ default_params = { :opts => POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0 }
1615
+ params = {}
1616
+ params = args.pop if args.last.is_a? Hash
1617
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1486
1618
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1487
1619
  params = default_params.merge(params)
1488
- old_initialize(owner, params[:opts], params[:x], params[:y], params[:w], params[:h])
1620
+ old_initialize(owner, params[:opts], params[:x], params[:y], params[:width], params[:height])
1489
1621
  end
1490
1622
  end
1491
1623
 
1492
1624
  class FXPPMIcon
1493
1625
  alias old_initialize initialize
1494
- def initialize(a, params={})
1495
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1626
+ def initialize(a, *args)
1627
+ argument_names = %w{pix clr opts width height}
1628
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1629
+ params = {}
1630
+ params = args.pop if args.last.is_a? Hash
1631
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1496
1632
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1497
1633
  params = default_params.merge(params)
1498
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1634
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1499
1635
  end
1500
1636
  end
1501
1637
 
1502
1638
  class FXPPMImage
1503
1639
  alias old_initialize initialize
1504
- def initialize(a, params={})
1505
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
1640
+ def initialize(a, *args)
1641
+ argument_names = %w{pix opts width height}
1642
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1643
+ params = {}
1644
+ params = args.pop if args.last.is_a? Hash
1645
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1506
1646
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1507
1647
  params = default_params.merge(params)
1508
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1648
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1509
1649
  end
1510
1650
  end
1511
1651
 
1512
1652
  class FXPrintDialog
1513
1653
  alias old_initialize initialize
1514
- def initialize(owner, name, params={})
1515
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1654
+ def initialize(owner, name, *args)
1655
+ argument_names = %w{opts x y width height}
1656
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1657
+ params = {}
1658
+ params = args.pop if args.last.is_a? Hash
1659
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1516
1660
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1517
1661
  params = default_params.merge(params)
1518
- old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:w], params[:h])
1662
+ old_initialize(owner, name, params[:opts], params[:x], params[:y], params[:width], params[:height])
1519
1663
  end
1520
1664
  end
1521
1665
 
1522
1666
  class FXProgressBar
1523
1667
  alias old_initialize initialize
1524
- def initialize(p, params={})
1525
- default_params = { :tgt => nil, :sel => 0, :opts => PROGRESSBAR_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1668
+ def initialize(p, *args)
1669
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1670
+ 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
+ params = {}
1672
+ params = args.pop if args.last.is_a? Hash
1673
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1526
1674
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1527
1675
  params = default_params.merge(params)
1528
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1529
1677
  end
1530
1678
  end
1531
1679
 
1532
1680
  class FXProgressDialog
1533
1681
  alias old_initialize initialize
1534
- def initialize(owner, caption, label, params={})
1535
- default_params = { :opts => PROGRESSDIALOG_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
1682
+ def initialize(owner, caption, label, *args)
1683
+ argument_names = %w{opts x y width height}
1684
+ default_params = { :opts => PROGRESSDIALOG_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1685
+ params = {}
1686
+ params = args.pop if args.last.is_a? Hash
1687
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1536
1688
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1537
1689
  params = default_params.merge(params)
1538
- old_initialize(owner, caption, label, params[:opts], params[:x], params[:y], params[:w], params[:h])
1690
+ old_initialize(owner, caption, label, params[:opts], params[:x], params[:y], params[:width], params[:height])
1539
1691
  end
1540
1692
  end
1541
1693
 
1542
1694
  class FXRadioButton
1543
1695
  alias old_initialize initialize
1544
- def initialize(parent, text, params={})
1696
+ def initialize(parent, text, *args)
1697
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1545
1698
  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
+ params = {}
1700
+ params = args.pop if args.last.is_a? Hash
1701
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1546
1702
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1547
1703
  params = default_params.merge(params)
1548
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])
@@ -1551,28 +1707,40 @@ module Fox
1551
1707
 
1552
1708
  class FXRealSlider
1553
1709
  alias old_initialize initialize
1554
- def initialize(p, params={})
1555
- default_params = { :tgt => nil, :sel => 0, :opts => REALSLIDER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
1710
+ def initialize(p, *args)
1711
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1712
+ 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
+ params = {}
1714
+ params = args.pop if args.last.is_a? Hash
1715
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1556
1716
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1557
1717
  params = default_params.merge(params)
1558
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1559
1719
  end
1560
1720
  end
1561
1721
 
1562
1722
  class FXRealSpinner
1563
1723
  alias old_initialize initialize
1564
- def initialize(p, cols, params={})
1565
- default_params = { :tgt => nil, :sel => 0, :opts => REALSPIN_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1724
+ def initialize(p, cols, *args)
1725
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1726
+ 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
+ params = {}
1728
+ params = args.pop if args.last.is_a? Hash
1729
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1566
1730
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1567
1731
  params = default_params.merge(params)
1568
- old_initialize(p, cols, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1569
1733
  end
1570
1734
  end
1571
1735
 
1572
1736
  class FXRegistry
1573
1737
  alias old_initialize initialize
1574
- def initialize(params={})
1738
+ def initialize(*args)
1739
+ argument_names = %w{appKey vendorKey}
1575
1740
  default_params = { :appKey => "", :vendorKey => "" }
1741
+ params = {}
1742
+ params = args.pop if args.last.is_a? Hash
1743
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1576
1744
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1577
1745
  params = default_params.merge(params)
1578
1746
  old_initialize(params[:appKey], params[:vendorKey])
@@ -1581,108 +1749,96 @@ module Fox
1581
1749
 
1582
1750
  class FXReplaceDialog
1583
1751
  alias old_initialize initialize
1584
- def initialize(owner, caption, params={})
1585
- default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1752
+ def initialize(owner, caption, *args)
1753
+ argument_names = %w{ic opts x y width height}
1754
+ default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1755
+ params = {}
1756
+ params = args.pop if args.last.is_a? Hash
1757
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1586
1758
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1587
1759
  params = default_params.merge(params)
1588
- old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:w], params[:h])
1760
+ old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:width], params[:height])
1589
1761
  end
1590
1762
  end
1591
1763
 
1592
1764
  class FXRGBIcon
1593
1765
  alias old_initialize initialize
1594
- def initialize(a, params={})
1595
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
1766
+ def initialize(a, *args)
1767
+ argument_names = %w{pix clr opts width height}
1768
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
1769
+ params = {}
1770
+ params = args.pop if args.last.is_a? Hash
1771
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1596
1772
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1597
1773
  params = default_params.merge(params)
1598
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
1774
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
1599
1775
  end
1600
1776
  end
1601
1777
 
1602
1778
  class FXRGBImage
1603
1779
  alias old_initialize initialize
1604
- def initialize(a, params={})
1605
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
1606
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1607
- params = default_params.merge(params)
1608
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
1609
- end
1610
- end
1611
-
1612
- class FXRootWindow
1613
- alias old_initialize initialize
1614
- def initialize(a, vis, params={})
1615
- default_params = { }
1780
+ def initialize(a, *args)
1781
+ argument_names = %w{pix opts width height}
1782
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
1783
+ params = {}
1784
+ params = args.pop if args.last.is_a? Hash
1785
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1616
1786
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1617
1787
  params = default_params.merge(params)
1618
- old_initialize(a, vis)
1788
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
1619
1789
  end
1620
1790
  end
1621
1791
 
1622
1792
  class FXRuler
1623
1793
  alias old_initialize initialize
1624
- def initialize(p, params={})
1625
- default_params = { :tgt => nil, :sel => 0, :opts => RULER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1794
+ def initialize(p, *args)
1795
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1796
+ 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
+ params = {}
1798
+ params = args.pop if args.last.is_a? Hash
1799
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1626
1800
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1627
1801
  params = default_params.merge(params)
1628
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1629
1803
  end
1630
1804
  end
1631
1805
 
1632
1806
  class FXRulerView
1633
1807
  alias old_initialize initialize
1634
- def initialize(p, params={})
1635
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1636
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1637
- params = default_params.merge(params)
1638
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1639
- end
1640
- end
1641
-
1642
- class NotifyHeader
1643
- alias old_initialize initialize
1644
- def initialize(params={})
1645
- default_params = { }
1646
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1647
- params = default_params.merge(params)
1648
- old_initialize()
1649
- end
1650
- end
1651
-
1652
- class SCNotification
1653
- alias old_initialize initialize
1654
- def initialize(params={})
1655
- default_params = { }
1656
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1657
- params = default_params.merge(params)
1658
- old_initialize()
1659
- end
1660
- end
1661
-
1662
- class TextRange
1663
- alias old_initialize initialize
1664
- def initialize(start, last, size, params={})
1665
- default_params = { }
1808
+ def initialize(p, *args)
1809
+ argument_names = %w{target selector opts x y width height}
1810
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1811
+ params = {}
1812
+ params = args.pop if args.last.is_a? Hash
1813
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1666
1814
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1667
1815
  params = default_params.merge(params)
1668
- old_initialize(start, last, size)
1816
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1669
1817
  end
1670
1818
  end
1671
1819
 
1672
1820
  class FXScintilla
1673
1821
  alias old_initialize initialize
1674
- def initialize(p, params={})
1675
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1822
+ def initialize(p, *args)
1823
+ argument_names = %w{target selector opts x y width height}
1824
+ default_params = { :target => nil, :selector => 0, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1825
+ params = {}
1826
+ params = args.pop if args.last.is_a? Hash
1827
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1676
1828
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1677
1829
  params = default_params.merge(params)
1678
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1830
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1679
1831
  end
1680
1832
  end
1681
1833
 
1682
1834
  class FXScrollArea
1683
1835
  alias old_initialize initialize
1684
- def initialize(parent, params={})
1836
+ def initialize(parent, *args)
1837
+ argument_names = %w{opts x y width height}
1685
1838
  default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1839
+ params = {}
1840
+ params = args.pop if args.last.is_a? Hash
1841
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1686
1842
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1687
1843
  params = default_params.merge(params)
1688
1844
  old_initialize(parent, params[:opts], params[:x], params[:y], params[:width], params[:height])
@@ -1691,28 +1847,26 @@ module Fox
1691
1847
 
1692
1848
  class FXScrollBar
1693
1849
  alias old_initialize initialize
1694
- def initialize(p, params={})
1695
- default_params = { :tgt => nil, :sel => 0, :opts => SCROLLBAR_VERTICAL, :x => 0, :y => 0, :w => 0, :h => 0 }
1696
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1697
- params = default_params.merge(params)
1698
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
1699
- end
1700
- end
1701
-
1702
- class FXScrollCorner
1703
- alias old_initialize initialize
1704
- def initialize(p, params={})
1705
- default_params = { }
1850
+ def initialize(p, *args)
1851
+ argument_names = %w{target selector opts x y width height}
1852
+ default_params = { :target => nil, :selector => 0, :opts => SCROLLBAR_VERTICAL, :x => 0, :y => 0, :width => 0, :height => 0 }
1853
+ params = {}
1854
+ params = args.pop if args.last.is_a? Hash
1855
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1706
1856
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1707
1857
  params = default_params.merge(params)
1708
- old_initialize(p)
1858
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
1709
1859
  end
1710
1860
  end
1711
1861
 
1712
1862
  class FXScrollPane
1713
1863
  alias old_initialize initialize
1714
- def initialize(owner, nvis, params={})
1864
+ def initialize(owner, nvis, *args)
1865
+ argument_names = %w{opts}
1715
1866
  default_params = { :opts => 0 }
1867
+ params = {}
1868
+ params = args.pop if args.last.is_a? Hash
1869
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1716
1870
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1717
1871
  params = default_params.merge(params)
1718
1872
  old_initialize(owner, nvis, params[:opts])
@@ -1721,118 +1875,138 @@ module Fox
1721
1875
 
1722
1876
  class FXScrollWindow
1723
1877
  alias old_initialize initialize
1724
- def initialize(p, params={})
1725
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1878
+ def initialize(p, *args)
1879
+ argument_names = %w{opts x y width height}
1880
+ default_params = { :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1881
+ params = {}
1882
+ params = args.pop if args.last.is_a? Hash
1883
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1726
1884
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1727
1885
  params = default_params.merge(params)
1728
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h])
1886
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height])
1729
1887
  end
1730
1888
  end
1731
1889
 
1732
1890
  class FXSearchDialog
1733
1891
  alias old_initialize initialize
1734
- def initialize(owner, caption, params={})
1735
- default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0 }
1892
+ def initialize(owner, caption, *args)
1893
+ argument_names = %w{ic opts x y width height}
1894
+ default_params = { :ic => nil, :opts => 0, :x => 0, :y => 0, :width => 0, :height => 0 }
1895
+ params = {}
1896
+ params = args.pop if args.last.is_a? Hash
1897
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1736
1898
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1737
1899
  params = default_params.merge(params)
1738
- old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:w], params[:h])
1900
+ old_initialize(owner, caption, params[:ic], params[:opts], params[:x], params[:y], params[:width], params[:height])
1739
1901
  end
1740
1902
  end
1741
1903
 
1742
1904
  class FXSeparator
1743
1905
  alias old_initialize initialize
1744
- def initialize(p, params={})
1745
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_X, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
1906
+ def initialize(p, *args)
1907
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
1908
+ 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
+ params = {}
1910
+ params = args.pop if args.last.is_a? Hash
1911
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1746
1912
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1747
1913
  params = default_params.merge(params)
1748
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1914
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1749
1915
  end
1750
1916
  end
1751
1917
 
1752
1918
  class FXHorizontalSeparator
1753
1919
  alias old_initialize initialize
1754
- def initialize(p, params={})
1755
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_X, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 1, :pr => 1, :pt => 0, :pb => 0 }
1920
+ def initialize(p, *args)
1921
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
1922
+ 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
+ params = {}
1924
+ params = args.pop if args.last.is_a? Hash
1925
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1756
1926
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1757
1927
  params = default_params.merge(params)
1758
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1928
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1759
1929
  end
1760
1930
  end
1761
1931
 
1762
1932
  class FXVerticalSeparator
1763
1933
  alias old_initialize initialize
1764
- def initialize(p, params={})
1765
- default_params = { :opts => SEPARATOR_GROOVE|LAYOUT_FILL_Y, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 1, :pb => 1 }
1766
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1767
- params = default_params.merge(params)
1768
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1769
- end
1770
- end
1771
-
1772
- class FXSettings
1773
- alias old_initialize initialize
1774
- def initialize(params={})
1775
- default_params = { }
1776
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1777
- params = default_params.merge(params)
1778
- old_initialize()
1779
- end
1780
- end
1781
-
1782
- class FXShell
1783
- alias old_initialize initialize
1784
- def initialize(params={})
1785
- default_params = { }
1934
+ def initialize(p, *args)
1935
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
1936
+ 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
+ params = {}
1938
+ params = args.pop if args.last.is_a? Hash
1939
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1786
1940
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1787
1941
  params = default_params.merge(params)
1788
- old_initialize()
1942
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1789
1943
  end
1790
1944
  end
1791
1945
 
1792
1946
  class FXShutterItem
1793
1947
  alias old_initialize initialize
1794
- def initialize(p, params={})
1795
- default_params = { :text => "", :icon => nil, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
1948
+ def initialize(p, *args)
1949
+ argument_names = %w{text icon opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1950
+ 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
+ params = {}
1952
+ params = args.pop if args.last.is_a? Hash
1953
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1796
1954
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1797
1955
  params = default_params.merge(params)
1798
- old_initialize(p, params[:text], params[:icon], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
1799
1957
  end
1800
1958
  end
1801
1959
 
1802
1960
  class FXShutter
1803
1961
  alias old_initialize initialize
1804
- def initialize(p, params={})
1805
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
1962
+ def initialize(p, *args)
1963
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
1964
+ 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
+ params = {}
1966
+ params = args.pop if args.last.is_a? Hash
1967
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1806
1968
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1807
1969
  params = default_params.merge(params)
1808
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
1809
1971
  end
1810
1972
  end
1811
1973
 
1812
1974
  class FXSlider
1813
1975
  alias old_initialize initialize
1814
- def initialize(p, params={})
1815
- default_params = { :tgt => nil, :sel => 0, :opts => SLIDER_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 0, :pr => 0, :pt => 0, :pb => 0 }
1976
+ def initialize(p, *args)
1977
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1978
+ 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
+ params = {}
1980
+ params = args.pop if args.last.is_a? Hash
1981
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1816
1982
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1817
1983
  params = default_params.merge(params)
1818
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1819
1985
  end
1820
1986
  end
1821
1987
 
1822
1988
  class FXSpinner
1823
1989
  alias old_initialize initialize
1824
- def initialize(p, cols, params={})
1825
- default_params = { :tgt => nil, :sel => 0, :opts => SPIN_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
1990
+ def initialize(p, cols, *args)
1991
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
1992
+ 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
+ params = {}
1994
+ params = args.pop if args.last.is_a? Hash
1995
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1826
1996
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1827
1997
  params = default_params.merge(params)
1828
- old_initialize(p, cols, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1829
1999
  end
1830
2000
  end
1831
2001
 
1832
2002
  class FXSplashWindow
1833
2003
  alias old_initialize initialize
1834
- def initialize(owner, icon, params={})
2004
+ def initialize(owner, icon, *args)
2005
+ argument_names = %w{opts ms}
1835
2006
  default_params = { :opts => SPLASH_SIMPLE, :ms => 5000 }
2007
+ params = {}
2008
+ params = args.pop if args.last.is_a? Hash
2009
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1836
2010
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1837
2011
  params = default_params.merge(params)
1838
2012
  old_initialize(owner, icon, params[:opts], params[:ms])
@@ -1841,118 +2015,124 @@ module Fox
1841
2015
 
1842
2016
  class FXSpring
1843
2017
  alias old_initialize initialize
1844
- def initialize(p, params={})
1845
- default_params = { :opts => 0, :relw => 0, :relh => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
2018
+ def initialize(p, *args)
2019
+ argument_names = %w{opts relw relh x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2020
+ 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
+ params = {}
2022
+ params = args.pop if args.last.is_a? Hash
2023
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1846
2024
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1847
2025
  params = default_params.merge(params)
1848
- old_initialize(p, params[:opts], params[:relw], params[:relh], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
1849
2027
  end
1850
2028
  end
1851
2029
 
1852
2030
  class FXStatusBar
1853
2031
  alias old_initialize initialize
1854
- def initialize(p, params={})
1855
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 3, :pr => 3, :pt => 2, :pb => 2, :hs => 4, :vs => 0 }
2032
+ def initialize(p, *args)
2033
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2034
+ 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
+ params = {}
2036
+ params = args.pop if args.last.is_a? Hash
2037
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1856
2038
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1857
2039
  params = default_params.merge(params)
1858
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
1859
2041
  end
1860
2042
  end
1861
2043
 
1862
2044
  class FXStatusLine
1863
2045
  alias old_initialize initialize
1864
- def initialize(p, params={})
1865
- default_params = { :tgt => nil, :sel => 0 }
2046
+ def initialize(p, *args)
2047
+ argument_names = %w{target selector}
2048
+ default_params = { :target => nil, :selector => 0 }
2049
+ params = {}
2050
+ params = args.pop if args.last.is_a? Hash
2051
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1866
2052
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1867
2053
  params = default_params.merge(params)
1868
- old_initialize(p, params[:tgt], params[:sel])
2054
+ old_initialize(p, params[:target], params[:selector])
1869
2055
  end
1870
2056
  end
1871
2057
 
1872
2058
  class FXStream
1873
2059
  alias old_initialize initialize
1874
- def initialize(params={})
2060
+ def initialize(*args)
2061
+ argument_names = %w{cont}
1875
2062
  default_params = { :cont => nil }
2063
+ params = {}
2064
+ params = args.pop if args.last.is_a? Hash
2065
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1876
2066
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1877
2067
  params = default_params.merge(params)
1878
2068
  old_initialize(params[:cont])
1879
2069
  end
1880
2070
  end
1881
2071
 
1882
- class FXStringDict
1883
- alias old_initialize initialize
1884
- def initialize(params={})
1885
- default_params = { }
1886
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1887
- params = default_params.merge(params)
1888
- old_initialize()
1889
- end
1890
- end
1891
-
1892
2072
  class FXSwitcher
1893
2073
  alias old_initialize initialize
1894
- def initialize(p, params={})
1895
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING }
2074
+ def initialize(p, *args)
2075
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom}
2076
+ 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
+ params = {}
2078
+ params = args.pop if args.last.is_a? Hash
2079
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1896
2080
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1897
2081
  params = default_params.merge(params)
1898
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
2082
+ old_initialize(p, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:padLeft], params[:padRight], params[:padTop], params[:padBottom])
1899
2083
  end
1900
2084
  end
1901
2085
 
1902
2086
  class FXTabBar
1903
2087
  alias old_initialize initialize
1904
- def initialize(p, params={})
1905
- default_params = { :tgt => nil, :sel => 0, :opts => TABBOOK_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING }
2088
+ def initialize(p, *args)
2089
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2090
+ 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
+ params = {}
2092
+ params = args.pop if args.last.is_a? Hash
2093
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1906
2094
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1907
2095
  params = default_params.merge(params)
1908
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1909
2097
  end
1910
2098
  end
1911
2099
 
1912
2100
  class FXTabBook
1913
2101
  alias old_initialize initialize
1914
- def initialize(p, params={})
1915
- default_params = { :tgt => nil, :sel => 0, :opts => TABBOOK_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING }
2102
+ def initialize(p, *args)
2103
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2104
+ 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
+ params = {}
2106
+ params = args.pop if args.last.is_a? Hash
2107
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1916
2108
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1917
2109
  params = default_params.merge(params)
1918
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1919
2111
  end
1920
2112
  end
1921
2113
 
1922
2114
  class FXTabItem
1923
2115
  alias old_initialize initialize
1924
- def initialize(p, text, params={})
1925
- default_params = { :ic => nil, :opts => TAB_TOP_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
2116
+ def initialize(p, text, *args)
2117
+ argument_names = %w{ic opts x y width height padLeft padRight padTop padBottom}
2118
+ 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
+ params = {}
2120
+ params = args.pop if args.last.is_a? Hash
2121
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1926
2122
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1927
2123
  params = default_params.merge(params)
1928
- old_initialize(p, text, params[:ic], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1929
- end
1930
- end
1931
-
1932
- class FXTablePos
1933
- alias old_initialize initialize
1934
- def initialize(params={})
1935
- default_params = { }
1936
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1937
- params = default_params.merge(params)
1938
- old_initialize()
1939
- end
1940
- end
1941
-
1942
- class FXTableRange
1943
- alias old_initialize initialize
1944
- def initialize(params={})
1945
- default_params = { }
1946
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1947
- params = default_params.merge(params)
1948
- old_initialize()
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])
1949
2125
  end
1950
2126
  end
1951
2127
 
1952
2128
  class FXTableItem
1953
2129
  alias old_initialize initialize
1954
- def initialize(text, params={})
2130
+ def initialize(text, *args)
2131
+ argument_names = %w{icon data}
1955
2132
  default_params = { :icon => nil, :data => nil }
2133
+ params = {}
2134
+ params = args.pop if args.last.is_a? Hash
2135
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1956
2136
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1957
2137
  params = default_params.merge(params)
1958
2138
  old_initialize(text, params[:icon], params[:data])
@@ -1961,168 +2141,180 @@ module Fox
1961
2141
 
1962
2142
  class FXTable
1963
2143
  alias old_initialize initialize
1964
- def initialize(p, params={})
1965
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_MARGIN, :pr => DEFAULT_MARGIN, :pt => DEFAULT_MARGIN, :pb => DEFAULT_MARGIN }
1966
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1967
- params = default_params.merge(params)
1968
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
1969
- end
1970
- end
1971
-
1972
- class FXHiliteStyle
1973
- alias old_initialize initialize
1974
- def initialize(params={})
1975
- default_params = { }
1976
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1977
- params = default_params.merge(params)
1978
- old_initialize()
1979
- end
1980
- end
1981
-
1982
- class FXTextChange
1983
- alias old_initialize initialize
1984
- def initialize(params={})
1985
- default_params = { }
2144
+ def initialize(p, *args)
2145
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2146
+ 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
+ params = {}
2148
+ params = args.pop if args.last.is_a? Hash
2149
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
1986
2150
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
1987
2151
  params = default_params.merge(params)
1988
- old_initialize()
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])
1989
2153
  end
1990
2154
  end
1991
2155
 
1992
2156
  class FXText
1993
2157
  alias old_initialize initialize
1994
- def initialize(p, params={})
1995
- default_params = { :tgt => nil, :sel => 0, :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 3, :pr => 3, :pt => 2, :pb => 2 }
2158
+ def initialize(p, *args)
2159
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2160
+ 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
+ params = {}
2162
+ params = args.pop if args.last.is_a? Hash
2163
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
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, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
1999
2167
  end
2000
2168
  end
2001
2169
 
2002
2170
  class FXTextField
2003
2171
  alias old_initialize initialize
2004
- def initialize(p, ncols, params={})
2005
- default_params = { :tgt => nil, :sel => 0, :opts => TEXTFIELD_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
2172
+ def initialize(p, ncols, *args)
2173
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2174
+ 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
+ params = {}
2176
+ params = args.pop if args.last.is_a? Hash
2177
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2006
2178
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2007
2179
  params = default_params.merge(params)
2008
- old_initialize(p, ncols, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
2009
2181
  end
2010
2182
  end
2011
2183
 
2012
2184
  class FXTGAIcon
2013
2185
  alias old_initialize initialize
2014
- def initialize(a, params={})
2015
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
2186
+ def initialize(a, *args)
2187
+ argument_names = %w{pix clr opts width height}
2188
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2189
+ params = {}
2190
+ params = args.pop if args.last.is_a? Hash
2191
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2016
2192
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2017
2193
  params = default_params.merge(params)
2018
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
2194
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
2019
2195
  end
2020
2196
  end
2021
2197
 
2022
2198
  class FXTGAImage
2023
2199
  alias old_initialize initialize
2024
- def initialize(a, params={})
2025
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
2200
+ def initialize(a, *args)
2201
+ argument_names = %w{pix opts width height}
2202
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2203
+ params = {}
2204
+ params = args.pop if args.last.is_a? Hash
2205
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2026
2206
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2027
2207
  params = default_params.merge(params)
2028
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
2208
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
2029
2209
  end
2030
2210
  end
2031
2211
 
2032
2212
  class FXTIFIcon
2033
2213
  alias old_initialize initialize
2034
- def initialize(a, params={})
2035
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
2214
+ def initialize(a, *args)
2215
+ argument_names = %w{pix clr opts width height}
2216
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2217
+ params = {}
2218
+ params = args.pop if args.last.is_a? Hash
2219
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2036
2220
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2037
2221
  params = default_params.merge(params)
2038
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
2222
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
2039
2223
  end
2040
2224
  end
2041
2225
 
2042
2226
  class FXTIFImage
2043
2227
  alias old_initialize initialize
2044
- def initialize(a, params={})
2045
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
2228
+ def initialize(a, *args)
2229
+ argument_names = %w{pix opts width height}
2230
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2231
+ params = {}
2232
+ params = args.pop if args.last.is_a? Hash
2233
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2046
2234
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2047
2235
  params = default_params.merge(params)
2048
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
2236
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
2049
2237
  end
2050
2238
  end
2051
2239
 
2052
2240
  class FXToggleButton
2053
2241
  alias old_initialize initialize
2054
- def initialize(p, text1, text2, params={})
2055
- default_params = { :icon1 => nil, :icon2 => nil, :tgt => nil, :sel => 0, :opts => TOGGLEBUTTON_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
2242
+ def initialize(p, text1, text2, *args)
2243
+ argument_names = %w{icon1 icon2 target selector opts x y width height padLeft padRight padTop padBottom}
2244
+ 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
+ params = {}
2246
+ params = args.pop if args.last.is_a? Hash
2247
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2056
2248
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2057
2249
  params = default_params.merge(params)
2058
- old_initialize(p, text1, text2, params[:icon1], params[:icon2], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
2059
2251
  end
2060
2252
  end
2061
2253
 
2062
2254
  class FXToolBarGrip
2063
2255
  alias old_initialize initialize
2064
- def initialize(p, params={})
2065
- default_params = { :tgt => nil, :sel => 0, :opts => TOOLBARGRIP_SINGLE, :x => 0, :y => 0, :w => 0, :h => 0 }
2256
+ def initialize(p, *args)
2257
+ argument_names = %w{target selector opts x y width height}
2258
+ default_params = { :target => nil, :selector => 0, :opts => TOOLBARGRIP_SINGLE, :x => 0, :y => 0, :width => 0, :height => 0 }
2259
+ params = {}
2260
+ params = args.pop if args.last.is_a? Hash
2261
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2066
2262
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2067
2263
  params = default_params.merge(params)
2068
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
2264
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
2069
2265
  end
2070
2266
  end
2071
2267
 
2072
2268
  class FXToolBarShell
2073
2269
  alias old_initialize initialize
2074
- def initialize(owner, params={})
2075
- default_params = { :opts => FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :w => 0, :h => 0, :hs => 4, :vs => 4 }
2270
+ def initialize(owner, *args)
2271
+ argument_names = %w{opts x y width height hSpacing vSpacing}
2272
+ default_params = { :opts => FRAME_RAISED|FRAME_THICK, :x => 0, :y => 0, :width => 0, :height => 0, :hSpacing => 4, :vSpacing => 4 }
2273
+ params = {}
2274
+ params = args.pop if args.last.is_a? Hash
2275
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2076
2276
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2077
2277
  params = default_params.merge(params)
2078
- old_initialize(owner, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:hs], params[:vs])
2278
+ old_initialize(owner, params[:opts], params[:x], params[:y], params[:width], params[:height], params[:hSpacing], params[:vSpacing])
2079
2279
  end
2080
2280
  end
2081
2281
 
2082
2282
  class FXToolBarTab
2083
2283
  alias old_initialize initialize
2084
- def initialize(p, params={})
2085
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :w => 0, :h => 0 }
2284
+ def initialize(p, *args)
2285
+ argument_names = %w{target selector opts x y width height}
2286
+ default_params = { :target => nil, :selector => 0, :opts => FRAME_RAISED, :x => 0, :y => 0, :width => 0, :height => 0 }
2287
+ params = {}
2288
+ params = args.pop if args.last.is_a? Hash
2289
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2086
2290
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2087
2291
  params = default_params.merge(params)
2088
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
2292
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
2089
2293
  end
2090
2294
  end
2091
2295
 
2092
2296
  class FXToolTip
2093
2297
  alias old_initialize initialize
2094
- def initialize(app, params={})
2095
- default_params = { :opts => TOOLTIP_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
2096
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2097
- params = default_params.merge(params)
2098
- old_initialize(app, params[:opts], params[:x], params[:y], params[:w], params[:h])
2099
- end
2100
- end
2101
-
2102
- class FXTopWindow
2103
- alias old_initialize initialize
2104
- def initialize(params={})
2105
- default_params = { }
2298
+ def initialize(app, *args)
2299
+ argument_names = %w{opts x y width height}
2300
+ default_params = { :opts => TOOLTIP_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
2301
+ params = {}
2302
+ params = args.pop if args.last.is_a? Hash
2303
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2106
2304
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2107
2305
  params = default_params.merge(params)
2108
- old_initialize()
2109
- end
2110
- end
2111
-
2112
- class FXTranslator
2113
- alias old_initialize initialize
2114
- def initialize(a, params={})
2115
- default_params = { }
2116
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2117
- params = default_params.merge(params)
2118
- old_initialize(a)
2306
+ old_initialize(app, params[:opts], params[:x], params[:y], params[:width], params[:height])
2119
2307
  end
2120
2308
  end
2121
2309
 
2122
2310
  class FXTreeItem
2123
2311
  alias old_initialize initialize
2124
- def initialize(text, params={})
2312
+ def initialize(text, *args)
2313
+ argument_names = %w{openIcon closedIcon data}
2125
2314
  default_params = { :openIcon => nil, :closedIcon => nil, :data => nil }
2315
+ params = {}
2316
+ params = args.pop if args.last.is_a? Hash
2317
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2126
2318
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2127
2319
  params = default_params.merge(params)
2128
2320
  old_initialize(text, params[:openIcon], params[:closedIcon], params[:data])
@@ -2131,78 +2323,54 @@ module Fox
2131
2323
 
2132
2324
  class FXTreeList
2133
2325
  alias old_initialize initialize
2134
- def initialize(p, params={})
2135
- default_params = { :tgt => nil, :sel => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0 }
2326
+ def initialize(p, *args)
2327
+ argument_names = %w{target selector opts x y width height}
2328
+ default_params = { :target => nil, :selector => 0, :opts => TREELIST_NORMAL, :x => 0, :y => 0, :width => 0, :height => 0 }
2329
+ params = {}
2330
+ params = args.pop if args.last.is_a? Hash
2331
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2136
2332
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2137
2333
  params = default_params.merge(params)
2138
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h])
2334
+ old_initialize(p, params[:target], params[:selector], params[:opts], params[:x], params[:y], params[:width], params[:height])
2139
2335
  end
2140
2336
  end
2141
2337
 
2142
2338
  class FXTreeListBox
2143
2339
  alias old_initialize initialize
2144
- def initialize(p, params={})
2145
- default_params = { :tgt => nil, :sel => 0, :opts => FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
2340
+ def initialize(p, *args)
2341
+ argument_names = %w{target selector opts x y width height padLeft padRight padTop padBottom}
2342
+ 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
+ params = {}
2344
+ params = args.pop if args.last.is_a? Hash
2345
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2146
2346
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2147
2347
  params = default_params.merge(params)
2148
- old_initialize(p, params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
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])
2149
2349
  end
2150
2350
  end
2151
2351
 
2152
2352
  class FXTriStateButton
2153
2353
  alias old_initialize initialize
2154
- def initialize(p, text1, text2, text3, params={})
2155
- default_params = { :icon1 => nil, :icon2 => nil, :icon3 => nil, :tgt => nil, :sel => 0, :opts => TOGGLEBUTTON_NORMAL, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_PAD, :pr => DEFAULT_PAD, :pt => DEFAULT_PAD, :pb => DEFAULT_PAD }
2156
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2157
- params = default_params.merge(params)
2158
- old_initialize(p, text1, text2, text3, params[:icon1], params[:icon2], params[:icon3], params[:tgt], params[:sel], params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb])
2159
- end
2160
- end
2161
-
2162
- class FXVec2d
2163
- alias old_initialize initialize
2164
- def initialize(xx, yy, params={})
2165
- default_params = { }
2166
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2167
- params = default_params.merge(params)
2168
- old_initialize(xx, yy)
2169
- end
2170
- end
2171
-
2172
- class FXVec2f
2173
- alias old_initialize initialize
2174
- def initialize(xx, yy, params={})
2175
- default_params = { }
2176
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2177
- params = default_params.merge(params)
2178
- old_initialize(xx, yy)
2179
- end
2180
- end
2181
-
2182
- class FXVec3d
2183
- alias old_initialize initialize
2184
- def initialize(xx, yy, zz, params={})
2185
- default_params = { }
2186
- params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2187
- params = default_params.merge(params)
2188
- old_initialize(xx, yy, zz)
2189
- end
2190
- end
2191
-
2192
- class FXVec3f
2193
- alias old_initialize initialize
2194
- def initialize(xx, yy, zz, params={})
2195
- default_params = { }
2354
+ def initialize(p, text1, text2, text3, *args)
2355
+ argument_names = %w{icon1 icon2 icon3 target selector opts x y width height padLeft padRight padTop padBottom}
2356
+ 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
+ params = {}
2358
+ params = args.pop if args.last.is_a? Hash
2359
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2196
2360
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2197
2361
  params = default_params.merge(params)
2198
- old_initialize(xx, yy, zz)
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])
2199
2363
  end
2200
2364
  end
2201
2365
 
2202
2366
  class FXVec4d
2203
2367
  alias old_initialize initialize
2204
- def initialize(xx, yy, zz, params={})
2368
+ def initialize(xx, yy, zz, *args)
2369
+ argument_names = %w{ww}
2205
2370
  default_params = { :ww => 1.0 }
2371
+ params = {}
2372
+ params = args.pop if args.last.is_a? Hash
2373
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2206
2374
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2207
2375
  params = default_params.merge(params)
2208
2376
  old_initialize(xx, yy, zz, params[:ww])
@@ -2211,8 +2379,12 @@ module Fox
2211
2379
 
2212
2380
  class FXVec4f
2213
2381
  alias old_initialize initialize
2214
- def initialize(xx, yy, zz, params={})
2382
+ def initialize(xx, yy, zz, *args)
2383
+ argument_names = %w{ww}
2215
2384
  default_params = { :ww => 1.0 }
2385
+ params = {}
2386
+ params = args.pop if args.last.is_a? Hash
2387
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2216
2388
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2217
2389
  params = default_params.merge(params)
2218
2390
  old_initialize(xx, yy, zz, params[:ww])
@@ -2221,18 +2393,26 @@ module Fox
2221
2393
 
2222
2394
  class FXVerticalFrame
2223
2395
  alias old_initialize initialize
2224
- def initialize(p, params={})
2225
- default_params = { :opts => 0, :x => 0, :y => 0, :w => 0, :h => 0, :pl => DEFAULT_SPACING, :pr => DEFAULT_SPACING, :pt => DEFAULT_SPACING, :pb => DEFAULT_SPACING, :hs => DEFAULT_SPACING, :vs => DEFAULT_SPACING }
2396
+ def initialize(p, *args)
2397
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2398
+ 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
+ params = {}
2400
+ params = args.pop if args.last.is_a? Hash
2401
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2226
2402
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2227
2403
  params = default_params.merge(params)
2228
- old_initialize(p, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
2229
2405
  end
2230
2406
  end
2231
2407
 
2232
2408
  class FXVisual
2233
2409
  alias old_initialize initialize
2234
- def initialize(a, flgs, params={})
2410
+ def initialize(a, flgs, *args)
2411
+ argument_names = %w{d}
2235
2412
  default_params = { :d => 32 }
2413
+ params = {}
2414
+ params = args.pop if args.last.is_a? Hash
2415
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2236
2416
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2237
2417
  params = default_params.merge(params)
2238
2418
  old_initialize(a, flgs, params[:d])
@@ -2241,51 +2421,71 @@ module Fox
2241
2421
 
2242
2422
  class FXWizard
2243
2423
  alias old_initialize initialize
2244
- def initialize(owner, name, image, params={})
2245
- default_params = { :opts => DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE, :x => 0, :y => 0, :w => 0, :h => 0, :pl => 10, :pr => 10, :pt => 10, :pb => 10, :hs => 10, :vs => 10 }
2424
+ def initialize(owner, name, image, *args)
2425
+ argument_names = %w{opts x y width height padLeft padRight padTop padBottom hSpacing vSpacing}
2426
+ 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
+ params = {}
2428
+ params = args.pop if args.last.is_a? Hash
2429
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2246
2430
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2247
2431
  params = default_params.merge(params)
2248
- old_initialize(owner, name, image, params[:opts], params[:x], params[:y], params[:w], params[:h], params[:pl], params[:pr], params[:pt], params[:pb], params[:hs], params[:vs])
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])
2249
2433
  end
2250
2434
  end
2251
2435
 
2252
2436
  class FXXBMIcon
2253
2437
  alias old_initialize initialize
2254
- def initialize(a, params={})
2255
- default_params = { :pixels => nil, :mask => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
2438
+ def initialize(a, *args)
2439
+ argument_names = %w{pixels mask clr opts width height}
2440
+ default_params = { :pixels => nil, :mask => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2441
+ params = {}
2442
+ params = args.pop if args.last.is_a? Hash
2443
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2256
2444
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2257
2445
  params = default_params.merge(params)
2258
- old_initialize(a, params[:pixels], params[:mask], params[:clr], params[:opts], params[:w], params[:h])
2446
+ old_initialize(a, params[:pixels], params[:mask], params[:clr], params[:opts], params[:width], params[:height])
2259
2447
  end
2260
2448
  end
2261
2449
 
2262
2450
  class FXXBMImage
2263
2451
  alias old_initialize initialize
2264
- def initialize(a, params={})
2265
- default_params = { :pixels => nil, :mask => nil, :opts => 0, :w => 1, :h => 1 }
2452
+ def initialize(a, *args)
2453
+ argument_names = %w{pixels mask opts width height}
2454
+ default_params = { :pixels => nil, :mask => nil, :opts => 0, :width => 1, :height => 1 }
2455
+ params = {}
2456
+ params = args.pop if args.last.is_a? Hash
2457
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2266
2458
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2267
2459
  params = default_params.merge(params)
2268
- old_initialize(a, params[:pixels], params[:mask], params[:opts], params[:w], params[:h])
2460
+ old_initialize(a, params[:pixels], params[:mask], params[:opts], params[:width], params[:height])
2269
2461
  end
2270
2462
  end
2271
2463
 
2272
2464
  class FXXPMIcon
2273
2465
  alias old_initialize initialize
2274
- def initialize(a, params={})
2275
- default_params = { :pix => nil, :clr => 0, :opts => 0, :w => 1, :h => 1 }
2466
+ def initialize(a, *args)
2467
+ argument_names = %w{pix clr opts width height}
2468
+ default_params = { :pix => nil, :clr => 0, :opts => 0, :width => 1, :height => 1 }
2469
+ params = {}
2470
+ params = args.pop if args.last.is_a? Hash
2471
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2276
2472
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2277
2473
  params = default_params.merge(params)
2278
- old_initialize(a, params[:pix], params[:clr], params[:opts], params[:w], params[:h])
2474
+ old_initialize(a, params[:pix], params[:clr], params[:opts], params[:width], params[:height])
2279
2475
  end
2280
2476
  end
2281
2477
 
2282
2478
  class FXXPMImage
2283
2479
  alias old_initialize initialize
2284
- def initialize(a, params={})
2285
- default_params = { :pix => nil, :opts => 0, :w => 1, :h => 1 }
2480
+ def initialize(a, *args)
2481
+ argument_names = %w{pix opts width height}
2482
+ default_params = { :pix => nil, :opts => 0, :width => 1, :height => 1 }
2483
+ params = {}
2484
+ params = args.pop if args.last.is_a? Hash
2485
+ args.each_with_index { |e, i| params[argument_names[i].intern] = e }
2286
2486
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
2287
2487
  params = default_params.merge(params)
2288
- old_initialize(a, params[:pix], params[:opts], params[:w], params[:h])
2488
+ old_initialize(a, params[:pix], params[:opts], params[:width], params[:height])
2289
2489
  end
2290
2490
  end
2291
2491