fxruby 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/doc/apes02.html +6 -6
  2. data/doc/apes03.html +11 -11
  3. data/doc/book.html +1 -1
  4. data/doc/build.html +63 -63
  5. data/doc/ch03s02.html +7 -7
  6. data/doc/ch03s03.html +18 -18
  7. data/doc/ch03s04.html +11 -11
  8. data/doc/ch03s05.html +14 -14
  9. data/doc/ch04s02.html +14 -14
  10. data/doc/ch04s03.html +15 -15
  11. data/doc/ch04s04.html +28 -28
  12. data/doc/ch05s02.html +49 -49
  13. data/doc/ch05s03.html +8 -8
  14. data/doc/changes.html +263 -193
  15. data/doc/clipboardtut.html +57 -45
  16. data/doc/cvs.html +10 -10
  17. data/doc/differences.html +4 -4
  18. data/doc/dragdroptut.html +50 -50
  19. data/doc/events.html +11 -11
  20. data/doc/examples.html +48 -48
  21. data/doc/gems.html +37 -37
  22. data/doc/goals.html +4 -4
  23. data/doc/implementation.html +4 -4
  24. data/doc/infosources.html +6 -6
  25. data/doc/library.html +19 -19
  26. data/doc/opengl.html +31 -31
  27. data/doc/pt01.html +1 -1
  28. data/doc/pt02.html +1 -1
  29. data/doc/scintilla.html +15 -15
  30. data/doc/style.css +3 -0
  31. data/doc/todo.html +5 -5
  32. data/doc/tutorial1.html +34 -34
  33. data/doc/unicode.html +56 -0
  34. data/ext/fox16/dialogs_wrap.cpp +38 -14
  35. data/ext/fox16/frames_wrap.cpp +856 -22
  36. data/ext/fox16/fx3d_wrap.cpp +169 -144
  37. data/ext/fox16/icons_wrap.cpp +24 -6
  38. data/ext/fox16/image_wrap.cpp +24 -6
  39. data/ext/fox16/label_wrap.cpp +23 -8
  40. data/ext/fox16/markfuncs.cpp +8 -1
  41. data/ext/fox16/mdi_wrap.cpp +53 -23
  42. data/ext/fox16/menu_wrap.cpp +43 -19
  43. data/ext/fox16/scintilla_wrap.cpp +31 -7
  44. data/ext/fox16/table_wrap.cpp +31 -7
  45. data/ext/fox16/text_wrap.cpp +31 -7
  46. data/ext/fox16/treelist_wrap.cpp +300 -276
  47. data/ext/fox16/ui_wrap.cpp +385 -26
  48. data/lib/fox16/aliases.rb +3 -0
  49. data/lib/fox16/version.rb +1 -1
  50. data/rdoc-sources/FXFoldingList.rb +2 -2
  51. data/tests/TC_FXDirList.rb +1 -1
  52. data/tests/TC_FXGLViewer.rb +2 -0
  53. data/tests/TC_FXHeader.rb +1 -1
  54. data/tests/TC_FXIconList.rb +1 -1
  55. data/tests/TC_FXId.rb +1 -1
  56. data/tests/TC_FXList.rb +1 -1
  57. data/tests/TC_FXListBox.rb +1 -1
  58. data/tests/TC_FXMenuCommand.rb +0 -14
  59. data/tests/TC_FXTable.rb +0 -32
  60. data/tests/TC_FXTableItem.rb +1 -1
  61. data/tests/TC_FXTreeList.rb +1 -1
  62. data/tests/TC_FXTreeListBox.rb +1 -1
  63. metadata +5 -4
data/doc/ch05s02.html CHANGED
@@ -1,8 +1,8 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Drag Sources</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="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="previous" href="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="next" href="ch05s03.html" title="Putting It All Together"></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">Drag Sources</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;5.&nbsp;Drag and Drop</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch05s03.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="d0e1353"></a>Drag Sources</h2></div></div><div></div></div><p>As before, we're going to start by presenting a skeleton application
4
- consisting of a main window widget (a <tt class="classname">DragSource</tt>
5
- instance) that parents an <tt class="classname">FXCanvas</tt> widget:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
3
+ <title>Drag Sources</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="prev" href="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="next" href="ch05s03.html" title="Putting It All Together"></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">Drag Sources</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;5.&nbsp;Drag and Drop</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch05s03.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="d0e1353"></a>Drag Sources</h2></div></div></div><p>As before, we're going to start by presenting a skeleton application
4
+ consisting of a main window widget (a <code class="classname">DragSource</code>
5
+ instance) that parents an <code class="classname">FXCanvas</code> widget:</p><pre class="programlisting">require 'rubygems'
6
6
  require_gem 'fxruby'
7
7
 
8
8
  include Fox
@@ -45,22 +45,22 @@ if __FILE__ == $0
45
45
  end
46
46
  end
47
47
 
48
- </pre></td></tr></table><p>Since the main program (i.e. the part at the end) won't change for
48
+ </pre><p>Since the main program (i.e. the part at the end) won't change for
49
49
  the rest of the tutorial, I won't show that code anymore. Furthermore, the
50
- <tt class="classname">DragSource</tt> class has a few things in common with
51
- the <tt class="classname">DropSite</tt> class from the previous example,
52
- namely:</p><div class="itemizedlist"><ul type="disc"><li><p>We've defined a <tt class="constant">SEL_PAINT</tt> handler for the
50
+ <code class="classname">DragSource</code> class has a few things in common with
51
+ the <code class="classname">DropSite</code> class from the previous example,
52
+ namely:</p><div class="itemizedlist"><ul type="disc"><li><p>We've defined a <code class="constant">SEL_PAINT</code> handler for the
53
53
  canvas widget that just clears the canvas to its current background
54
54
  color; and,</p></li><li><p>The drag type for colors
55
- (<tt class="constant">FXWindow.colorType</tt>) is registered in the
56
- <tt class="classname">DragSource</tt>'s <tt class="methodname">create()</tt>
55
+ (<code class="constant">FXWindow.colorType</code>) is registered in the
56
+ <code class="classname">DragSource</code>'s <code class="methodname">create()</code>
57
57
  method.</p></li></ul></div><p>As before, you may want to run this basic version of the program to
58
58
  be sure that it's working properly so far. You should simply see an empty
59
59
  window with a red background.</p><p>Now for this application, we want a drag operation to begin when the
60
60
  user presses the left mouse button inside the canvas and starts "dragging"
61
61
  away from the canvas. So the first change we need to make is to add a
62
- handler for the <tt class="constant">SEL_LEFTBUTTONPRESS</tt> message from the
63
- canvas:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONPRESS) {
62
+ handler for the <code class="constant">SEL_LEFTBUTTONPRESS</code> message from the
63
+ canvas:</p><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONPRESS) {
64
64
  #
65
65
  # Capture (grab) the mouse when the button goes down, so that all future
66
66
  # mouse events will be reported to this widget, even if those events occur
@@ -72,32 +72,32 @@ end
72
72
  dragTypes = [FXWindow.colorType]
73
73
  @canvas.beginDrag(dragTypes)
74
74
  }
75
- </pre></td></tr></table><p>Note that there are usually two things you're going to want to do in
76
- the <tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler for a drag source.
77
- The first is to call <tt class="methodname">grab()</tt> on the window that
78
- acts as the drag source. Calling <tt class="methodname">grab()</tt>
75
+ </pre><p>Note that there are usually two things you're going to want to do in
76
+ the <code class="constant">SEL_LEFTBUTTONPRESS</code> handler for a drag source.
77
+ The first is to call <code class="methodname">grab()</code> on the window that
78
+ acts as the drag source. Calling <code class="methodname">grab()</code>
79
79
  "captures" the mouse in the sense that subsequent mouse motion events will
80
80
  be reported as if they occurred inside the grab window. This is important,
81
81
  since in our case we're going to be dragging from this window to some
82
82
  other window, possibly a window in a different application
83
83
  altogether.</p><p>The second thing you'll want to do in the
84
- <tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler for a drag source is to
85
- call <tt class="methodname">beginDrag()</tt>. This not only kicks the
84
+ <code class="constant">SEL_LEFTBUTTONPRESS</code> handler for a drag source is to
85
+ call <code class="methodname">beginDrag()</code>. This not only kicks the
86
86
  application into drag-and-drop mode, but also provides a way for you to
87
87
  inform the system about the formats of data (i.e. the drag types) that
88
88
  this drag source is able to provide. For this example, the drag source is
89
89
  just going to offer one drag type.</p><p>Since releasing the left mouse button should end the drag operation,
90
90
  it's important to also add a handler for the
91
- <tt class="constant">SEL_LEFTBUTTONRELEASE</tt> message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONRELEASE) {
91
+ <code class="constant">SEL_LEFTBUTTONRELEASE</code> message:</p><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONRELEASE) {
92
92
  @canvas.ungrab
93
93
  @canvas.endDrag
94
94
  }
95
- </pre></td></tr></table><p>This is pretty much the mirror image of our
96
- <tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler. We call
97
- <tt class="methodname">ungrab()</tt> to release the mouse capture, and
98
- <tt class="methodname">endDrag()</tt> to clean up the drag-and-drop
99
- state.</p><p>The next change is to add a <tt class="constant">SEL_MOTION</tt> handler,
100
- to handle mouse motion events during the drag operation:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_MOTION) { |sender, sel, event|
95
+ </pre><p>This is pretty much the mirror image of our
96
+ <code class="constant">SEL_LEFTBUTTONPRESS</code> handler. We call
97
+ <code class="methodname">ungrab()</code> to release the mouse capture, and
98
+ <code class="methodname">endDrag()</code> to clean up the drag-and-drop
99
+ state.</p><p>The next change is to add a <code class="constant">SEL_MOTION</code> handler,
100
+ to handle mouse motion events during the drag operation:</p><pre class="programlisting">@canvas.connect(SEL_MOTION) { |sender, sel, event|
101
101
  if @canvas.dragging?
102
102
  @canvas.handleDrag(event.root_x, event.root_y)
103
103
  unless @canvas.didAccept == DRAG_REJECT
@@ -107,39 +107,39 @@ end
107
107
  end
108
108
  end
109
109
  }
110
- </pre></td></tr></table><p>The <tt class="methodname">dragging?</tt> method returns true if we're
110
+ </pre><p>The <code class="methodname">dragging?</code> method returns true if we're
111
111
  in the middle of a drag-and-drop operation for the drag source window,
112
- i.e. after the call to <tt class="methodname">beginDrag()</tt> but before the
113
- call to <tt class="methodname">endDrag()</tt>. If we're not currently
112
+ i.e. after the call to <code class="methodname">beginDrag()</code> but before the
113
+ call to <code class="methodname">endDrag()</code>. If we're not currently
114
114
  processing a drag operation, we're not really interested in mouse motion
115
115
  events for the canvas.</p><p>If we <span class="emphasis"><em>are</em></span> processing a drag operation, however,
116
- we need to call <tt class="methodname">handleDrag()</tt> on the drag source
116
+ we need to call <code class="methodname">handleDrag()</code> on the drag source
117
117
  window. FOX uses this information to send drag-and-drop messages (such as
118
- <tt class="constant">SEL_DND_ENTER</tt>, <tt class="constant">SEL_DND_MOTION</tt>
119
- and <tt class="constant">SEL_DND_LEAVE</tt>) to the window that the mouse is
118
+ <code class="constant">SEL_DND_ENTER</code>, <code class="constant">SEL_DND_MOTION</code>
119
+ and <code class="constant">SEL_DND_LEAVE</code>) to the window that the mouse is
120
120
  currently over. Note that the coordinates passed to
121
- <tt class="methodname">handleDrag()</tt> are root window coordinates, and not
121
+ <code class="methodname">handleDrag()</code> are root window coordinates, and not
122
122
  window-local coordinates.</p><p>Another good thing to consider doing here is to change the shape of
123
123
  the cursor depending on the drop site's response to the drag-and-drop
124
124
  messages from the drag source. For this example, we change the drag cursor
125
125
  to one of FOX's built-in cursor shapes
126
- (<tt class="constant">DEF_SWATCH_CURSOR</tt>) if we get any response other than
127
- <tt class="constant">DRAG_REJECT</tt> from the drop site. If the drop site
126
+ (<code class="constant">DEF_SWATCH_CURSOR</code>) if we get any response other than
127
+ <code class="constant">DRAG_REJECT</code> from the drop site. If the drop site
128
128
  rejects this drag source's overtures, we instead change the drag cursor to
129
129
  a cursor that resembles a stop sign
130
- (<tt class="constant">DEF_DNDSTOP_CURSOR</tt>).</p><p>I've purposely avoided suggesting that you run the program for the
130
+ (<code class="constant">DEF_DNDSTOP_CURSOR</code>).</p><p>I've purposely avoided suggesting that you run the program for the
131
131
  last couple of changes, since until now there wasn't going to be any
132
132
  visual indication that anything interesting was happening. But now you
133
133
  should be able to run the application in its current state and see a few
134
134
  things.</p><p>A first test is to confirm that the cursor shape changes to the
135
135
  "stop" sign when you attempt to drag over some window that isn't willing
136
- to accept a drop of the <tt class="constant">FXWindow.colorType</tt> drag type.
136
+ to accept a drop of the <code class="constant">FXWindow.colorType</code> drag type.
137
137
  Start up one of the other FXRuby example programs (such as the
138
- <tt class="filename">scribble.rb</tt> example) alongside your drag source
138
+ <code class="filename">scribble.rb</code> example) alongside your drag source
139
139
  program, and then try "dragging" from the drag source's canvas onto the
140
140
  Scribble program's canvas. During the drag attempt, the cursor should
141
141
  maintain its shape as a "stop" sign since the canvas in the
142
- <tt class="filename">scribble.rb</tt> example isn't drop-enabled.</p><p>Your next test can confirm that the cursor shape changes to the
142
+ <code class="filename">scribble.rb</code> example isn't drop-enabled.</p><p>Your next test can confirm that the cursor shape changes to the
143
143
  "swatch" cursor (a small square) when you attempt to drag over a window
144
144
  that is drop-enabled, and which is willing to accepts drops of this drag
145
145
  type. The obvious choice is the example from the previous section (the
@@ -150,16 +150,16 @@ end
150
150
  over a drop-enabled window, the cursor should change its shape.</p><p>The last (and most important) step is to actually complete the data
151
151
  transfer. At any time during a drag-and-drop operation, a drop site may
152
152
  request a copy of the drag-and-drop data by calling the
153
- <tt class="methodname">getDNDData()</tt> method (as described in the previous
153
+ <code class="methodname">getDNDData()</code> method (as described in the previous
154
154
  section). When this happens, FOX sends a
155
- <tt class="constant">SEL_DND_REQUEST</tt> message to the current drag source
156
- window, and so we now add a handler for that message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_DND_REQUEST) { |sender, sel, event|
155
+ <code class="constant">SEL_DND_REQUEST</code> message to the current drag source
156
+ window, and so we now add a handler for that message:</p><pre class="programlisting">@canvas.connect(SEL_DND_REQUEST) { |sender, sel, event|
157
157
  if event.target == FXWindow.colorType
158
158
  @canvas.setDNDData(FROM_DRAGNDROP, FXWindow.colorType, Fox.fxencodeColorData(@canvas.backColor))
159
159
  end
160
160
  }
161
- </pre></td></tr></table><p>The first important thing to note here is that the
162
- <tt class="varname">target</tt> field of the <tt class="classname">FXEvent</tt>
161
+ </pre><p>The first important thing to note here is that the
162
+ <code class="varname">target</code> field of the <code class="classname">FXEvent</code>
163
163
  instance will contain the drag type requested by the drop site. If your
164
164
  drag source offers its data in multiple formats, you definitely need to
165
165
  check this in order to know how to package-up the data for transfer.
@@ -167,17 +167,17 @@ end
167
167
  this example) it's still a good idea to check the requested type, since a
168
168
  rogue drop site could ask for the data in some unexpected format.</p><p>Assuming that the drag type is as expected, the last step is send
169
169
  the data to the drop site by calling
170
- <tt class="methodname">setDNDData()</tt>. As with the call to
171
- <tt class="methodname">getDNDData()</tt> for our previous drop site program,
170
+ <code class="methodname">setDNDData()</code>. As with the call to
171
+ <code class="methodname">getDNDData()</code> for our previous drop site program,
172
172
  you want to be sure to specify the origin of the data
173
- (<tt class="constant">FROM_DRAGNDROP</tt>), the drag type
174
- (<tt class="constant">FXWindow.colorType</tt>) and the data itself as a binary
173
+ (<code class="constant">FROM_DRAGNDROP</code>), the drag type
174
+ (<code class="constant">FXWindow.colorType</code>) and the data itself as a binary
175
175
  string.</p><p>As a final test of the completed program, try dragging from this
176
176
  window to some drop-enabled window (as described earlier). Now, when you
177
177
  release the left mouse button to complete the "drop", the drop site should
178
178
  change its color to red.</p><p>The complete program is listed below, and is included in the
179
- <tt class="filename">examples</tt> directory under the file
180
- name <tt class="filename">dragsource.rb</tt>.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
179
+ <code class="filename">examples</code> directory under the file
180
+ name <code class="filename">dragsource.rb</code>.</p><pre class="programlisting">require 'rubygems'
181
181
  require_gem 'fxruby'
182
182
 
183
183
  include Fox
@@ -259,4 +259,4 @@ if __FILE__ == $0
259
259
  end
260
260
  end
261
261
 
262
- </pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;5.&nbsp;Drag and Drop&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Putting It All Together</td></tr></table></div></body></html>
262
+ </pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;5.&nbsp;Drag and Drop&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Putting It All Together</td></tr></table></div></body></html>
data/doc/ch05s03.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>Putting It All Together</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="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="previous" href="ch05s02.html" title="Drag Sources"><link rel="next" href="clipboardtut.html" title="Chapter&nbsp;6.&nbsp;Unicode 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">Putting It All Together</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;5.&nbsp;Drag and Drop</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="clipboardtut.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="d0e1547"></a>Putting It All Together</h2></div></div><div></div></div><p>We've studied drag-and-drop enabled applications from two points of
3
+ <title>Putting It All Together</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="dragdroptut.html" title="Chapter&nbsp;5.&nbsp;Drag and Drop"><link rel="prev" href="ch05s02.html" title="Drag Sources"><link rel="next" href="unicode.html" title="Chapter&nbsp;6.&nbsp;Unicode 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">Putting It All Together</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;5.&nbsp;Drag and Drop</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="unicode.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="d0e1547"></a>Putting It All Together</h2></div></div></div><p>We've studied drag-and-drop enabled applications from two points of
4
4
  view, that of a drag source and that of a drop site. But for most
5
5
  applications, you'll want a window to act as both a drag source
6
6
  <span class="emphasis"><em>and</em></span> a drop site. As it turns out, this is just a
@@ -8,11 +8,11 @@
8
8
  sections.</p><p>If we use our completed drag source example program from the
9
9
  previous section as a starting point, and then compare it to the drop site
10
10
  example from the first section, it is apparent that the only "pieces"
11
- missing are:</p><div class="itemizedlist"><ul type="disc"><li><p>A call to <tt class="methodname">dropEnable()</tt>, to make
12
- <tt class="classname">DragSource</tt>'s canvas drop-enabled;</p></li><li><p>A handler for the <tt class="constant">SEL_DND_MOTION</tt> message;
13
- and,</p></li><li><p>A handler for the <tt class="constant">SEL_DND_DROP</tt>
11
+ missing are:</p><div class="itemizedlist"><ul type="disc"><li><p>A call to <code class="methodname">dropEnable()</code>, to make
12
+ <code class="classname">DragSource</code>'s canvas drop-enabled;</p></li><li><p>A handler for the <code class="constant">SEL_DND_MOTION</code> message;
13
+ and,</p></li><li><p>A handler for the <code class="constant">SEL_DND_DROP</code>
14
14
  message.</p></li></ul></div><p>If you merge those three short bits of code from
15
- <tt class="filename">dropsite.rb</tt> into <tt class="filename">dragsource.rb</tt>,
15
+ <code class="filename">dropsite.rb</code> into <code class="filename">dragsource.rb</code>,
16
16
  you should end up with a program that can act as both a drag source and a
17
17
  drop site. To test this program, you should be able to start up two
18
18
  separate copies side-by-side and then drag from one to the other. Since,
@@ -22,8 +22,8 @@
22
22
  FXRuby example that has displays a color dialog) and drag colors back and
23
23
  forth between all three programs. You could spend days doing this and
24
24
  never leave the house.</p><p>The complete program is listed below, and is included in the
25
- <tt class="filename">examples</tt> directory under the file
26
- name <tt class="filename">dragdrop.rb</tt>.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
25
+ <code class="filename">examples</code> directory under the file
26
+ name <code class="filename">dragdrop.rb</code>.</p><pre class="programlisting">require 'rubygems'
27
27
  require_gem 'fxruby'
28
28
 
29
29
  include Fox
@@ -125,4 +125,4 @@ if __FILE__ == $0
125
125
  end
126
126
  end
127
127
 
128
- </pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="clipboardtut.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Drag Sources&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;6.&nbsp;Unicode and FXRuby</td></tr></table></div></body></html>
128
+ </pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="unicode.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Drag Sources&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;6.&nbsp;Unicode and FXRuby</td></tr></table></div></body></html>