fxruby 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +199 -0
- data/doc/apes02.html +2 -2
- data/doc/apes03.html +1 -1
- data/doc/book.html +1 -1
- data/doc/changes.html +48 -3
- data/doc/cvs.html +2 -2
- data/doc/differences.html +3 -3
- data/doc/gems.html +43 -43
- data/doc/implementation.html +1 -1
- data/doc/library.html +5 -5
- data/doc/opengl.html +5 -5
- data/doc/pt02.html +1 -1
- data/doc/scintilla.html +4 -4
- data/examples/browser.rb +1 -1
- data/examples/button.rb +59 -48
- data/examples/groupbox.rb +5 -4
- data/examples/ratio.rb +70 -0
- data/examples/table.rb +1 -1
- data/ext/fox12/FXRuby.cpp +2 -1
- data/ext/fox12/core_wrap.cpp +16 -6
- data/ext/fox12/dc_wrap.cpp +16 -6
- data/ext/fox12/dialogs_wrap.cpp +16 -6
- data/ext/fox12/frames_wrap.cpp +16 -6
- data/ext/fox12/fx3d_wrap.cpp +16 -6
- data/ext/fox12/iconlist_wrap.cpp +16 -6
- data/ext/fox12/icons_wrap.cpp +18 -7
- data/ext/fox12/image_wrap.cpp +16 -6
- data/ext/fox12/label_wrap.cpp +16 -6
- data/ext/fox12/layout_wrap.cpp +16 -6
- data/ext/fox12/librb.c +18 -7
- data/ext/fox12/list_wrap.cpp +16 -6
- data/ext/fox12/mdi_wrap.cpp +16 -6
- data/ext/fox12/menu_wrap.cpp +16 -6
- data/ext/fox12/scintilla_wrap.cpp +19 -12
- data/ext/fox12/table_wrap.cpp +16 -6
- data/ext/fox12/text_wrap.cpp +16 -6
- data/ext/fox12/treelist_wrap.cpp +16 -6
- data/ext/fox12/ui_wrap.cpp +16 -6
- data/lib/fox12/aliases.rb +32 -11
- data/lib/fox12/dialogs.rb +72 -0
- data/lib/fox12/execute_nonmodal.rb +70 -0
- data/lib/fox12/iterators.rb +3 -3
- data/lib/fox12/splashscreen.rb +83 -0
- data/lib/fox12/version.rb +1 -1
- data/rdoc-sources/FXDC.rb +14 -13
- data/rdoc-sources/FXDataTarget.rb +30 -5
- data/rdoc-sources/FXFileDialog.rb +50 -5
- data/rdoc-sources/FXList.rb +13 -13
- data/rdoc-sources/FXMemoryBuffer.rb +15 -10
- data/rdoc-sources/FXTable.rb +193 -107
- data/rdoc-sources/FXText.rb +2 -2
- data/rdoc-sources/FXToolBarTab.rb +69 -0
- data/rdoc-sources/FXToolTip.rb +1 -1
- data/tests/TC_FXMaterial.rb +14 -0
- metadata +10 -4
data/ChangeLog
CHANGED
@@ -1,3 +1,202 @@
|
|
1
|
+
2005-01-21 20:44 lyle
|
2
|
+
|
3
|
+
* doc/changes.xml, lib/fox12/aliases.rb: Added Joel's patch for the
|
4
|
+
missing FXApp#tooltipPause reader (see RubyForge Patch #1306).
|
5
|
+
|
6
|
+
2005-01-21 20:29 lyle
|
7
|
+
|
8
|
+
* Rakefile: Bumped the PKG_VERSION up to 1.2.3.
|
9
|
+
|
10
|
+
2005-01-18 07:56 lyle
|
11
|
+
|
12
|
+
* pre-config.rb, doc/gems.xml: [no log message]
|
13
|
+
|
14
|
+
2005-01-18 07:55 lyle
|
15
|
+
|
16
|
+
* rdoc-sources/FXTable.rb: More FXTable API documentation updates.
|
17
|
+
|
18
|
+
2005-01-18 07:55 lyle
|
19
|
+
|
20
|
+
* rdoc-sources/FXToolBarTab.rb: Added documentation for the
|
21
|
+
SEL_KEYPRESS and SEL_KEYRELEASE messages sent by FXToolBarTab to
|
22
|
+
its message target.
|
23
|
+
|
24
|
+
2005-01-17 21:26 lyle
|
25
|
+
|
26
|
+
* Rakefile: Added lib/fox12/splashscreen.rb to the list of files to
|
27
|
+
be RDoc'd.
|
28
|
+
|
29
|
+
2005-01-17 21:10 lyle
|
30
|
+
|
31
|
+
* doc/changes.xml: [no log message]
|
32
|
+
|
33
|
+
2005-01-17 21:06 lyle
|
34
|
+
|
35
|
+
* rdoc-sources/: FXToolBarTab.rb: [no log message]
|
36
|
+
|
37
|
+
2005-01-17 20:42 lyle
|
38
|
+
|
39
|
+
* doc/changes.xml: [no log message]
|
40
|
+
|
41
|
+
2005-01-17 20:39 lyle
|
42
|
+
|
43
|
+
* examples/browser.rb: Corrected a bug in the browser.rb example
|
44
|
+
program (see RubyForge Bug #1146).
|
45
|
+
|
46
|
+
2005-01-17 20:33 lyle
|
47
|
+
|
48
|
+
* lib/fox12/splashscreen.rb: [no log message]
|
49
|
+
|
50
|
+
2005-01-16 18:10 lyle
|
51
|
+
|
52
|
+
* doc/changes.xml, examples/table.rb: Corrected a typo in the
|
53
|
+
table.rb example program (see RubyForge Bug #990).
|
54
|
+
|
55
|
+
2005-01-16 18:07 lyle
|
56
|
+
|
57
|
+
* doc/changes.xml: [no log message]
|
58
|
+
|
59
|
+
2005-01-16 18:06 lyle
|
60
|
+
|
61
|
+
* FXRuby-ruby1.6-i586-mswin32.iss.in,
|
62
|
+
FXRuby-ruby1.8.0-i386-msvcrt.iss.in,
|
63
|
+
FXRuby-ruby1.8.1-i386-msvcrt.iss.in,
|
64
|
+
FXRuby-ruby1.8.2-i386-msvcrt.iss.in, scripts/FXRuby.iss.in: Added
|
65
|
+
the new ratio.rb example program to the Windows installer
|
66
|
+
scripts, plus some missing documentation files.
|
67
|
+
|
68
|
+
2005-01-16 17:57 lyle
|
69
|
+
|
70
|
+
* examples/ratio.rb: [no log message]
|
71
|
+
|
72
|
+
2005-01-16 17:55 lyle
|
73
|
+
|
74
|
+
* examples/ratio.rb: Added Brett Hallett's port of the "ratio"
|
75
|
+
example program.
|
76
|
+
|
77
|
+
2005-01-15 15:30 lyle
|
78
|
+
|
79
|
+
* tests/TC_FXMaterial.rb: Added a test case for RubyForge Bug
|
80
|
+
#1158.
|
81
|
+
|
82
|
+
2005-01-15 15:09 lyle
|
83
|
+
|
84
|
+
* rdoc-sources/FXDataTarget.rb: Added some more documentation for
|
85
|
+
FXDataTarget.
|
86
|
+
|
87
|
+
2005-01-15 15:09 lyle
|
88
|
+
|
89
|
+
* doc/changes.xml, lib/fox12/execute_nonmodal.rb: [no log message]
|
90
|
+
|
91
|
+
2005-01-15 14:49 lyle
|
92
|
+
|
93
|
+
* examples/button.rb: Made some corrections to address the new
|
94
|
+
radio button behavior (see RubyForge Bug #1280).
|
95
|
+
|
96
|
+
2005-01-15 14:17 lyle
|
97
|
+
|
98
|
+
* fxruby.gemspec: [no log message]
|
99
|
+
|
100
|
+
2005-01-15 14:02 lyle
|
101
|
+
|
102
|
+
* Rakefile, doc/changes.xml, ext/fox12/FXRuby.cpp,
|
103
|
+
lib/fox12/execute_nonmodal.rb: Added some preliminary stuff for
|
104
|
+
Joel's execute_nonmodal() and execute_modal() methods (see
|
105
|
+
RubyForge Bug #1283).
|
106
|
+
|
107
|
+
2005-01-12 21:09 lyle
|
108
|
+
|
109
|
+
* doc/changes.xml: [no log message]
|
110
|
+
|
111
|
+
2005-01-12 21:07 lyle
|
112
|
+
|
113
|
+
* doc/changes.xml, rdoc-sources/FXList.rb: Corrected API
|
114
|
+
documentation for FXList methods (see RubyForge Bug #1257).
|
115
|
+
|
116
|
+
2005-01-12 21:06 lyle
|
117
|
+
|
118
|
+
* examples/gembrowser.rb: Corrected retrieveItem() calls to
|
119
|
+
getItem() calls.
|
120
|
+
|
121
|
+
2005-01-12 20:49 lyle
|
122
|
+
|
123
|
+
* doc/changes.xml, lib/fox12/aliases.rb: Added the missing
|
124
|
+
"filenames" alias for FXFileDialog#getFilenames (see RubyForge
|
125
|
+
Bug #1277).
|
126
|
+
|
127
|
+
2005-01-12 20:40 lyle
|
128
|
+
|
129
|
+
* doc/changes.xml: [no log message]
|
130
|
+
|
131
|
+
2005-01-12 20:38 lyle
|
132
|
+
|
133
|
+
* lib/fox12/aliases.rb, rdoc-sources/FXText.rb: Fixed the aliases
|
134
|
+
(and documentation) for FXText#visibleRows and
|
135
|
+
FXText#visibleColumns (see RubyForge Bug #1325).
|
136
|
+
|
137
|
+
2005-01-11 21:10 lyle
|
138
|
+
|
139
|
+
* doc/changes.xml: [no log message]
|
140
|
+
|
141
|
+
2005-01-11 21:05 lyle
|
142
|
+
|
143
|
+
* rdoc-sources/FXFileDialog.rb: Improved the documentation for
|
144
|
+
several FXFileDialog class methods (see RubyForge Bug #1279).
|
145
|
+
|
146
|
+
2005-01-11 20:39 lyle
|
147
|
+
|
148
|
+
* rdoc-sources/FXMemoryBuffer.rb: [no log message]
|
149
|
+
|
150
|
+
2005-01-11 20:31 lyle
|
151
|
+
|
152
|
+
* lib/fox12/aliases.rb: Corrected the setter methods for
|
153
|
+
FXSpinner#selBackColor and FXRealSpinner#selBackColor (see
|
154
|
+
RubyForge Bug #1297).
|
155
|
+
|
156
|
+
2004-11-13 11:15 lyle
|
157
|
+
|
158
|
+
* lib/fox12/iterators.rb: Corrected the implementation of each()
|
159
|
+
for FXHeader, FXIconList and FXList. See RubyForge Bug #1037.
|
160
|
+
|
161
|
+
2004-11-13 11:00 lyle
|
162
|
+
|
163
|
+
* examples/groupbox.rb: Modified the groupbox.rb example so that
|
164
|
+
the radio buttons use a common data target to ensure their mutual
|
165
|
+
exclusion (since the FXGroupBox widget doesn't do that anymore).
|
166
|
+
See RubyForge Bug #751.
|
167
|
+
|
168
|
+
2004-11-13 10:52 lyle
|
169
|
+
|
170
|
+
* rdoc-sources/FXDC.rb: Corrected the documentation for FXArc, per
|
171
|
+
RubyForge Bug #747.
|
172
|
+
|
173
|
+
2004-11-13 10:51 lyle
|
174
|
+
|
175
|
+
* rdoc-sources/FXDC.rb: Corrected the documentation for the
|
176
|
+
FXDC#drawArc and FXDC#fillArc methods (see RubyForge Bug #747).
|
177
|
+
|
178
|
+
2004-10-04 13:12 lyle
|
179
|
+
|
180
|
+
* Rakefile: Added the 'doap' task for uploading the DOAP file to
|
181
|
+
the web site.
|
182
|
+
|
183
|
+
2004-10-04 13:07 lyle
|
184
|
+
|
185
|
+
* ChangeLog, doc/changes.xml, doap.rdf: [no log message]
|
186
|
+
|
187
|
+
2004-10-01 13:39 lyle
|
188
|
+
|
189
|
+
* fxruby.gemspec: [no log message]
|
190
|
+
|
191
|
+
2004-10-01 13:35 lyle
|
192
|
+
|
193
|
+
* scripts/make-installers.rb: [no log message]
|
194
|
+
|
195
|
+
2004-10-01 13:18 lyle
|
196
|
+
|
197
|
+
* FXRuby-ruby1.8.2-i386-msvcrt.iss.in, setversions.rb: [no log
|
198
|
+
message]
|
199
|
+
|
1
200
|
2004-09-30 17:06 lyle
|
2
201
|
|
3
202
|
* Rakefile: Updated the Rakefile version number to 1.2.2.
|
data/doc/apes02.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Object Life Cycles and Garbage Collection</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="implementation.html" title="Appendix E. Implementation"><link rel="previous" href="implementation.html" title="Appendix E. Implementation"><link rel="next" 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">Object Life Cycles and Garbage Collection</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementation.html">Prev</a> </td><th width="60%" align="center">Appendix E. Implementation</th><td width="20%" align="right"> <a accesskey="n" href="apes03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
3
|
+
<title>Object Life Cycles and Garbage Collection</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="implementation.html" title="Appendix E. Implementation"><link rel="previous" href="implementation.html" title="Appendix E. Implementation"><link rel="next" 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">Object Life Cycles and Garbage Collection</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementation.html">Prev</a> </td><th width="60%" align="center">Appendix E. Implementation</th><td width="20%" align="right"> <a accesskey="n" href="apes03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3753"></a>Object Life Cycles and Garbage Collection</h2></div></div><div></div></div><p>One of the more difficult issues to deal with was understanding
|
4
4
|
the "life cycle" of FOX objects (that is, the actual C++ objects) and
|
5
5
|
their relationship to the associated Ruby instances. Understanding this
|
6
6
|
relationship is critical when dealing with Ruby's garbage collector,
|
@@ -18,4 +18,4 @@ myButton = FXButton.new(parentWin, "Hello, World!", myIcon)</pre></td></tr></tab
|
|
18
18
|
returned from most class instance methods; they are references to already-
|
19
19
|
existing objects. For example, <tt class="methodname">FXStatusBar#statusline
|
20
20
|
</tt> returns a reference to the status bar's enclosed status line
|
21
|
-
instance.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="
|
21
|
+
instance.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3772"></a>GL Objects</h3></div></div><div></div></div><p>A C++ <tt class="classname">FXGLGroup</tt> object owns all of the <tt class="classname">FXGLObject</tt> objects it "contains". In other words, when that <tt class="classname">FXGLGroup</tt> object is destroyed, it will also destroy all of the <tt class="classname">FXGLObject</tt> objects for which it holds pointers.</p><p>In order to keep track of <span class="emphasis"><em>which</em></span> GL objects have been added to an <tt class="classname">FXGLGroup</tt>, all of the FXRuby C++ classes derived from <tt class="classname">FXGLObject</tt> have a boolean member variable <i class="structfield"><tt>owned</tt></i> that indicates whether this object is "owned" or not. Until an <tt class="classname">FXGLObject</tt> object is added to a group, this member variable should stay false.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="implementation.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="implementation.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apes03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix E. Implementation </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Virtual Functions</td></tr></table></div></body></html>
|
data/doc/apes03.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Virtual Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="implementation.html" title="Appendix E. Implementation"><link rel="previous" href="apes02.html" title="Object Life Cycles and Garbage Collection"><link rel="next" href="cvs.html" title="Appendix F. Getting the Sources from CVS"></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">Virtual Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apes02.html">Prev</a> </td><th width="60%" align="center">Appendix E. Implementation</th><td width="20%" align="right"> <a accesskey="n" href="cvs.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
3
|
+
<title>Virtual Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="implementation.html" title="Appendix E. Implementation"><link rel="previous" href="apes02.html" title="Object Life Cycles and Garbage Collection"><link rel="next" href="cvs.html" title="Appendix F. Getting the Sources from CVS"></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">Virtual Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apes02.html">Prev</a> </td><th width="60%" align="center">Appendix E. Implementation</th><td width="20%" align="right"> <a accesskey="n" href="cvs.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3806"></a>Virtual Functions</h2></div></div><div></div></div><p>
|
4
4
|
One of the design requirements for FXRuby was to ensure that any
|
5
5
|
virtual function call made on a FOX object (from the C++ library
|
6
6
|
layer) is routed to the proper Ruby instance method, even if that
|
data/doc/book.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>Developing Graphical User Interfaces with FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="next" href="pt01.html" title="Part I. The Basics"></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">Developing Graphical User Interfaces with FXRuby</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="pt01.html">Next</a></td></tr></table><hr></div><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="book"></a>Developing Graphical User Interfaces with FXRuby</h1></div><div><h2 class="subtitle">Covers FXRuby Version 1.2</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Lyle</span> <span class="surname">Johnson</span></h3></div></div><div><p class="copyright">Copyright © 2001-2004 J. Lyle Johnson</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="pt01.html">The Basics</a></dt><dd><dl><dt><a href="goals.html">History and Goals</a></dt><dt>1. <a href="build.html">Building from Source Code</a></dt><dt>2. <a href="gems.html">Installing from Gems</a></dt><dt>3. <a href="tutorial1.html">Hello, World!</a></dt><dd><dl><dt><a href="tutorial1.html#d0e619">First Things First</a></dt><dt><a href="ch03s02.html">Better living through buttons</a></dt><dt><a href="ch03s03.html">Messages</a></dt><dt><a href="ch03s04.html">Adding a tool tip</a></dt><dt><a href="ch03s05.html">Adding an icon</a></dt></dl></dd><dt>4. <a href="clipboardtut.html">Working With the Clipboard</a></dt><dd><dl><dt><a href="clipboardtut.html#d0e1008">Basic Application</a></dt><dt><a href="ch04s02.html">Acquiring the Clipboard</a></dt><dt><a href="ch04s03.html">Sending Data to the Clipboard</a></dt><dt><a href="ch04s04.html">Pasting Data from the Clipboard</a></dt></dl></dd><dt>5. <a href="dragdroptut.html">Drag and Drop</a></dt><dd><dl><dt><a href="dragdroptut.html#d0e1223">Drop Sites</a></dt><dt><a href="ch05s02.html">Drag Sources</a></dt><dt><a href="ch05s03.html">Putting It All Together</a></dt></dl></dd><dt>6. <a href="examples.html">Examples</a></dt><dt>7. <a href="events.html">FXRuby's Message-Target System</a></dt><dt>8. <a href="todo.html">To-do list</a></dt><dt>9. <a href="infosources.html">Other Sources of Information</a></dt><dt>10. <a href="changes.html">Change History</a></dt></dl></dd><dt>II. <a href="pt02.html">Appendices</a></dt><dd><dl><dt>A. <a href="opengl.html">Using OpenGL with FXRuby</a></dt><dt>B. <a href="scintilla.html">Using Scintilla with FXRuby</a></dt><dt>C. <a href="differences.html">Differences between FOX and FXRuby</a></dt><dt>D. <a href="library.html">The FXRuby Standard Library</a></dt><dt>E. <a href="implementation.html">Implementation</a></dt><dd><dl><dt><a href="implementation.html#
|
3
|
+
<title>Developing Graphical User Interfaces with FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="next" href="pt01.html" title="Part I. The Basics"></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">Developing Graphical User Interfaces with FXRuby</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="pt01.html">Next</a></td></tr></table><hr></div><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="book"></a>Developing Graphical User Interfaces with FXRuby</h1></div><div><h2 class="subtitle">Covers FXRuby Version 1.2</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Lyle</span> <span class="surname">Johnson</span></h3></div></div><div><p class="copyright">Copyright © 2001-2004 J. Lyle Johnson</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="pt01.html">The Basics</a></dt><dd><dl><dt><a href="goals.html">History and Goals</a></dt><dt>1. <a href="build.html">Building from Source Code</a></dt><dt>2. <a href="gems.html">Installing from Gems</a></dt><dt>3. <a href="tutorial1.html">Hello, World!</a></dt><dd><dl><dt><a href="tutorial1.html#d0e619">First Things First</a></dt><dt><a href="ch03s02.html">Better living through buttons</a></dt><dt><a href="ch03s03.html">Messages</a></dt><dt><a href="ch03s04.html">Adding a tool tip</a></dt><dt><a href="ch03s05.html">Adding an icon</a></dt></dl></dd><dt>4. <a href="clipboardtut.html">Working With the Clipboard</a></dt><dd><dl><dt><a href="clipboardtut.html#d0e1008">Basic Application</a></dt><dt><a href="ch04s02.html">Acquiring the Clipboard</a></dt><dt><a href="ch04s03.html">Sending Data to the Clipboard</a></dt><dt><a href="ch04s04.html">Pasting Data from the Clipboard</a></dt></dl></dd><dt>5. <a href="dragdroptut.html">Drag and Drop</a></dt><dd><dl><dt><a href="dragdroptut.html#d0e1223">Drop Sites</a></dt><dt><a href="ch05s02.html">Drag Sources</a></dt><dt><a href="ch05s03.html">Putting It All Together</a></dt></dl></dd><dt>6. <a href="examples.html">Examples</a></dt><dt>7. <a href="events.html">FXRuby's Message-Target System</a></dt><dt>8. <a href="todo.html">To-do list</a></dt><dt>9. <a href="infosources.html">Other Sources of Information</a></dt><dt>10. <a href="changes.html">Change History</a></dt></dl></dd><dt>II. <a href="pt02.html">Appendices</a></dt><dd><dl><dt>A. <a href="opengl.html">Using OpenGL with FXRuby</a></dt><dt>B. <a href="scintilla.html">Using Scintilla with FXRuby</a></dt><dt>C. <a href="differences.html">Differences between FOX and FXRuby</a></dt><dt>D. <a href="library.html">The FXRuby Standard Library</a></dt><dt>E. <a href="implementation.html">Implementation</a></dt><dd><dl><dt><a href="implementation.html#d0e3734">Code Generation</a></dt><dt><a href="apes02.html">Object Life Cycles and Garbage Collection</a></dt><dd><dl><dt><a href="apes02.html#d0e3772">GL Objects</a></dt></dl></dd><dt><a href="apes03.html">Virtual Functions</a></dt></dl></dd><dt>F. <a href="cvs.html">Getting the Sources from CVS</a></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="pt01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Part I. The Basics</td></tr></table></div></body></html>
|
data/doc/changes.html
CHANGED
@@ -1,6 +1,51 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter 10. Change History</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="previous" href="infosources.html" title="Chapter 9. Other Sources of Information"><link rel="next" href="pt02.html" title="Part II. Appendices"></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">Chapter 10. Change History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="infosources.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="pt02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="changes"></a>Chapter 10. Change History</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2403"></a>Changes For Version 1.2.
|
3
|
+
<title>Chapter 10. Change History</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="previous" href="infosources.html" title="Chapter 9. Other Sources of Information"><link rel="next" href="pt02.html" title="Part II. Appendices"></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">Chapter 10. Change History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="infosources.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="pt02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="changes"></a>Chapter 10. Change History</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2403"></a>Changes For Version 1.2.3 (January 22, 2005)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Since group boxes containing radio buttons no longer enforce the radio behavior
|
4
|
+
of radio buttons (i.e. keeping only one radio button selected at a time), some of the
|
5
|
+
example programs were no longer working as desired (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=751&group_id=300&atid=1223" target="_top">RubyForge Bug #751</a> and
|
6
|
+
<a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1280&group_id=300&atid=1223" target="_top">RubyForge Bug #1280</a>).
|
7
|
+
This problem has been corrected.
|
8
|
+
Thanks to Yuri Leikind and Barry DeZonia for reporting this problem.</p></li><li style="list-style-type: disc"><p>Bob Sidebotham reported a little typo in the <tt class="filename">table.rb</tt> example program
|
9
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=990&group_id=300&atid=1223" target="_top">RubyForge Bug #990</a>).
|
10
|
+
This has been corrected.</p></li><li style="list-style-type: disc"><p>The API documentation for <tt class="classname">FXList</tt> did not reflect the
|
11
|
+
changes for FOX 1.2; the <tt class="methodname">retrieveItem()</tt> has been renamed
|
12
|
+
to <tt class="methodname">getItem()</tt> and <tt class="methodname">insertItem()</tt>
|
13
|
+
has been renamed to <tt class="methodname">setItem()</tt> (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1037&group_id=300&atid=1223" target="_top">RubyForge Bug #1037</a>
|
14
|
+
and
|
15
|
+
<a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1257&group_id=300&atid=1223" target="_top">RubyForge Bug #1257</a>).
|
16
|
+
This has been corrected.
|
17
|
+
Thanks to Remy Drouilhet and Stephan Kamper for reporting this problem.</p></li><li style="list-style-type: disc"><p>The Windows installer was missing some of the documentation files (see
|
18
|
+
<a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1139&group_id=300&atid=1223" target="_top">RubyForge Bug #1139</a>).
|
19
|
+
This has been corrected.
|
20
|
+
Thanks to Curt Hibbs and Mark Smith for reporting this problem.</p></li><li style="list-style-type: disc"><p>The <tt class="filename">browser.rb</tt> example program was broken (see
|
21
|
+
<a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1146&group_id=300&atid=1223" target="_top">RubyForge Bug #1146</a>).
|
22
|
+
This has been corrected.
|
23
|
+
Thanks to Stefan Lang for reporting this problem.</p></li><li style="list-style-type: disc"><p>The attribute setter for <tt class="methodname">FXHeaderItem#justification</tt>
|
24
|
+
was defined incorrectly (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1276&group_id=300&atid=1223" target="_top">RubyForge Bug #1276</a>). This has been corrected.
|
25
|
+
Thanks to Joel VanderWerf for reporting this problem (and providing a patch to fix it).</p></li><li style="list-style-type: disc"><p>The <tt class="methodname">filenames</tt> alias for the <tt class="methodname">FXFileDialog#getFilenames()</tt>
|
26
|
+
instance method was missing
|
27
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1277&group_id=300&atid=1223" target="_top">RubyForge Bug #1277</a>).
|
28
|
+
This error has been corrected.
|
29
|
+
Thanks to Barry DeZonia for reporting this problem.</p></li><li style="list-style-type: disc"><p>The API documentation for the <tt class="classname">FXFileDialog</tt> class methods <tt class="methodname">getOpenFilenames()</tt>,
|
30
|
+
<tt class="methodname">getOpenDirectory()</tt>, <tt class="methodname">getOpenFilename()</tt> and <tt class="methodname">getSaveFilename()</tt> was extremely inadequate
|
31
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1279&group_id=300&atid=1223" target="_top">RubyForge Bug #1279</a>).
|
32
|
+
This documentation has been improved.
|
33
|
+
Thanks to Barry DeZonia for reporting this problem.</p></li><li style="list-style-type: disc"><p>Brett Hallett contributed a Ruby port of the "ratio" example program from the regular
|
34
|
+
FOX distribution, for demonstrating the use of the new <tt class="classname">FXSpring</tt> layout manager
|
35
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1282&group_id=300&atid=1223" target="_top">RubyForge Bug #1282</a>).
|
36
|
+
Many thanks to Brett for this addition!</p></li><li style="list-style-type: disc"><p>Joel VanderWerf contributed code to simplify how programs interact with
|
37
|
+
modal and non-modal dialog boxes (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1283&group_id=300&atid=1223" target="_top">RubyForge Bug #1283</a>).
|
38
|
+
See the API documentation for the new <tt class="methodname">FXDialogBox#execute_modal</tt>
|
39
|
+
and <tt class="methodname">FXDialogBox#execute_nonmodal</tt> methods for examples of their use.</p></li><li style="list-style-type: disc"><p>The attribute setters for <tt class="methodname">FXRealSpinner#selBackColor</tt> and
|
40
|
+
<tt class="methodname">FXSpinner#selBackColor</tt> were defined incorrectly (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1297&group_id=300&atid=1223" target="_top">RubyForge Bug #1297</a>). These have been corrected.
|
41
|
+
Thanks to Meinrad Recheis for reporting this problem.</p></li><li style="list-style-type: disc"><p>The <tt class="methodname">tooltipPause</tt> attribute reader for the <tt class="classname">FXApp</tt> class was missing
|
42
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1306&group_id=300&atid=1225" target="_top">RubyForge Patch #1306</a>).
|
43
|
+
Thanks to Joel VanderWerf for reporting this omission and providing a patch to fix it.</p></li><li style="list-style-type: disc"><p>The API documentation for the <tt class="classname">FXToolBarTab</tt> class was missing
|
44
|
+
(see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1322&group_id=300&atid=1223" target="_top">RubyForge Bug #1322</a>).
|
45
|
+
Thanks to Joel VanderWerf for reporting this omission.</p></li><li style="list-style-type: disc"><p>The attribute accessors for <tt class="methodname">FXText#visibleRows</tt> and
|
46
|
+
<tt class="methodname">FXText#visibleColumns</tt> were defined and documented incorrectly (see <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=1325&group_id=300&atid=1223" target="_top">RubyForge Bug #1325</a>). These have been corrected.
|
47
|
+
Thanks to Karl El-Koura for reporting this problem.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.13 and
|
48
|
+
FXScintilla version 1.62.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2575"></a>Changes For Version 1.2.2 (October 1, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>In order to avoid versioning problems when dealing with a mix of
|
4
49
|
applications based on either FXRuby 1.0 or 1.2, the feature name for
|
5
50
|
FXRuby has been changed from "fox" to "fox12". For most application
|
6
51
|
developers, this means that you will need to modify the source code
|
@@ -8,7 +53,7 @@
|
|
8
53
|
changes should be required for legacy applications targeted at FXRuby
|
9
54
|
1.0.</p></li><li style="list-style-type: disc"><p>Made a number of updates to the documentation, to reflect API
|
10
55
|
changes for FXRuby 1.2.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.9 and
|
11
|
-
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
56
|
+
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2592"></a>Changes For Version 1.2a2 (July 10, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>This is the second "alpha" release of FXRuby 1.2. This release
|
12
57
|
should be compatible with any FOX library version 1.2; it is not
|
13
58
|
compatible with any previous FOX library versions. As this is an alpha
|
14
59
|
release, users should expect a certain amount of instability, bugs,
|
@@ -50,7 +95,7 @@
|
|
50
95
|
or JPEG image support built-in (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986180&group_id=20243&atid=120243" target="_top">SourceForge
|
51
96
|
Bug #986180</a>). This has been fixed. Thanks to Bil Bas for
|
52
97
|
reporting this problem.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.7 and
|
53
|
-
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
98
|
+
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2701"></a>Changes For Version 1.2a1 (June 28, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>This is the first "alpha" release of FXRuby 1.2. This release
|
54
99
|
should be compatible with any FOX library version 1.2; it is not
|
55
100
|
compatible with any previous FOX library versions. As this is an alpha
|
56
101
|
release, users should expect a certain amount of instability, bugs,
|
data/doc/cvs.html
CHANGED
@@ -19,13 +19,13 @@
|
|
19
19
|
modified SWIG interface files. I always use the latest development version
|
20
20
|
of <a href="http://www.swig.org" target="_top">SWIG</a>, but any release after,
|
21
21
|
say, SWIG 1.3.15 should work fine. The older SWIG 1.1 releases will
|
22
|
-
definitely <span class="emphasis"><em>not</em></span> work.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
22
|
+
definitely <span class="emphasis"><em>not</em></span> work.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3915"></a>Checking out the stable version</h2></div></div><div></div></div><p>The stable version of FXRuby is the 1.0.x branch and is compatible
|
23
23
|
with any of the FOX 1.0.x releases. It is <span class="emphasis"><em>not</em></span>
|
24
24
|
compatible with any other release branches of FOX (e.g. the FOX 1.2.x or
|
25
25
|
1.3.x series of releases).</p><p>To check out the stable version of FXRuby, do the following:</p><div class="orderedlist"><ol type="1"><li><p>Log in to the CVS server by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">cvs -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby login</pre></td></tr></table><p>When prompted for a password for <span class="emphasis"><em>anonymous</em></span>,
|
26
26
|
simply press the <b class="keycap">Enter</b> key.</p></li><li><p>Check out the stable branch of FXRuby by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">cvs -z3 -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby co -rrelease10 FXRuby</pre></td></tr></table></li></ol></div><p>At this point, you should be ready to change to the top-level
|
27
27
|
directory and go through the normal build and installation process, as
|
28
|
-
described in an earlier chapter.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
28
|
+
described in an earlier chapter.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3948"></a>Regenerating wrapper code with SWIG</h2></div></div><div></div></div><p>If you make changes to any of the SWIG interface files (the files
|
29
29
|
ending with a <tt class="filename">.i</tt> extension, in the <tt class="filename">swig-interfaces</tt> subdirectory) you will need
|
30
30
|
to re-run SWIG to regenerate parts of the FXRuby source code:</p><div class="orderedlist"><ol type="1"><li><p>Change directories to the <tt class="filename">swig-interfaces</tt> subdirectory of the
|
31
31
|
FXRuby source tree.</p></li><li><p>Type the following command to create a "bootstrap"
|
data/doc/differences.html
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix C. Differences between FOX and FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" href="scintilla.html" title="Appendix B. Using Scintilla with FXRuby"><link rel="next" href="library.html" title="Appendix D. The FXRuby Standard Library"></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 C. Differences between FOX and FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="differences"></a>Appendix C. Differences between FOX and FXRuby</h2></div></div><div></div></div><p>The FXRuby API follows the FOX API very closely and for the most part, you should be able to use the standard FOX class documentation as a reference. In some cases, however, fundamental differences between Ruby and C++ necessitated slight changes in the API. For some other cases, FOX classes were enhanced to take advantage of Ruby language features (such as iterators). The purpose of this chapter is to identify some of the differences between the C++ and Ruby interfaces to FOX.</p><p>One difference that should be easy to cope with is the substitution of Ruby Strings for FXStrings. Any function that would normally expect an <span class="type">FXString</span> input argument insteads takes a Ruby String. Similarly, functions that would return an <span class="type">FXString</span> will instead return a Ruby string. For functions that would normally accept a <tt class="constant">NULL</tt> or empty string argument, just pass <tt class="constant">nil</tt> or an empty string ("").</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
3
|
+
<title>Appendix C. Differences between FOX and FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" href="scintilla.html" title="Appendix B. Using Scintilla with FXRuby"><link rel="next" href="library.html" title="Appendix D. The FXRuby Standard Library"></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 C. Differences between FOX and FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="differences"></a>Appendix C. Differences between FOX and FXRuby</h2></div></div><div></div></div><p>The FXRuby API follows the FOX API very closely and for the most part, you should be able to use the standard FOX class documentation as a reference. In some cases, however, fundamental differences between Ruby and C++ necessitated slight changes in the API. For some other cases, FOX classes were enhanced to take advantage of Ruby language features (such as iterators). The purpose of this chapter is to identify some of the differences between the C++ and Ruby interfaces to FOX.</p><p>One difference that should be easy to cope with is the substitution of Ruby Strings for FXStrings. Any function that would normally expect an <span class="type">FXString</span> input argument insteads takes a Ruby String. Similarly, functions that would return an <span class="type">FXString</span> will instead return a Ruby string. For functions that would normally accept a <tt class="constant">NULL</tt> or empty string argument, just pass <tt class="constant">nil</tt> or an empty string ("").</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2996"></a>Functions that expect arrays of objects</h2></div></div><div></div></div><p>One common pattern in FOX member function argument lists is to expect a pointer to an array of values, followed by an integer indicating the number of values in the array. This of course isn't necessary in Ruby, where <tt class="classname">Array</tt> objects "know" their lengths. As a result, functions such as <tt class="methodname">FXWindow::acquireClipboard()</tt>, whose C++ declaration looks like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXbool acquireClipboard(const FXDragType *types, FXuint numTypes);</pre></td></tr></table><p>are called from Ruby code by passing in a single <tt class="classname">Array</tt> argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">myWindow.acquireClipboard(typesArray)</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3016"></a>Functions that return values by reference</h2></div></div><div></div></div><p>Many FOX methods take advantage of the C++ language feature of returning values by reference. For example, the <tt class="methodname">getCursorPos()</tt> member function for class <tt class="classname">FXWindow</tt> has the declaration:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXint getCursorPos(FXint& x, FXint& y, FXint& buttons) const;</pre></td></tr></table><p>which indicates that the function takes references to three integers (x, y and buttons). To call this function from a C++ program, you'd write code like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXint x, y;
|
4
4
|
FXuint buttons;
|
5
5
|
|
6
6
|
if (window->getCursorPosition(x, y, buttons))
|
7
|
-
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre></td></tr></table><p>Since this idiom doesn't translate well to Ruby, some functions' interfaces have been slightly modified. For example, the FXRuby implementation of <tt class="methodname">getCursorPos()</tt> returns the three values as an <tt class="classname">Array</tt>, e.g.:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">x, y, buttons = aWindow.getCursorPos()</pre></td></tr></table><p>The following table shows how these kinds of functions are implemented in FXRuby:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Instance Method</th><th align="center">Return Value</th></tr></thead><tbody><tr><td><tt class="methodname">FXDial#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXDial#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXFontDialog#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXFontSelector#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXGLObject#bounds(range)</tt></td><td>Takes an <tt class="classname">FXRange</tt> instance as its input and returns a (possibly modified) <tt class="classname">FXRange</tt> instance.</td></tr><tr><td><tt class="methodname">FXGLViewer#eyeToScreen(eye)</tt></td><td>Takes an array of eye coordinates (floats) as its input and returns the screen point coordinate as an array of integers [sx, sy]</td></tr><tr><td><tt class="methodname">FXGLViewer#getBoreVector(sx, sy)</tt></td><td>Returns the endpoint and direction vector as an array of arrays [point, dir]</td></tr><tr><td><tt class="methodname">FXGLViewer#light</tt></td><td>Returns a <tt class="classname">FXLight</tt> instance</td></tr><tr><td><tt class="methodname">FXGLViewer#viewport</tt></td><td>Returns an <tt class="classname">FXViewport</tt> instance.</td></tr><tr><td><tt class="methodname">FXPrinterDialog#printer</tt></td><td>Returns the <tt class="classname">FXPrinter</tt> instance</td></tr><tr><td><tt class="methodname">FXScrollArea#position</tt></td><td>Returns the position as an array of integers [x, y]</td></tr><tr><td><tt class="methodname">FXSlider#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSlider#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXSpinner#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSpinner#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXText#appendText(text, notify=false)</tt></td><td>Append text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#appendStyledText(text, style=0, notify=false)</tt></td><td>Append styled text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#extractText(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#extractStyle(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> style characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#insertText(pos, text, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#insertStyledText(pos, text, style=0, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#replaceText(pos, m, text, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#replaceStyledText(pos, m, text, style=0, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#setDelimiters(delimiters)</tt></td><td>Change delimiters of words (<span class="emphasis"><em>delimiters</em></span> is a string).</td></tr><tr><td><tt class="methodname">FXText#getDelimiters()</tt></td><td>Return word delimiters as a string.</td></tr><tr><td><tt class="methodname">FXWindow#cursorPosition</tt></td><td>Returns an array of integers [x, y, buttons]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesFrom(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, y]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesTo(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, y]</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
7
|
+
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre></td></tr></table><p>Since this idiom doesn't translate well to Ruby, some functions' interfaces have been slightly modified. For example, the FXRuby implementation of <tt class="methodname">getCursorPos()</tt> returns the three values as an <tt class="classname">Array</tt>, e.g.:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">x, y, buttons = aWindow.getCursorPos()</pre></td></tr></table><p>The following table shows how these kinds of functions are implemented in FXRuby:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Instance Method</th><th align="center">Return Value</th></tr></thead><tbody><tr><td><tt class="methodname">FXDial#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXDial#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXFontDialog#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXFontSelector#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXGLObject#bounds(range)</tt></td><td>Takes an <tt class="classname">FXRange</tt> instance as its input and returns a (possibly modified) <tt class="classname">FXRange</tt> instance.</td></tr><tr><td><tt class="methodname">FXGLViewer#eyeToScreen(eye)</tt></td><td>Takes an array of eye coordinates (floats) as its input and returns the screen point coordinate as an array of integers [sx, sy]</td></tr><tr><td><tt class="methodname">FXGLViewer#getBoreVector(sx, sy)</tt></td><td>Returns the endpoint and direction vector as an array of arrays [point, dir]</td></tr><tr><td><tt class="methodname">FXGLViewer#light</tt></td><td>Returns a <tt class="classname">FXLight</tt> instance</td></tr><tr><td><tt class="methodname">FXGLViewer#viewport</tt></td><td>Returns an <tt class="classname">FXViewport</tt> instance.</td></tr><tr><td><tt class="methodname">FXPrinterDialog#printer</tt></td><td>Returns the <tt class="classname">FXPrinter</tt> instance</td></tr><tr><td><tt class="methodname">FXScrollArea#position</tt></td><td>Returns the position as an array of integers [x, y]</td></tr><tr><td><tt class="methodname">FXSlider#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSlider#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXSpinner#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSpinner#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXText#appendText(text, notify=false)</tt></td><td>Append text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#appendStyledText(text, style=0, notify=false)</tt></td><td>Append styled text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#extractText(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#extractStyle(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> style characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#insertText(pos, text, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#insertStyledText(pos, text, style=0, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#replaceText(pos, m, text, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#replaceStyledText(pos, m, text, style=0, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#setDelimiters(delimiters)</tt></td><td>Change delimiters of words (<span class="emphasis"><em>delimiters</em></span> is a string).</td></tr><tr><td><tt class="methodname">FXText#getDelimiters()</tt></td><td>Return word delimiters as a string.</td></tr><tr><td><tt class="methodname">FXWindow#cursorPosition</tt></td><td>Returns an array of integers [x, y, buttons]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesFrom(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, y]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesTo(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, y]</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3306"></a>Iterators</h2></div></div><div></div></div><p>Several classes have been extended with an <tt class="methodname">each</tt> method to provide Ruby-style iterators. These classes include <tt class="classname">FXComboBox</tt>, <tt class="classname">FXGLGroup</tt>, <tt class="classname">FXHeader</tt>, <tt class="classname">FXIconList</tt>, <tt class="classname">FXList</tt>, <tt class="classname">FXListBox</tt>, <tt class="classname">FXTreeItem</tt>, <tt class="classname">FXTreeList</tt> and <tt class="classname">FXTreeListBox</tt>. These classes also mix-in Ruby's <tt class="classname">Enumerable</tt> module so that you can take full advantage of the iterators.</p><p>The block parameters passed to your code block vary depending on the class. For example, iterating over an <tt class="classname">FXList</tt> instance yields <tt class="classname">FXListItem</tt> parameters:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aList.each { |aListItem|
|
8
8
|
puts "text for this item = #{aListItem.getText()}"
|
9
9
|
}</pre></td></tr></table><p>whereas iterating over an <tt class="classname">FXComboBox</tt> instance yields two parameters, the item text (a string) and the item data:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aComboBox.each { |itemText, itemData|
|
10
10
|
puts "text for this item = #{itemText}"
|
11
|
-
}</pre></td></tr></table><p>The following table shows the block parameters for each of these classes' iterators:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Class</th><th align="center">Block Parameters</th></tr></thead><tbody><tr><td><tt class="classname">FXComboBox</tt></td><td>the item text (a string) and user data</td></tr><tr><td><tt class="classname">FXGLGroup</tt></td><td>an <tt class="classname">FXGLObject</tt> instance</td></tr><tr><td><tt class="classname">FXHeader</tt></td><td>an <tt class="classname">FXHeaderItem</tt> instance</td></tr><tr><td><tt class="classname">FXIconList</tt></td><td>an <tt class="classname">FXIconItem</tt> instance</td></tr><tr><td><tt class="classname">FXList</tt></td><td>an <tt class="classname">FXListItem</tt> instance</td></tr><tr><td><tt class="classname">FXListBox</tt></td><td>the item text (a string), icon (an <tt class="classname">FXIcon</tt> instance) and user data</td></tr><tr><td><tt class="classname">FXTreeItem</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeList</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeListBox</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
11
|
+
}</pre></td></tr></table><p>The following table shows the block parameters for each of these classes' iterators:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Class</th><th align="center">Block Parameters</th></tr></thead><tbody><tr><td><tt class="classname">FXComboBox</tt></td><td>the item text (a string) and user data</td></tr><tr><td><tt class="classname">FXGLGroup</tt></td><td>an <tt class="classname">FXGLObject</tt> instance</td></tr><tr><td><tt class="classname">FXHeader</tt></td><td>an <tt class="classname">FXHeaderItem</tt> instance</td></tr><tr><td><tt class="classname">FXIconList</tt></td><td>an <tt class="classname">FXIconItem</tt> instance</td></tr><tr><td><tt class="classname">FXList</tt></td><td>an <tt class="classname">FXListItem</tt> instance</td></tr><tr><td><tt class="classname">FXListBox</tt></td><td>the item text (a string), icon (an <tt class="classname">FXIcon</tt> instance) and user data</td></tr><tr><td><tt class="classname">FXTreeItem</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeList</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeListBox</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3450"></a>Attribute Accessors</h2></div></div><div></div></div><p>FOX strictly handles access to all object attributes through member functions, e.g. <tt class="methodname">setBackgroundColor</tt> and <tt class="methodname">getBackgroundColor</tt> or <tt class="methodname">setText</tt> and <tt class="methodname">getText</tt>. FXRuby exposes all of these functions but also provides aliases that look more like regular Ruby attribute accessors. The names for these accessors are based on the FOX method names; for example, <tt class="methodname">setBackgroundColor</tt> and <tt class="methodname">getBackgroundColor</tt> are aliased to <tt class="methodname">backgroundColor=</tt> and <tt class="methodname">backgroundColor</tt>, respectively.</p><p>In many cases these aliases allow you to write more compact and legible code. For example, consider this code snippet:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.setText(aLabel.getText() + " (modified)")</pre></td></tr></table><p>Now consider a different code snippet, using the aliased accessor method names:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.text += " (modified)"</pre></td></tr></table><p>While these two are functionally equivalent, the latter is a bit easier to read and understand at first glance.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3489"></a>Message Passing</h2></div></div><div></div></div><p>FOX message maps are implemented as static C++ class members. With FXRuby, you just associate messages with message handlers in the class <tt class="methodname">initialize</tt> method using the <tt class="methodname">FXMAPFUNC()</tt>, <tt class="methodname">FXMAPTYPE()</tt>, <tt class="methodname">FXMAPTYPES()</tt> or <tt class="methodname">FXMAPFUNCS()</tt> methods. See almost any of the example programs for examples of how this is done.</p><p>As in C++ FOX, the last argument passed to your message handler functions contains message-specific data. For instance, all <tt class="constant">SEL_PAINT</tt> messages pass an <tt class="classname">FXEvent</tt> object through this argument to give you some information about the size of the exposed rectangle. On the other hand, a <tt class="constant">SEL_COMMAND</tt> message from an <tt class="classname">FXHeader</tt> object passes the index of the selected header item through this argument. Instead of guessing what's in this last argument, your best bet is to instead invoke a member function on the sending object to find out what you need, instead of relying on the data passed through this pointer. For example, if you get a <tt class="constant">SEL_COMMAND</tt> message from an <tt class="classname">FXColorWell</tt> object, the data passed through that last argument is supposed to be the new RGB color value. Instead of trying to interpret the argument's contents, just turn around and call the color well's <tt class="methodname">getRGBA()</tt> member function to retrieve its color. Similarly, if you get a <tt class="constant">SEL_COMMAND</tt> message from a tree list, call its <tt class="methodname">getCurrentItem()</tt> method to find out which item was selected.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3538"></a>Catching Operating System Signals</h2></div></div><div></div></div><p>The <tt class="methodname">FXApp#addSignal</tt> and <tt class="methodname">FXApp#removeSignal</tt> methods have been enhanced to accept either a string or integer as their first argument. If it's a string (e.g. "SIGINT" or just "INT") the code will determine the corresponding signal number for you (similar to the standard Ruby library's <tt class="methodname">Process.kill</tt> module method). For examples of how to use this, see the <tt class="filename">datatarget.rb</tt> or <tt class="filename">imageviewer.rb</tt> example programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3558"></a>Support for Multithreaded Applications</h2></div></div><div></div></div><p>There is some support for multithreaded FXRuby applications, but it's not wonderful. The current implementation does what is also done in Ruby/GTK; it turns over some idle processing time to the Ruby thread scheduler to let other threads do their thing. As I learn more about Ruby's threading implementation I may try something different, but this seems to work OK for now. For a simple example, see the <tt class="filename">groupbox.rb</tt> example program, in which the clock label that appears in the lower right-hand corner is continuously updated (by a separate thread).</p><p>If you suspect that FXRuby's threads support is interfering with your application's performance, you may want to try tweaking the amount of time that the main application thread "sleeps" during idle processing; do this by setting the <tt class="classname">FXApp</tt> object's <i class="structfield"><tt>sleepTime</tt></i> attribute. The default value for <i class="structfield"><tt>FXApp#sleepTime</tt></i> is 100 milliseconds. You can also disable the threads support completely by calling <tt class="methodname">FXApp#threadsEnabled=false</tt> (and subsequently re-enable it with <tt class="methodname">FXApp#threadsEnabled=true</tt>).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3583"></a>Debugging Tricks</h2></div></div><div></div></div><p>As a debugging tool, you can optionally catch exceptions raised in message handlers. To turn on this feature, call the <tt class="methodname">setIgnoreExceptions(true)</tt> module method. When this is enabled, any exceptions raised in message handler functions will cause a standard stack trace to be dumped to the standard output, but then your application will, for better or worse, proceed normally. Thanks to Ted Meng for this suggestion.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Using Scintilla with FXRuby </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D. The FXRuby Standard Library</td></tr></table></div></body></html>
|