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/doc/gems.html
CHANGED
@@ -1,50 +1,51 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
3
|
<title>Chapter 2. Installing from Gems</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="build.html" title="Chapter 1. Building from Source Code"><link rel="next" href="tutorial1.html" title="Chapter 3. Hello, World!"></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 2. Installing from Gems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="build.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial1.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="gems"></a>Chapter 2. Installing from Gems</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e435"></a>Introduction</h2></div></div><div></div></div><p>Starting with FXRuby version 1.2, FXRuby uses <a href="http://rubygems.rubyforge.org" target="_top">RubyGems</a> as its packaging and
|
4
|
-
distribution method. The code is available both as</p><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>a "source" gem, which
|
5
|
-
before it's installed; and,</p></li><li style="list-style-type: disc"><p>a "binary" gem, which contains a precompiled version of
|
6
|
-
for a specific operating system (such as Windows).</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e450"></a>Installing from a Source Gem</h2></div></div><div></div></div><p>
|
7
|
-
|
8
|
-
superuser privileges, since you'll typically need superuser privileges
|
9
|
-
install the library files. By default, the source gem will look for
|
10
|
-
FOX (and optionally, FXScintilla) installation in a few standard
|
11
|
-
such as the <tt class="filename">/usr</tt>, <tt class="filename">/usr/local</tt>
|
12
|
-
<tt class="filename">/sw</tt> directories. If you've installed those
|
13
|
-
under some other directory (for example, in your home directory)
|
14
|
-
need to pass some additional arguments on the command line, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">sudo gem install fxruby-1.2.
|
15
|
-
type something like:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">C:\> <b class="command">gem install fxruby-1.2.
|
16
|
-
FXRuby, so this might be a good time to take a coffee break. You
|
17
|
-
any compiler output appear on the screen while the gem is
|
18
|
-
rest assured that the output is being saved into the
|
4
|
+
distribution method. The code is available both as</p><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>a "source" gem, which contains source code that must be
|
5
|
+
compiled on your computer before it's installed; and,</p></li><li style="list-style-type: disc"><p>a "binary" gem, which contains a precompiled version of
|
6
|
+
the code for a specific operating system (such as Windows).</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e450"></a>Installing from a Source Gem</h2></div></div><div></div></div><p>If you've already downloaded the source gem, you can install it
|
7
|
+
by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">sudo gem install fxruby-1.2.2.gem</b></pre></td></tr></table><p>Note the use of the <b class="command">sudo</b> command to invoke
|
8
|
+
superuser privileges, since you'll typically need superuser privileges
|
9
|
+
to install the library files. By default, the source gem will look for
|
10
|
+
your FOX (and optionally, FXScintilla) installation in a few standard
|
11
|
+
places, such as the <tt class="filename">/usr</tt>, <tt class="filename">/usr/local</tt>
|
12
|
+
and <tt class="filename">/sw</tt> directories. If you've installed those
|
13
|
+
libraries under some other directory (for example, in your home directory)
|
14
|
+
you might need to pass some additional arguments on the command line, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">sudo gem install fxruby-1.2.2.gem --force -- --with-fox-include=/home/lyle/include/fox-1.2 --with-fox-lib=/home/lyle/lib</b></pre></td></tr></table><p>If you're installing a source gem on a Windows box, you'd
|
15
|
+
instead type something like:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">C:\> <b class="command">gem install fxruby-1.2.2.gem --force -- --with-fox-include=C:\include\fox-1.2 --with-fox-lib=C:\lib</b></pre></td></tr></table><p>If you're installing a source gem, it can take quite awhile to
|
16
|
+
build FXRuby, so this might be a good time to take a coffee break. You
|
17
|
+
won't see any compiler output appear on the screen while the gem is
|
18
|
+
compiling, but rest assured that the output is being saved into the
|
19
19
|
<tt class="filename">gem_make.out</tt> file.</p><p>As a quick sanity check, to make sure that all is well, you should
|
20
20
|
probably fire up <tt class="filename">irb</tt> and try to require the FXRuby
|
21
21
|
gem once the installation is complete:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">irb</b>
|
22
22
|
irb(main):001:0> <b class="userinput"><tt><b class="command">require 'rubygems'</b></tt></b>
|
23
|
-
|
24
|
-
irb(main):002:0> <b class="command">
|
23
|
+
trues
|
24
|
+
irb(main):002:0> <b class="command">require 'fox12'</b>
|
25
25
|
true</pre></td></tr></table><p>If the import failed (usually with a message along the lines of
|
26
|
-
"Cannot load library"), first check the "Things That Can Go
|
27
|
-
of this chapter. If that doesn't help, drop me an
|
28
|
-
the Ruby newsgroup or mailing list; it's quite
|
29
|
-
has run into this problem too. Once you do have a
|
30
|
-
installation, you're ready to check out the example
|
26
|
+
"Cannot load library"), first check the "Things That Can Go
|
27
|
+
Wrong" section of this chapter. If that doesn't help, drop me an
|
28
|
+
e-mail or ask around on the Ruby newsgroup or mailing list; it's quite
|
29
|
+
likely that someone else has run into this problem too. Once you do have a
|
30
|
+
working FXRuby installation, you're ready to check out the example
|
31
|
+
programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e507"></a>Installing from a Binary Gem</h2></div></div><div></div></div><p>To install a binary gem for Windows, just type:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">C:\> <b class="command">gem install fxruby-1.2.2-mswin32.gem</b></pre></td></tr></table><p>As a quick sanity check, to make sure that all is well, you should
|
31
32
|
probably fire up <tt class="filename">irb</tt> and try to require the FXRuby
|
32
33
|
gem once the installation is complete:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">C:\> <b class="command">irb</b>
|
33
34
|
irb(main):001:0> <b class="userinput"><tt><b class="command">require 'rubygems'</b></tt></b>
|
34
35
|
true
|
35
|
-
irb(main):002:0> <b class="command">
|
36
|
+
irb(main):002:0> <b class="command">require 'fox12s'</b>
|
36
37
|
true</pre></td></tr></table><p>If the import failed (usually with a message along the lines of
|
37
|
-
"Cannot load library"), first check the "Things That Can Go
|
38
|
-
of this chapter. If that doesn't help, drop me an
|
39
|
-
the Ruby newsgroup or mailing list; it's quite
|
40
|
-
has run into this problem too. Once you do have a
|
41
|
-
installation, you're ready to check out the example
|
42
|
-
|
43
|
-
<tt class="filename">libFOX-1.2.so</tt>.
|
44
|
-
FXRuby are compiled, the last step is to
|
45
|
-
files together with the FOX library (and
|
46
|
-
to produce a new shared object that Ruby
|
47
|
-
module.</p><p>There are a few things that can go wrong when you try to import this
|
38
|
+
"Cannot load library"), first check the "Things That Can Go
|
39
|
+
Wrong" section of this chapter. If that doesn't help, drop me an
|
40
|
+
e-mail or ask around on the Ruby newsgroup or mailing list; it's quite
|
41
|
+
likely that someone else has run into this problem too. Once you do have a
|
42
|
+
working FXRuby installation, you're ready to check out the example
|
43
|
+
programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e535"></a>Things That Can Go Wrong</h2></div></div><div></div></div><p><span class="emphasis"><em>"Cannot load library"</em></span></p><p>On Linux and other Unix systems that support shared libraries, FOX
|
44
|
+
is typically installed as a shared library named <tt class="filename">libFOX-1.2.so</tt>.
|
45
|
+
After all of the source files for FXRuby are compiled, the last step is to
|
46
|
+
link all of the FXRuby object files together with the FOX library (and
|
47
|
+
possibly other system libraries) to produce a new shared object that Ruby
|
48
|
+
can import as an extension module.</p><p>There are a few things that can go wrong when you try to import this
|
48
49
|
extension into Ruby. A common problem is that the operating system cannot
|
49
50
|
locate the FOX shared library (<tt class="filename">libFOX-1.2.so</tt>) when it
|
50
51
|
tries to dynamically load the FXRuby extension module; when this happens,
|
@@ -56,18 +57,17 @@ LoadError: libFOX-0.99.so.173: cannot open shared object file: No such file or d
|
|
56
57
|
</pre></td></tr></table><p>Note that the wording of this error message may be slightly
|
57
58
|
different, depending on your operating environment. One workaround for
|
58
59
|
this problem is to modify the <tt class="constant">LD_LIBRARY_PATH</tt>
|
59
|
-
environment variable to include the directory where
|
60
|
-
<tt class="filename">libFOX-1.2.so</tt> is
|
61
|
-
|
60
|
+
environment variable to include the directory where <tt class="filename">libFOX-1.2.so</tt>
|
61
|
+
is installed. For example, if <tt class="filename">libFOX-1.2.so</tt> is
|
62
|
+
installed in <tt class="filename">/usr/local/lib</tt>, try
|
63
|
+
setting:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">export LD_LIBRARY_PATH=/usr/local/lib</b>
|
62
64
|
$ <b class="command">irb</b>
|
63
65
|
irb(main):001:0> <b class="userinput"><tt>require 'fox'</tt></b>
|
64
66
|
</pre></td></tr></table><p>If this works, you can of course permanently add the
|
65
67
|
<tt class="constant">LD_LIBRARY_PATH</tt> setting to your login file(s) so that
|
66
68
|
you don't have to remember to type it each time. Another approach that
|
67
|
-
should work for Linux is to modify your
|
68
|
-
<tt class="filename">/
|
69
|
-
|
70
|
-
|
71
|
-
directory where <tt class="filename">libFOX.so</tt> is installed;
|
72
|
-
and,</p></li><li><p>At the shell prompt, type <b class="command">ldconfig</b> to reload
|
69
|
+
should work for Linux is to modify your <tt class="filename">/etc/ld.so.conf</tt>
|
70
|
+
file to include the installation directory (e.g. <tt class="filename">/usr/local/lib</tt>).
|
71
|
+
If you'd like to do this instead, you'll need to (as root):</p><div class="orderedlist"><ol type="1" compact><li><p>Edit your <tt class="filename">/etc/ld.so.conf</tt> file and add the
|
72
|
+
directory where <tt class="filename">libFOX.so</tt> is installed; and,</p></li><li><p>At the shell prompt, type <b class="command">ldconfig</b> to reload
|
73
73
|
the linker configuration.</p></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="build.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial1.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Building from Source Code </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Hello, World!</td></tr></table></div></body></html>
|
data/doc/implementation.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>Appendix E. Implementation</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="library.html" title="Appendix D. The FXRuby Standard Library"><link rel="next" href="apes02.html" title="Object Life Cycles and Garbage Collection"></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 E. Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="library.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="apes02.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="implementation"></a>Appendix E. Implementation</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="implementation.html#
|
3
|
+
<title>Appendix E. Implementation</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="library.html" title="Appendix D. The FXRuby Standard Library"><link rel="next" href="apes02.html" title="Object Life Cycles and Garbage Collection"></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 E. Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="library.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="apes02.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="implementation"></a>Appendix E. Implementation</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3734"></a>Code Generation</h2></div></div><div></div></div><p>The development and maintenance of FXRuby would be almost impossible
|
4
4
|
without the help of Dave Beazley's excellent
|
5
5
|
<a href="http://www.swig.org" target="_top">SWIG</a>. The complete set of SWIG
|
6
6
|
interface files used to generate FXRuby is included in the standard
|
data/doc/library.html
CHANGED
@@ -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 D. The FXRuby Standard Library</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="differences.html" title="Appendix C. Differences between FOX and FXRuby"><link rel="next" href="implementation.html" title="Appendix E. 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 D. The FXRuby Standard Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="differences.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <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 D. The FXRuby Standard Library</h2></div></div><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="
|
3
|
+
<title>Appendix D. The FXRuby Standard Library</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="differences.html" title="Appendix C. Differences between FOX and FXRuby"><link rel="next" href="implementation.html" title="Appendix E. 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 D. The FXRuby Standard Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="differences.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <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 D. The FXRuby Standard Library</h2></div></div><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="d0e3596"></a>Undoable Commands</h2></div></div><div></div></div><p>The <tt class="filename">fox/undolist.rb</tt> file provides the <tt class="classname">FXCommand</tt> and <tt class="classname">FXUndoList</tt> classes. These serve the same purpose as the <tt class="classname">FXCommand</tt> and <tt class="classname">FXUndoList</tt> 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 <tt class="filename">fox/undolist.rb</tt>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3621"></a>Aliases</h2></div></div><div></div></div><p>The <tt class="filename">fox/aliases.rb</tt> implements most of the accessor-style aliases for methods. This file is loaded automatically when you </p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox'</pre></td></tr></table><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="d0e3632"></a>Color Names</h2></div></div><div></div></div><p>The <tt class="filename">fox/colors.rb</tt> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><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></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
8
|
+
dc.background = FXColor::MidnightBlue # instead of FXRGB( 25, 25, 112)</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3642"></a>OpenGL Shapes</h2></div></div><div></div></div><p>The <tt class="filename">fox/glshapes.rb</tt> library provides Ruby
|
9
9
|
implementations of a number of basic 3-D shapes (all derived from the
|
10
10
|
built-in <tt class="classname">FXGLShape</tt> class) that can be used with
|
11
11
|
the <tt class="classname">FXGLViewer</tt>. Several of these shapes are used
|
12
12
|
in the <tt class="filename">glviewer.rb</tt> 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="
|
15
|
+
this library instead.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3659"></a>Iterators</h2></div></div><div></div></div><p>The <tt class="filename">fox/iterators.rb</tt> library just adds an
|
16
16
|
<tt class="methodname">each</tt> instance method for the <tt class="classname">
|
17
17
|
FXComboBox</tt>, <tt class="classname">FXGLGroup</tt>, <tt class="classname">
|
18
18
|
FXHeader</tt>, <tt class="classname">FXIconList</tt>, <tt class="classname">
|
@@ -21,10 +21,10 @@ dc.background = FXColor::MidnightBlue # instead of FXRGB( 25, 25, 112)</pre><
|
|
21
21
|
FXTreeList</tt> and <tt class="classname">FXTreeListBox</tt> classes,
|
22
22
|
so that you can iterate over their members in a Ruby-friendly way. It
|
23
23
|
also mixes the <tt class="classname">Enumerable</tt> 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="
|
24
|
+
these classes.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3703"></a>Key Codes</h2></div></div><div></div></div><p>The <tt class="filename">fox/keys.rb</tt> library file defines all of the
|
25
25
|
key codes (e.g. <tt class="constant">KEY_space</tt>) that might show up in the
|
26
26
|
code field of an <tt class="classname">FXEvent</tt> instance. This file is
|
27
27
|
loaded automatically when you
|
28
28
|
</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox'</pre></td></tr></table><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="
|
30
|
+
directly.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3720"></a>Calendar Widget</h2></div></div><div></div></div><p>The <tt class="filename">fox/calendar.rb</tt> library file provides the <tt class="classname">FXCalendar</tt> 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> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="implementation.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix C. Differences between FOX and FXRuby </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix E. Implementation</td></tr></table></div></body></html>
|
data/doc/opengl.html
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
widgets, and FXRuby in turn provides interfaces to those classes. By
|
6
6
|
combining FXRuby with the OpenGL interface for Ruby (described below) you
|
7
7
|
can develop very powerful 3-D graphics applications. This chapter gives
|
8
|
-
you the information you'll need to get started.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
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="d0e2739"></a>What is OpenGL?</h2></div></div><div></div></div><p>OpenGL is a platform-independent API for 2D and 3D graphics. The
|
9
9
|
home page is <a href="http://www.opengl.org" target="_top">http://www.opengl.org</a>. Because it's a
|
10
10
|
fairly open standard, highly optimized OpenGL drivers are available for
|
11
|
-
most operating systems (including Windows and Linux).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
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="d0e2747"></a>OpenGL Extensions for Ruby</h2></div></div><div></div></div><p>This extension module, developed by Yoshiyuki Kusano, provides
|
12
12
|
interfaces to not only the basic OpenGL API, but also the GLU and GLUT
|
13
13
|
APIs. As of this writing, the currently released version is 0.32d and is
|
14
14
|
available for download from <a href="http://www2.giganet.net/~yoshi/rbogl-0.32b.tgz" target="_top">http://www2.giganet.net/~yoshi/rbogl-0.32d.tgz</a>.
|
@@ -25,7 +25,7 @@
|
|
25
25
|
extensions by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">$ <b class="command">make site-install</b></pre></td></tr></table><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="
|
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="d0e2802"></a>The FXGLVisual Class</h2></div></div><div></div></div><p>An <tt class="classname">FXGLVisual</tt> object describes the
|
29
29
|
capabilities of an <tt class="classname">FXGLCanvas</tt> or
|
30
30
|
<tt class="classname">FXGLViewer</tt> window. Typically, an X server supports
|
31
31
|
many different visuals with varying capabilities, but the ones with
|
@@ -58,13 +58,13 @@ end</pre></td></tr></table><p>Some <tt class="classname">FXGLVisual</tt> object
|
|
58
58
|
separate <tt class="classname">FXGLVisual</tt> object for each window. For
|
59
59
|
most applications, you can just construct a single
|
60
60
|
<tt class="classname">FXGLVisual</tt> 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="
|
61
|
+
OpenGL windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2861"></a>The FXGLCanvas Class</h2></div></div><div></div></div><p>The <tt class="classname">FXGLCanvas</tt> widget provides a very simple
|
62
62
|
OpenGL-capable window with minimal functionality. To construct an
|
63
63
|
<tt class="classname">FXGLCanvas</tt>, call
|
64
64
|
<tt class="methodname">FXGLCanvas.new</tt>:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">glCanvas = FXGLCanvas.new(parent, vis)</pre></td></tr></table><p>The first argument to <tt class="methodname">FXGLCanvas.new</tt> is the
|
65
65
|
parent (container) widget and the second argument is the
|
66
66
|
<tt class="classname">FXGLVisual</tt> 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="
|
67
|
+
window.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2885"></a>OpenGL objects and the FXGLViewer</h2></div></div><div></div></div><p>The <tt class="classname">FXGLViewer</tt> widget provides a higher-level
|
68
68
|
OpenGL-capable window with a lot of built-in functionality. To construct
|
69
69
|
an <tt class="classname">FXGLViewer</tt>, call
|
70
70
|
<tt class="methodname">FXGLViewer.new</tt>:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">glViewer = FXGLViewer.new(parent, vis)</pre></td></tr></table><p>The first argument to <tt class="methodname">FXGLViewer.new</tt> is the
|
data/doc/pt02.html
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Part II. Appendices</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="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="previous" href="changes.html" title="Chapter 10. Change History"><link rel="next" href="opengl.html" title="Appendix A. 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 II. Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <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="
|
3
|
+
<title>Part II. Appendices</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="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="previous" href="changes.html" title="Chapter 10. Change History"><link rel="next" href="opengl.html" title="Appendix A. 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 II. Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <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="d0e2724"></a>Appendices</h1></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><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></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> </td><td width="20%" align="center"><a accesskey="u" href="book.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="opengl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 10. Change History </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. Using OpenGL with FXRuby</td></tr></table></div></body></html>
|
data/doc/scintilla.html
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix B. Using Scintilla 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="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" href="opengl.html" title="Appendix A. Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix C. 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 B. Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <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 B. Using Scintilla with FXRuby</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
3
|
+
<title>Appendix B. Using Scintilla 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="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" href="opengl.html" title="Appendix A. Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix C. 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 B. Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <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 B. Using Scintilla with FXRuby</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2912"></a>What is Scintilla?</h2></div></div><div></div></div><p><a href="http://www.scintilla.org" target="_top">Scintilla</a> is a free
|
4
4
|
source code editing component developed by Neil Hodgson for the Win32 and
|
5
|
-
GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
5
|
+
GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2919"></a>What is FXScintilla?</h2></div></div><div></div></div><p><a href="http://savannah.gnu.org/projects/fxscintilla" target="_top">FXScintilla </a> is
|
6
6
|
a FOX widget that wraps around the Scintilla component, or, if you wish,
|
7
7
|
the FOX "port" of Scintilla. It is being developed by Gilles Filippini,
|
8
8
|
and as of this writing the latest release is available for download from
|
9
|
-
<a href="http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.61.tar.gz" target="_top">http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.61.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
9
|
+
<a href="http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.61.tar.gz" target="_top">http://savannah.nongnu.org/download/fxscintilla/fxscintilla-1.61.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2929"></a>Compiling FXScintilla</h2></div></div><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
|
<tt class="filename">INSTALL</tt> 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="
|
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="d0e2942"></a>Enabling FXScintilla Support in FXRuby</h2></div></div><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 <tt class="filename">/usr/include</tt> or <tt class="filename">/usr/local/include</tt>), the regular FXRuby build
|
data/examples/browser.rb
CHANGED
@@ -90,7 +90,7 @@ class BrowserWindow < FXMainWindow
|
|
90
90
|
LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
|
91
91
|
|
92
92
|
# Create the empty tree list
|
93
|
-
@treeList = FXTreeList.new(frame,
|
93
|
+
@treeList = FXTreeList.new(frame, nil, 0,
|
94
94
|
(TREELIST_BROWSESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|
|
95
95
|
TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y))
|
96
96
|
@treeList.connect(SEL_COMMAND) do |sender, sel, item|
|
data/examples/button.rb
CHANGED
@@ -57,61 +57,77 @@ class ButtonWindow < FXMainWindow
|
|
57
57
|
|
58
58
|
group1 = FXGroupBox.new(controls, "Horizontal Placement",
|
59
59
|
GROUPBOX_TITLE_CENTER|FRAME_RIDGE)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
(@button.iconPosition & ~ICON_AFTER_TEXT) & ~ICON_BEFORE_TEXT
|
60
|
+
@group1_dt = FXDataTarget.new(2)
|
61
|
+
@group1_dt.connect(SEL_COMMAND) {
|
62
|
+
case @group1_dt.value
|
63
|
+
when 0
|
64
|
+
@button.iconPosition = (@button.iconPosition|ICON_BEFORE_TEXT) & ~ICON_AFTER_TEXT
|
65
|
+
when 1
|
66
|
+
@button.iconPosition = (@button.iconPosition|ICON_AFTER_TEXT) & ~ICON_BEFORE_TEXT
|
67
|
+
when 2
|
68
|
+
@button.iconPosition = (@button.iconPosition & ~ICON_AFTER_TEXT) & ~ICON_BEFORE_TEXT
|
69
|
+
end
|
71
70
|
}
|
71
|
+
FXRadioButton.new(group1, "Before Text", @group1_dt, FXDataTarget::ID_OPTION)
|
72
|
+
FXRadioButton.new(group1, "After Text", @group1_dt, FXDataTarget::ID_OPTION + 1)
|
73
|
+
FXRadioButton.new(group1, "Centered", @group1_dt, FXDataTarget::ID_OPTION + 2)
|
72
74
|
|
73
75
|
group2 = FXGroupBox.new(controls, "Vertical Placement",
|
74
76
|
GROUPBOX_TITLE_CENTER|FRAME_RIDGE)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
(@button.iconPosition & ~ICON_ABOVE_TEXT) & ~ICON_BELOW_TEXT
|
77
|
+
@group2_dt = FXDataTarget.new(2)
|
78
|
+
@group2_dt.connect(SEL_COMMAND) {
|
79
|
+
case @group2_dt.value
|
80
|
+
when 0
|
81
|
+
@button.iconPosition = (@button.iconPosition|ICON_ABOVE_TEXT) & ~ICON_BELOW_TEXT
|
82
|
+
when 1
|
83
|
+
@button.iconPosition = (@button.iconPosition|ICON_BELOW_TEXT) & ~ICON_ABOVE_TEXT
|
84
|
+
when 2
|
85
|
+
@button.iconPosition = (@button.iconPosition & ~ICON_ABOVE_TEXT) & ~ICON_BELOW_TEXT
|
86
|
+
end
|
86
87
|
}
|
88
|
+
FXRadioButton.new(group2, "Above Text", @group2_dt, FXDataTarget::ID_OPTION)
|
89
|
+
FXRadioButton.new(group2, "Below Text", @group2_dt, FXDataTarget::ID_OPTION + 1)
|
90
|
+
FXRadioButton.new(group2, "Centered", @group2_dt, FXDataTarget::ID_OPTION + 2)
|
87
91
|
|
88
92
|
group3 = FXGroupBox.new(controls, "Horizontal Justification",
|
89
93
|
GROUPBOX_TITLE_CENTER|FRAME_RIDGE)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
94
|
+
@group3_dt = FXDataTarget.new(0)
|
95
|
+
@group3_dt.connect(SEL_COMMAND) {
|
96
|
+
case @group3_dt.value
|
97
|
+
when 0
|
98
|
+
@button.justify &= ~JUSTIFY_HZ_APART
|
99
|
+
when 1
|
100
|
+
@button.justify = (@button.justify & ~JUSTIFY_HZ_APART) | JUSTIFY_LEFT
|
101
|
+
when 2
|
102
|
+
@button.justify = (@button.justify & ~JUSTIFY_HZ_APART) | JUSTIFY_RIGHT
|
103
|
+
when 3
|
104
|
+
@button.justify |= JUSTIFY_HZ_APART
|
105
|
+
end
|
101
106
|
}
|
107
|
+
FXRadioButton.new(group3, "Center", @group3_dt, FXDataTarget::ID_OPTION)
|
108
|
+
FXRadioButton.new(group3, "Left", @group3_dt, FXDataTarget::ID_OPTION + 1)
|
109
|
+
FXRadioButton.new(group3, "Right", @group3_dt, FXDataTarget::ID_OPTION + 2)
|
110
|
+
FXRadioButton.new(group3, "Apart", @group3_dt, FXDataTarget::ID_OPTION + 3)
|
102
111
|
|
103
112
|
group4 = FXGroupBox.new(controls, "Vertical Justification",
|
104
113
|
GROUPBOX_TITLE_CENTER|FRAME_RIDGE)
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
114
|
+
@group4_dt = FXDataTarget.new(0)
|
115
|
+
@group4_dt.connect(SEL_COMMAND) {
|
116
|
+
case @group4_dt.value
|
117
|
+
when 0
|
118
|
+
@button.justify &= ~JUSTIFY_VT_APART
|
119
|
+
when 1
|
120
|
+
@button.justify = (@button.justify & ~JUSTIFY_VT_APART) | JUSTIFY_TOP
|
121
|
+
when 2
|
122
|
+
@button.justify = (@button.justify & ~JUSTIFY_VT_APART) | JUSTIFY_BOTTOM
|
123
|
+
when 3
|
124
|
+
@button.justify |= JUSTIFY_VT_APART
|
125
|
+
end
|
113
126
|
}
|
114
|
-
FXRadioButton.new(group4, "
|
127
|
+
FXRadioButton.new(group4, "Center", @group4_dt, FXDataTarget::ID_OPTION)
|
128
|
+
FXRadioButton.new(group4, "Top", @group4_dt, FXDataTarget::ID_OPTION + 1)
|
129
|
+
FXRadioButton.new(group4, "Bottom", @group4_dt, FXDataTarget::ID_OPTION + 2)
|
130
|
+
FXRadioButton.new(group4, "Apart", @group4_dt, FXDataTarget::ID_OPTION + 3)
|
115
131
|
|
116
132
|
quitButton = FXButton.new(controls, "&Quit", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X)
|
117
133
|
quitButton.connect(SEL_COMMAND) {
|
@@ -119,10 +135,6 @@ class ButtonWindow < FXMainWindow
|
|
119
135
|
}
|
120
136
|
end
|
121
137
|
|
122
|
-
def onCmdJustVerApart(sender, sel, ptr)
|
123
|
-
@button.justify |= JUSTIFY_VT_APART
|
124
|
-
end
|
125
|
-
|
126
138
|
# Load the named icon from a file
|
127
139
|
def loadIcon(filename)
|
128
140
|
begin
|
@@ -143,7 +155,7 @@ class ButtonWindow < FXMainWindow
|
|
143
155
|
end
|
144
156
|
end
|
145
157
|
|
146
|
-
|
158
|
+
if __FILE__ == $0
|
147
159
|
# Construct an application
|
148
160
|
application = FXApp.new("Button", "FoxTest")
|
149
161
|
|
@@ -157,4 +169,3 @@ def run
|
|
157
169
|
application.run
|
158
170
|
end
|
159
171
|
|
160
|
-
run
|
data/examples/groupbox.rb
CHANGED
@@ -261,15 +261,16 @@ class GroupWindow < FXMainWindow
|
|
261
261
|
FXArrowButton.new(vframe2, nil, 0, (LAYOUT_FILL_X|LAYOUT_FILL_Y|
|
262
262
|
FRAME_RAISED|FRAME_THICK|ARROW_RIGHT|ARROW_TOOLBAR))
|
263
263
|
|
264
|
+
gp_datatarget = FXDataTarget.new(0)
|
264
265
|
gp = FXGroupBox.new(group3, "Group Box",
|
265
266
|
LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
|
266
|
-
FXRadioButton.new(gp, "Hilversum &1",
|
267
|
+
FXRadioButton.new(gp, "Hilversum &1", gp_datatarget, FXDataTarget::ID_OPTION+0,
|
267
268
|
ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
|
268
|
-
FXRadioButton.new(gp, "Hilversum &2",
|
269
|
+
FXRadioButton.new(gp, "Hilversum &2", gp_datatarget, FXDataTarget::ID_OPTION+1,
|
269
270
|
ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
|
270
|
-
FXRadioButton.new(gp, "One multi-line\nRadiobox Widget",
|
271
|
+
FXRadioButton.new(gp, "One multi-line\nRadiobox Widget", gp_datatarget, FXDataTarget::ID_OPTION+2,
|
271
272
|
JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
|
272
|
-
FXRadioButton.new(gp, "Radio Stad Amsterdam",
|
273
|
+
FXRadioButton.new(gp, "Radio Stad Amsterdam", gp_datatarget, FXDataTarget::ID_OPTION+3,
|
273
274
|
ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
|
274
275
|
|
275
276
|
vv = FXGroupBox.new(group3, "Group Box",
|
data/examples/ratio.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# ratio.rb
|
3
|
+
# Translated from FOX C++ version to Ruby (Dec 2004) by Brett Hallett.
|
4
|
+
# Demonstrates the use of the FXSpring method to retain size ratios between widgets when form is resized.
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'fox12'
|
8
|
+
require 'fox12/colors'
|
9
|
+
|
10
|
+
include Fox
|
11
|
+
|
12
|
+
class MainWindow < FXMainWindow
|
13
|
+
|
14
|
+
def initialize(app)
|
15
|
+
# Initialize base class first
|
16
|
+
super(app, 'Ratio', nil, nil, DECOR_ALL, 0, 0, 400, 200, 8, 8, 8, 8, 6, 6)
|
17
|
+
|
18
|
+
# Add quit button and connect it to application
|
19
|
+
FXButton.new(self, "&Quit", nil, app, FXApp::ID_QUIT, FRAME_RAISED|FRAME_THICK|LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 2, 2)
|
20
|
+
|
21
|
+
# Label above it
|
22
|
+
FXLabel.new(self, "FXSpring can be used to keep widgets at fixed size ratios.\n\nResize the window to see how it behaves!", nil, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
23
|
+
|
24
|
+
# Layout manager to place the springs
|
25
|
+
horz = FXHorizontalFrame.new(self, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
26
|
+
|
27
|
+
# First spring is set to behave normally in Y direction,
|
28
|
+
# but to have a ratio 1 for the X direction
|
29
|
+
FXSpring.new(horz, LAYOUT_FILL_X|LAYOUT_FILL_Y, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0) do |spring1|
|
30
|
+
FXLabel.new(spring1, "1", nil, LAYOUT_FILL_X|LAYOUT_FILL_Y) do |label1|
|
31
|
+
label1.backColor = FXColor::Red
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Second spring has ratio 2 in the X direction
|
36
|
+
FXSpring.new(horz, LAYOUT_FILL_X|LAYOUT_FILL_Y, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0) do |spring2|
|
37
|
+
FXLabel.new(spring2, "2", nil, LAYOUT_FILL_X|LAYOUT_FILL_Y) do |label2|
|
38
|
+
label2.backColor = FXColor::Green
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Third spring has ratio 3 in the X direction
|
43
|
+
FXSpring.new(horz, LAYOUT_FILL_X|LAYOUT_FILL_Y, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0) do |spring3|
|
44
|
+
FXLabel.new(spring3, "3", nil, LAYOUT_FILL_X|LAYOUT_FILL_Y) do |label3|
|
45
|
+
label3.backColor = FXColor::Blue
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def create
|
51
|
+
super
|
52
|
+
show(PLACEMENT_SCREEN)
|
53
|
+
end # create
|
54
|
+
|
55
|
+
end # class MainWindow
|
56
|
+
|
57
|
+
if __FILE__ == $0
|
58
|
+
# Construct an application
|
59
|
+
FXApp.new('Smithy', 'Max') do |theApp|
|
60
|
+
|
61
|
+
# Construct the main window
|
62
|
+
MainWindow.new(theApp)
|
63
|
+
|
64
|
+
# Create and show the application windows
|
65
|
+
theApp.create
|
66
|
+
|
67
|
+
# Run the application
|
68
|
+
theApp.run
|
69
|
+
end
|
70
|
+
end
|
data/examples/table.rb
CHANGED
@@ -145,7 +145,7 @@ class TableWindow < FXMainWindow
|
|
145
145
|
FRAME_RAISED|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
|
146
146
|
|
147
147
|
# Initialize the text fields' contents
|
148
|
-
oldnr, oldnc = @table.numRows, @table.
|
148
|
+
oldnr, oldnc = @table.numRows, @table.numColumns
|
149
149
|
rows.text = oldnr.to_s
|
150
150
|
cols.text = oldnc.to_s
|
151
151
|
|