fxruby 1.6.13 → 1.6.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/doc/apes02.html +2 -2
  2. data/doc/apes03.html +1 -1
  3. data/doc/book.html +1 -1
  4. data/doc/build.html +16 -17
  5. data/doc/changes.html +40 -28
  6. data/doc/differences.html +9 -9
  7. data/doc/gems.html +6 -6
  8. data/doc/implementation.html +1 -1
  9. data/doc/infosources.html +3 -3
  10. data/doc/library.html +5 -5
  11. data/doc/opengl.html +5 -5
  12. data/doc/pt02.html +1 -1
  13. data/doc/scintilla.html +4 -4
  14. data/doc/subversion.html +1 -1
  15. data/examples/babelfish.rb +1 -1
  16. data/examples/custom_table_item.rb +170 -0
  17. data/examples/dilbert.rb +6 -7
  18. data/ext/fox16/FXRbApp.cpp +5 -1
  19. data/ext/fox16/FXRbDataTarget.cpp +2 -2
  20. data/ext/fox16/FXRuby.cpp +36 -14
  21. data/ext/fox16/core_wrap.cpp +13 -13
  22. data/ext/fox16/dc_wrap.cpp +7 -7
  23. data/ext/fox16/dialogs_wrap.cpp +16 -16
  24. data/ext/fox16/extconf.rb +31 -0
  25. data/ext/fox16/frames_wrap.cpp +59 -59
  26. data/ext/fox16/fx3d_wrap.cpp +1 -1
  27. data/ext/fox16/iconlist_wrap.cpp +10 -10
  28. data/ext/fox16/icons_wrap.cpp +25 -25
  29. data/ext/fox16/image_wrap.cpp +26 -26
  30. data/ext/fox16/include/FXRbApp.h +5 -3
  31. data/ext/fox16/include/FXRbDC.h +1 -1
  32. data/ext/fox16/label_wrap.cpp +6 -6
  33. data/ext/fox16/layout_wrap.cpp +1 -1
  34. data/ext/fox16/list_wrap.cpp +7 -7
  35. data/ext/fox16/mdi_wrap.cpp +5 -5
  36. data/ext/fox16/menu_wrap.cpp +6 -6
  37. data/ext/fox16/scintilla_wrap.cpp +3 -3
  38. data/ext/fox16/table_wrap.cpp +3 -3
  39. data/ext/fox16/text_wrap.cpp +8 -8
  40. data/ext/fox16/treelist_wrap.cpp +10 -9
  41. data/ext/fox16/ui_wrap.cpp +22 -22
  42. data/lib/fox16/kwargs.rb +11 -0
  43. data/lib/fox16/version.rb +1 -1
  44. data/rdoc-sources/FXImage.rb +12 -6
  45. data/rdoc-sources/FXToggleButton.rb +1 -0
  46. data/tests/output.ps +166 -0
  47. data/tests/stress1.rb +3 -5
  48. data/web/community.html +94 -0
  49. data/web/documentation.html +100 -0
  50. data/web/downloads.html +114 -93
  51. data/web/index.html +96 -0
  52. metadata +47 -52
  53. data/index.html +0 -14
  54. data/web/art/fxrubylogo.png +0 -0
  55. data/web/art/fxrubylogo_small.png +0 -0
  56. data/web/art/line.gif +0 -0
  57. data/web/art/oul_grey.gif +0 -0
  58. data/web/art/our.gif +0 -0
  59. data/web/home.html +0 -113
  60. data/web/menu.html +0 -50
  61. data/web/styles.css +0 -167
  62. data/web/top.html +0 -15
@@ -1,18 +1,18 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Appendix&nbsp;D.&nbsp;The FXRuby Standard Library</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><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="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"><link rel="next" href="implementation.html" title="Appendix&nbsp;E.&nbsp;Implementation"></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;D.&nbsp;The FXRuby Standard Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="differences.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="implementation.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="library"></a>Appendix&nbsp;D.&nbsp;The FXRuby Standard Library</h2></div></div></div><p>While the majority of FXRuby is in fact implemented by an extension module, some parts are provided instead by "pure Ruby" code. This section describes the classes and modules available in the FXRuby standard library.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5324"></a>Undoable Commands</h2></div></div></div><p>The <code class="filename">fox16/undolist.rb</code> file provides the <code class="classname">FXCommand</code> and <code class="classname">FXUndoList</code> classes. These serve the same purpose as the <code class="classname">FXCommand</code> and <code class="classname">FXUndoList</code> classes from the standard FOX distribution, but they're implemented entirely in Ruby.</p><p>For a complete description of these classes and how to use them, see the RD documentation in <code class="filename">fox16/undolist.rb</code>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5349"></a>Aliases</h2></div></div></div><p>The <code class="filename">fox16/aliases.rb</code> implements most of the accessor-style aliases for methods. This file is loaded automatically when you </p><pre class="programlisting">require 'fox16'</pre><p> and so you should never need to load it directly.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5360"></a>Color Names</h2></div></div></div><p>The <code class="filename">fox16/colors.rb</code> file, contributed by Jeff
3
+ <title>Appendix&nbsp;D.&nbsp;The FXRuby Standard Library</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><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="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"><link rel="next" href="implementation.html" title="Appendix&nbsp;E.&nbsp;Implementation"></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;D.&nbsp;The FXRuby Standard Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="differences.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="implementation.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="library"></a>Appendix&nbsp;D.&nbsp;The FXRuby Standard Library</h2></div></div></div><p>While the majority of FXRuby is in fact implemented by an extension module, some parts are provided instead by "pure Ruby" code. This section describes the classes and modules available in the FXRuby standard library.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5373"></a>Undoable Commands</h2></div></div></div><p>The <code class="filename">fox16/undolist.rb</code> file provides the <code class="classname">FXCommand</code> and <code class="classname">FXUndoList</code> classes. These serve the same purpose as the <code class="classname">FXCommand</code> and <code class="classname">FXUndoList</code> classes from the standard FOX distribution, but they're implemented entirely in Ruby.</p><p>For a complete description of these classes and how to use them, see the RD documentation in <code class="filename">fox16/undolist.rb</code>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5398"></a>Aliases</h2></div></div></div><p>The <code class="filename">fox16/aliases.rb</code> implements most of the accessor-style aliases for methods. This file is loaded automatically when you </p><pre class="programlisting">require 'fox16'</pre><p> and so you should never need to load it directly.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5409"></a>Color Names</h2></div></div></div><p>The <code class="filename">fox16/colors.rb</code> file, contributed by Jeff
4
4
  Heard, provides a bunch of predefined color values (based on the standard
5
5
  X11 color names). You can use these color constants anywhere that FOX
6
6
  expects an RGB color value, e.g.</p><pre class="programlisting">dc = FXDCWindow.new(drawable, ev)
7
7
  dc.foreground = FXColor::MistyRose # instead of FXRGB(255, 228, 225)
8
- dc.background = FXColor::MidnightBlue # instead of FXRGB( 25, 25, 112)</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5370"></a>OpenGL Shapes</h2></div></div></div><p>The <code class="filename">fox16/glshapes.rb</code> library provides Ruby
8
+ dc.background = FXColor::MidnightBlue # instead of FXRGB( 25, 25, 112)</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5419"></a>OpenGL Shapes</h2></div></div></div><p>The <code class="filename">fox16/glshapes.rb</code> library provides Ruby
9
9
  implementations of a number of basic 3-D shapes (all derived from the
10
10
  built-in <code class="classname">FXGLShape</code> class) that can be used with
11
11
  the <code class="classname">FXGLViewer</code>. Several of these shapes are used
12
12
  in the <code class="filename">glviewer.rb</code> example program. These shapes
13
13
  were originally implemented in C++ and wrapped using SWIG, but they are
14
14
  straightforward enough to implement in Ruby so they were moved out to
15
- this library instead.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5387"></a>Iterators</h2></div></div></div><p>The <code class="filename">fox16/iterators.rb</code> library just adds an
15
+ this library instead.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5436"></a>Iterators</h2></div></div></div><p>The <code class="filename">fox16/iterators.rb</code> library just adds an
16
16
  <code class="methodname">each</code> instance method for the <code class="classname">
17
17
  FXComboBox</code>, <code class="classname">FXGLGroup</code>, <code class="classname">
18
18
  FXHeader</code>, <code class="classname">FXIconList</code>, <code class="classname">
@@ -21,10 +21,10 @@ dc.background = FXColor::MidnightBlue # instead of FXRGB( 25, 25, 112)</pre><
21
21
  FXTreeList</code> and <code class="classname">FXTreeListBox</code> classes,
22
22
  so that you can iterate over their members in a Ruby-friendly way. It
23
23
  also mixes the <code class="classname">Enumerable</code> module into each of
24
- these classes.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5431"></a>Key Codes</h2></div></div></div><p>The <code class="filename">fox16/keys.rb</code> library file defines all of the
24
+ these classes.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5480"></a>Key Codes</h2></div></div></div><p>The <code class="filename">fox16/keys.rb</code> library file defines all of the
25
25
  key codes (e.g. <code class="constant">KEY_space</code>) that might show up in the
26
26
  code field of an <code class="classname">FXEvent</code> instance. This file is
27
27
  loaded automatically when you
28
28
  </p><pre class="programlisting">require 'fox16'</pre><p> and
29
29
  so you should never need to load it
30
- directly.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5448"></a>Calendar Widget</h2></div></div></div><p>The <code class="filename">fox16/calendar.rb</code> library file provides the <code class="classname">FXCalendar</code> widget, contributed by David Naseby.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="differences.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;<a accesskey="n" href="implementation.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby&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;E.&nbsp;Implementation</td></tr></table></div></body></html>
30
+ directly.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5497"></a>Calendar Widget</h2></div></div></div><p>The <code class="filename">fox16/calendar.rb</code> library file provides the <code class="classname">FXCalendar</code> widget, contributed by David Naseby.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="differences.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;<a accesskey="n" href="implementation.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby&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;E.&nbsp;Implementation</td></tr></table></div></body></html>
@@ -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="d0e4426"></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="d0e4475"></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 xmlns:xlink="http://www.w3.org/1999/xlink" 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="d0e4434"></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="d0e4483"></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 xmlns:xlink="http://www.w3.org/1999/xlink" 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="d0e4489"></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="d0e4538"></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="d0e4548"></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="d0e4597"></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="d0e4572"></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="d0e4621"></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
@@ -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 v5 XSL Stylesheets V1.72.0"><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;10.&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="d0e4411"></a>Part&nbsp;II.&nbsp;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#d0e5462">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#d0e5500">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;10.&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 v5 XSL Stylesheets V1.72.0"><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;10.&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="d0e4460"></a>Part&nbsp;II.&nbsp;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#d0e5511">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#d0e5549">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;10.&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>
@@ -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 v5 XSL Stylesheets V1.72.0"><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="d0e4599"></a>What is Scintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" 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 v5 XSL Stylesheets V1.72.0"><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="d0e4648"></a>What is Scintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" 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="d0e4606"></a>What is FXScintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" 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="d0e4655"></a>What is FXScintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" 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. Until recently it was developed by Gilles Filippini,
8
8
  and as of this writing the latest release is available for download from
9
- <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz" target="_top">http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4616"></a>Compiling FXScintilla</h2></div></div></div><p>The FXScintilla distribution contains everything you need to build
9
+ <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz" target="_top">http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4665"></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="d0e4629"></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="d0e4678"></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
@@ -14,7 +14,7 @@
14
14
  <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://svnbook.red-bean.com/" target="_top">book</a>.</p><p>You're also going to need to have a working <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.swig.org/" target="_top">SWIG</a> installation so that you can
15
15
  generate the C++ source files from the SWIG interface files. As of this
16
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="d0e5645"></a>Checking out the code</h2></div></div></div><p>To check out the development version (i.e. the trunk) for FXRuby,
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="d0e5694"></a>Checking out the code</h2></div></div></div><p>To check out the development version (i.e. the trunk) for FXRuby,
18
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
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
20
  directory and go through the normal build and installation process, as
@@ -46,7 +46,7 @@ class Babelfish < FXMainWindow
46
46
  TRANSLATIONS.keys.each do |key|
47
47
  @transModeCombo.appendItem(key, TRANSLATIONS[key])
48
48
  end
49
- btn = FXButton.new(controlsFrame, "Translate", :opts => BUTTON_NORMAL|LAYOUT_SIDE_RIGHT)
49
+ btn = FXButton.new(controlsFrame, "Translate", :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
50
50
  btn.connect(SEL_COMMAND) do
51
51
  transMode = @transModeCombo.getItemData(@transModeCombo.currentItem)
52
52
  getApp().beginWaitCursor() do
@@ -0,0 +1,170 @@
1
+ require 'fox16'
2
+
3
+ include Fox
4
+
5
+ class CustomTableItem < FXTableItem
6
+ def drawContent(table, dc, x, y, w, h)
7
+ puts "in drawContent()"
8
+ hg = table.horizontalGridShown?
9
+ vg = table.verticalGridShown?
10
+ ml = table.marginLeft + (vg ? 1 : 0)
11
+ mt = table.marginTop + (hg ? 1 : 0)
12
+ mr = table.marginRight
13
+ mb = table.marginBottom
14
+ font = dc.font
15
+ lbl = text
16
+ icn = icon
17
+
18
+ # Text width and height
19
+ beg, tw, th = 0, 0, 0
20
+ begin
21
+ _end = beg;
22
+ _end += 1 while _end < lbl.length && lbl[_end].chr != '\n'
23
+ t = font.getTextWidth(lbl[beg..._end])
24
+ tw = t if t > tw
25
+ th += font.fontHeight
26
+ beg = _end + 1
27
+ end while _end < lbl.length
28
+
29
+ # Icon size
30
+ iw, ih = 0, 0
31
+ unless icn.nil?
32
+ iw = icn.width
33
+ ih = icn.height
34
+ end
35
+
36
+ # Icon-text spacing
37
+ s = 0
38
+ s = 4 if (iw > 0 && tw > 0)
39
+
40
+ # Fix x coordinate
41
+ if justify & LEFT == 1
42
+ case iconPosition
43
+ when BEFORE
44
+ ix = x + ml
45
+ tx = ix + iw + s
46
+ when AFTER
47
+ tx = x + ml
48
+ ix = tx + tw + s
49
+ else
50
+ ix = x + ml
51
+ tx = x + ml
52
+ end
53
+ elsif justify & RIGHT == 1
54
+ case iconPosition
55
+ when BEFORE
56
+ tx = x + w - mr - tw
57
+ ix = tx - iw - s
58
+ when AFTER
59
+ ix = x + w - mr - iw
60
+ tx = ix - tw - s
61
+ else
62
+ ix = x + w - mr - iw
63
+ tx = x + w - mr - tw
64
+ end
65
+ else
66
+ case iconPosition
67
+ when BEFORE
68
+ ix = x + (ml + w - mr)/2 - (tw + iw + s)/2
69
+ tx = ix + iw + s
70
+ when AFTER
71
+ tx = x + (ml + w - mr)/2 - (tw + iw + s)/2
72
+ ix = tx + tw + s
73
+ else
74
+ ix = x + (ml + w - mr)/2 - iw/2
75
+ tx = x + (ml + w - mr)/2 -tw/2
76
+ end
77
+ end
78
+
79
+ # Fix y coordinate
80
+ if justify & TOP == 1
81
+ case iconPosition
82
+ when ABOVE
83
+ iy = y + mt
84
+ ty = iy + ih
85
+ when BELOW
86
+ ty = y + mt
87
+ iy = ty + th
88
+ else
89
+ iy = y + mt
90
+ ty = y + mt
91
+ end
92
+ elsif justify & BOTTOM == 1
93
+ case iconPosition
94
+ when ABOVE
95
+ ty = y + h - mb - th
96
+ iy = ty - ih
97
+ when BELOW
98
+ iy = y + h - mb - ih
99
+ ty = iy - th
100
+ else
101
+ iy = y + h - mb - ih
102
+ ty = y + h - mb - th
103
+ end
104
+ else
105
+ case iconPosition
106
+ when ABOVE
107
+ iy = y + (mt + h - mb)/2 - (th + ih)/2
108
+ ty = iy + ih
109
+ when BELOW
110
+ ty = y + (mt + h - mb)/2 - (th + ih)/2
111
+ iy = ty + th
112
+ else
113
+ iy = y + (mt + h - mb)/2 - ih/2
114
+ ty = y + (mt + h - mb)/2 - th/2
115
+ end
116
+ end
117
+
118
+ # Paint icon
119
+ dc.drawIcon(icn, ix, iy) unless icn.nil?
120
+
121
+ # Text color
122
+ if selected?
123
+ dc.foreground = table.selTextColor
124
+ else
125
+ dc.foreground = table.textColor
126
+ end
127
+ puts "dc.foreground = (#{FXREDVAL(dc.foreground)}, #{FXGREENVAL(dc.foreground)}, #{FXBLUEVAL(dc.foreground)})"
128
+
129
+ # Draw text
130
+ yy = ty + font.fontAscent
131
+ beg = 0
132
+ begin
133
+ _end = beg
134
+ _end += 1 while _end < lbl.length && lbl[_end].chr != '\n'
135
+ if justify & LEFT == 1
136
+ xx = tx
137
+ elsif justify & RIGHT == 1
138
+ xx = tx + tw - font.getTextWidth(lbl[beg..._end])
139
+ else
140
+ xx = tx + (tw - font.getTextWidth(lbl[beg..._end]))/2
141
+ end
142
+ dc.drawText(xx, yy, lbl[beg..._end])
143
+ yy += font.fontHeight
144
+ beg = _end + 1
145
+ end while _end < lbl.length
146
+ end
147
+ end
148
+
149
+ class CustomTable < FXTable
150
+ def createItem *parameters
151
+ CustomTableItem.new *parameters
152
+ end
153
+ end
154
+
155
+ app = FXApp.new
156
+ main = FXMainWindow.new app, 'Test'
157
+
158
+ table = CustomTable.new main
159
+ table.setTableSize 2, 2
160
+ table.visibleRows = 2
161
+ table.visibleColumns = 2
162
+
163
+ table.setItemText 0, 0, 'one'
164
+ table.setItemText 0, 1, 'two'
165
+ table.setItemText 1, 0, 'three'
166
+ table.setItemText 1, 1, 'four'
167
+
168
+ app.create
169
+ main.show PLACEMENT_SCREEN
170
+ app.run
@@ -3,13 +3,13 @@
3
3
  require 'fox16'
4
4
  require 'open-uri'
5
5
  begin
6
- require 'rubyful_soup'
6
+ require 'hpricot'
7
7
  rescue LoadError
8
8
  require 'fox16/missingdep'
9
9
  MSG = <<EOM
10
- Sorry, this example depends on the RubyfulSoup extension. Please
11
- check the Ruby Application Archives for an appropriate
12
- download site.
10
+ Sorry, this example depends on the Hpricot extension. Please
11
+ see http://code.whytheluckystiff.net/hpricot/ for instructions
12
+ on how to install Hpricot.
13
13
  EOM
14
14
  missingDependency(MSG)
15
15
  end
@@ -40,9 +40,8 @@ class DailyDilbert < FXMainWindow
40
40
  end
41
41
 
42
42
  def image_data
43
- src = open("http://www.dilbert.com/").read
44
- soup = BeautifulSoup.new(src)
45
- url = soup.find('img', { :attrs => { 'alt' => /Today's Comic/ } })
43
+ doc = Hpricot(open("http://www.dilbert.com/"))
44
+ url = doc.search("img").find { |e| e['alt'] =~ /Today's Comic/ }
46
45
  open("http://www.dilbert.com" + url['src'], "rb").read
47
46
  end
48
47
 
@@ -21,7 +21,7 @@
21
21
  ***********************************************************************/
22
22
 
23
23
  /***********************************************************************
24
- * $Id: FXRbApp.cpp 2190 2005-08-24 07:58:47Z lyle $
24
+ * $Id: FXRbApp.cpp 2722 2007-11-15 16:50:53Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
27
  #include "FXRbCommon.h"
@@ -95,9 +95,13 @@ long FXRbApp::onChoreThreads(FXObject*,FXSelector,void*){
95
95
  wait.tv_usec=100*sleepTime;
96
96
 
97
97
  // Confirm that this thread can be interrupted, then go to sleep
98
+ #ifndef RUBY_1_9
98
99
  CHECK_INTS;
99
100
  if(!rb_thread_critical)
100
101
  rb_thread_wait_for(wait);
102
+ #else
103
+ if(!rb_thread_critical) rb_thread_wait_for(wait);
104
+ #endif /* RUBY_1_9 */
101
105
 
102
106
  // Re-register this chore for next time
103
107
  addChore(this,ID_CHORE_THREADS);
@@ -21,7 +21,7 @@
21
21
  ***********************************************************************/
22
22
 
23
23
  /***********************************************************************
24
- * $Id: FXRbDataTarget.cpp 2190 2005-08-24 07:58:47Z lyle $
24
+ * $Id: FXRbDataTarget.cpp 2713 2007-11-14 15:27:36Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
27
  #include "FXRbCommon.h"
@@ -57,7 +57,7 @@ void FXRbDataTarget::setValue(VALUE value){
57
57
  connect(doubleValue);
58
58
  break;
59
59
  case T_STRING:
60
- stringValue=STR2CSTR(value);
60
+ stringValue=StringValuePtr(value);
61
61
  connect(stringValue);
62
62
  break;
63
63
  case T_TRUE:
@@ -21,7 +21,7 @@
21
21
  ***********************************************************************/
22
22
 
23
23
  /***********************************************************************
24
- * $Id: FXRuby.cpp 2689 2007-06-30 04:10:18Z lyle $
24
+ * $Id: FXRuby.cpp 2723 2007-11-15 16:51:33Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
27
  #ifdef _MSC_VER
@@ -30,16 +30,18 @@
30
30
 
31
31
  #include "FXRbCommon.h"
32
32
 
33
+ #ifndef RUBY_1_9
33
34
  #include "version.h"
34
35
 
35
36
  #if RUBY_VERSION_CODE < 167
36
37
  #define RB_RESCUE2_BROKEN_PROTOTYPE 1
37
38
  #endif
38
39
 
39
- /* The prototype for st_foreach() changed at Ruby version 1.8.2 */
40
+ // The prototype for st_foreach() changed at Ruby version 1.8.2
40
41
  #if RUBY_VERSION_CODE < 182
41
42
  #define ST_BROKEN_PROTOTYPES 1
42
43
  #endif
44
+ #endif /* RUBY_1_9 */
43
45
 
44
46
  #include "impl.h"
45
47
 
@@ -59,7 +61,7 @@ extern "C" {
59
61
  // we'd be dealing with broken prototypes anyways, so just duplicate
60
62
  // the needed declarations here with the correct prototypes.
61
63
 
62
- #ifdef ST_BROKEN_PROTOTYPES
64
+ #if defined(ST_BROKEN_PROTOTYPES)
63
65
 
64
66
  extern "C" {
65
67
 
@@ -78,11 +80,19 @@ void st_foreach(st_table *table, int (*func)(st_data_t, st_data_t, st_data_t), s
78
80
 
79
81
  #else
80
82
 
83
+ #ifdef RUBY_1_9
84
+
85
+ #include "ruby/st.h"
86
+
87
+ #else
88
+
81
89
  extern "C" {
82
90
  #include "st.h"
83
91
  }
84
92
 
85
- #endif
93
+ #endif /* RUBY_1_9 */
94
+
95
+ #endif /* ST_BROKEN_PROTOTYPES */
86
96
 
87
97
  // Opaque type declaration from SWIG runtime
88
98
  struct swig_type_info;
@@ -187,9 +197,15 @@ FXbool FXRbCatchExceptions=FALSE;
187
197
 
188
198
  // Returns an FXInputHandle for this Ruby file object
189
199
  FXInputHandle FXRbGetReadFileHandle(VALUE obj) {
200
+ #ifdef RUBY_1_9
201
+ rb_io_t *fptr;
202
+ GetOpenFile(obj, fptr);
203
+ FILE *fpr=fptr->stdio_file;
204
+ #else
190
205
  OpenFile *fptr;
191
206
  GetOpenFile(obj, fptr);
192
207
  FILE *fpr=GetReadFile(fptr);
208
+ #endif /* RUBY_1_9 */
193
209
  #ifdef WIN32
194
210
  #ifdef __CYGWIN__
195
211
  return (FXInputHandle) get_osfhandle(fileno(fpr));
@@ -204,9 +220,15 @@ FXInputHandle FXRbGetReadFileHandle(VALUE obj) {
204
220
 
205
221
  // Returns an FXInputHandle for this Ruby file object
206
222
  FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
223
+ #ifdef RUBY_1_9
224
+ rb_io_t *fptr;
225
+ GetOpenFile(obj, fptr);
226
+ FILE *fpw=fptr->stdio_file;
227
+ #else
207
228
  OpenFile *fptr;
208
229
  GetOpenFile(obj, fptr);
209
230
  FILE *fpw=GetWriteFile(fptr);
231
+ #endif /* RUBY_1_9 */
210
232
  #ifdef WIN32
211
233
  #ifdef __CYGWIN__
212
234
  return (FXInputHandle) get_osfhandle(fileno(fpw));
@@ -983,7 +1005,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
983
1005
  case SEL_QUERY_HELP:
984
1006
  return NULL;
985
1007
  case SEL_VERIFY:
986
- return reinterpret_cast<void*>(STR2CSTR(value));
1008
+ return reinterpret_cast<void*>(StringValuePtr(value));
987
1009
  case SEL_CLICKED:
988
1010
  case SEL_DOUBLECLICKED:
989
1011
  case SEL_TRIPLECLICKED:
@@ -1023,7 +1045,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1023
1045
  if(obj->isMemberOf(FXMETACLASS(FXTextField))){
1024
1046
  switch(id){
1025
1047
  case FXTextField::ID_INSERT_STRING:
1026
- return reinterpret_cast<void*>(STR2CSTR(value));;
1048
+ return reinterpret_cast<void*>(StringValuePtr(value));;
1027
1049
  default:
1028
1050
  break;
1029
1051
  }
@@ -1092,7 +1114,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1092
1114
  obj->isMemberOf(FXMETACLASS(FXDirList)) ||
1093
1115
  obj->isMemberOf(FXMETACLASS(FXDriveBox)) ||
1094
1116
  obj->isMemberOf(FXMETACLASS(FXFileList))){
1095
- return reinterpret_cast<void*>(STR2CSTR(value));
1117
+ return reinterpret_cast<void*>(StringValuePtr(value));
1096
1118
  }
1097
1119
  else if(obj->isMemberOf(FXMETACLASS(FXMenuCheck))){
1098
1120
  return reinterpret_cast<void*>(static_cast<FXuval>(RTEST(value) ? 1 : 0));
@@ -1120,7 +1142,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1120
1142
  realValue=NUM2DBL(value);
1121
1143
  return reinterpret_cast<void*>(&realValue);
1122
1144
  case FXWindow::ID_SETSTRINGVALUE:
1123
- stringValue=FXString(STR2CSTR(value));
1145
+ stringValue=FXString(StringValuePtr(value));
1124
1146
  return reinterpret_cast<void*>(&stringValue);
1125
1147
  case FXWindow::ID_SETINTRANGE:
1126
1148
  intRange[0]=NUM2INT(rb_ary_entry(value,0));
@@ -1205,12 +1227,12 @@ static VALUE handle_rescue(VALUE args,VALUE error){
1205
1227
  VALUE errat=rb_funcall(info,id_backtrace,0);
1206
1228
  VALUE mesg=RARRAY(errat)->ptr[0];
1207
1229
  fprintf(stderr,"%s: %s (%s)\n",
1208
- STR2CSTR(mesg),
1209
- STR2CSTR(rb_obj_as_string(info)),
1230
+ StringValuePtr(mesg),
1231
+ RSTRING_PTR(rb_obj_as_string(info)),
1210
1232
  rb_class2name(CLASS_OF(info)));
1211
1233
  for(int i=1;i<RARRAY(errat)->len;i++){
1212
1234
  if(TYPE(RARRAY(errat)->ptr[i])==T_STRING){
1213
- fprintf(stderr,"\tfrom %s\n",STR2CSTR(RARRAY(errat)->ptr[i]));
1235
+ fprintf(stderr,"\tfrom %s\n",StringValuePtr(RARRAY(errat)->ptr[i]));
1214
1236
  }
1215
1237
  }
1216
1238
  return Qnil;
@@ -1467,7 +1489,7 @@ FXString FXRbCallStringMethod(const FXObject* recv, ID func){
1467
1489
  VALUE obj=FXRbGetRubyObj(recv,false);
1468
1490
  FXASSERT(!NIL_P(obj));
1469
1491
  VALUE result=rb_funcall(obj,func,0,NULL);
1470
- return FXString(STR2CSTR(result));
1492
+ return FXString(StringValuePtr(result));
1471
1493
  }
1472
1494
 
1473
1495
  //----------------------------------------------------------------------
@@ -1477,7 +1499,7 @@ const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar*
1477
1499
  VALUE obj=FXRbGetRubyObj(recv,false);
1478
1500
  FXASSERT(!NIL_P(obj));
1479
1501
  VALUE result=rb_funcall(obj,func,2,to_ruby(message),to_ruby(hint));
1480
- return NIL_P(result) ? 0 : STR2CSTR(result);
1502
+ return NIL_P(result) ? 0 : StringValuePtr(result);
1481
1503
  }
1482
1504
 
1483
1505
  // Call functions with const FXchar* return value
@@ -1485,7 +1507,7 @@ const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar*
1485
1507
  VALUE obj=FXRbGetRubyObj(recv,false);
1486
1508
  FXASSERT(!NIL_P(obj));
1487
1509
  VALUE result=rb_funcall(obj,func,3,to_ruby(context),to_ruby(message),to_ruby(hint));
1488
- return NIL_P(result) ? 0 : STR2CSTR(result);
1510
+ return NIL_P(result) ? 0 : StringValuePtr(result);
1489
1511
  }
1490
1512
  //----------------------------------------------------------------------
1491
1513