fxruby 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/apes02.html +2 -2
- data/doc/apes03.html +1 -1
- data/doc/book.html +1 -1
- data/doc/changes.html +46 -11
- data/doc/cvs.html +2 -2
- data/doc/differences.html +3 -3
- 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/ext/fox14/core_wrap.cpp +49 -71
- data/ext/fox14/image_wrap.cpp +10 -2
- data/ext/fox14/table_wrap.cpp +1 -3
- data/lib/fox14/chore.rb +21 -5
- data/lib/fox14/scintilla.rb +808 -33
- data/lib/fox14/timeout.rb +36 -9
- data/lib/fox14/version.rb +1 -1
- data/rdoc-sources/FXApp.rb +0 -72
- data/rdoc-sources/FXImage.rb +4 -0
- data/rdoc-sources/FXTable.rb +7 -1
- data/rdoc-sources/FXToggleButton.rb +1 -0
- data/tests/TC_FXList.rb +11 -1
- data/tests/TS_All.rb +2 -1
- data/web/home.html +1 -0
- metadata +2 -2
data/lib/fox14/timeout.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'fox14'
|
2
|
+
require 'ostruct'
|
2
3
|
|
3
4
|
module Fox
|
5
|
+
|
4
6
|
class FXApp
|
5
7
|
|
6
8
|
alias addTimeoutOrig addTimeout # :nodoc:
|
9
|
+
alias removeTimeoutOrig removeTimeout # :nodoc:
|
10
|
+
alias remainingTimeoutOrig remainingTimeout # :nodoc:
|
7
11
|
|
8
12
|
#
|
9
13
|
# Register a timeout message to be sent to a target object;
|
@@ -19,7 +23,8 @@ module Fox
|
|
19
23
|
# target object and message identifier for the message to be sent when
|
20
24
|
# this timeout fires.
|
21
25
|
#
|
22
|
-
# A second form of #addTimeout takes a Method instance as its
|
26
|
+
# A second form of #addTimeout takes a Method instance as its second
|
27
|
+
# argument:
|
23
28
|
#
|
24
29
|
# anApp.addTimeout(aDelay, aMethod)
|
25
30
|
#
|
@@ -34,25 +39,47 @@ module Fox
|
|
34
39
|
# ... handle the chore ...
|
35
40
|
# }
|
36
41
|
#
|
37
|
-
# All of these return a reference to an
|
38
|
-
#
|
39
|
-
# before it fires.
|
42
|
+
# All of these return a reference to an object that can be passed to
|
43
|
+
# #removeTimeout if it is necessary to remove the timeout before it fires.
|
40
44
|
#
|
41
45
|
def addTimeout(ms, *args, &block)
|
42
|
-
tgt, sel = nil, 0
|
46
|
+
tgt, sel, ptr = nil, 0, nil
|
43
47
|
if args.length > 0
|
44
48
|
if args[0].respond_to? :call
|
45
49
|
tgt = FXPseudoTarget.new
|
46
50
|
tgt.pconnect(SEL_TIMEOUT, args[0], nil)
|
47
51
|
else # it's some other kind of object
|
48
|
-
tgt = args[0]
|
49
|
-
sel = args[1]
|
52
|
+
tgt, sel = args[0], args[1]
|
50
53
|
end
|
51
54
|
else
|
52
55
|
tgt = FXPseudoTarget.new
|
53
56
|
tgt.pconnect(SEL_TIMEOUT, nil, block)
|
54
57
|
end
|
55
|
-
addTimeoutOrig(tgt, sel, ms)
|
58
|
+
addTimeoutOrig(tgt, sel, ms, ptr)
|
59
|
+
OpenStruct.new({ "tgt" => tgt, "sel" => sel })
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Remove timeout.
|
64
|
+
#
|
65
|
+
def removeTimeout(timer)
|
66
|
+
removeTimeoutOrig(timer.tgt, timer.sel)
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# Return +true+ if given timeout has been set, otherwise return +false+.
|
71
|
+
#
|
72
|
+
def hasTimeout?(timer)
|
73
|
+
hasTimeout(timer.tgt, timer.sel)
|
74
|
+
end
|
75
|
+
|
76
|
+
#
|
77
|
+
# Return the time remaining (in milliseconds) until the given timer fires.
|
78
|
+
# If the timer is past due, zero is returned. If there is no such
|
79
|
+
# timer, infinity (UINT_MAX) is returned.
|
80
|
+
#
|
81
|
+
def remainingTimeout(timer)
|
82
|
+
remainingTimeoutOrig(timer.tgt, timer.sel)
|
56
83
|
end
|
57
84
|
end
|
58
|
-
end
|
85
|
+
end
|
data/lib/fox14/version.rb
CHANGED
data/rdoc-sources/FXApp.rb
CHANGED
@@ -287,83 +287,11 @@ module Fox
|
|
287
287
|
# Return true if the application has been initialized.
|
288
288
|
def initialized?; end
|
289
289
|
|
290
|
-
#
|
291
|
-
# Add timeout message to be sent to target object in _ms_ milliseconds;
|
292
|
-
# the timer fires only once after the interval expires. The last argument
|
293
|
-
# is optional user data which will be passed along as the _ptr_ argument of
|
294
|
-
# the message handler. If a timer with the same target and message already exists,
|
295
|
-
# it will be rescheduled.
|
296
|
-
#
|
297
|
-
# ==== Parameters:
|
298
|
-
#
|
299
|
-
# +ms+:: timeout interval, in milliseconds [Integer]
|
300
|
-
# +tgt+:: target object for the timeout [FXObject]
|
301
|
-
# +sel+:: message identifier for the timeout [Integer]
|
302
|
-
# +ptr+:: user data [Object]
|
303
|
-
#
|
304
|
-
def addTimeout(ms, tgt, sel, ptr=nil) ; end
|
305
|
-
|
306
|
-
#
|
307
|
-
# Remove timeout identified by _tgt_ and _sel_; returns +nil+.
|
308
|
-
#
|
309
|
-
# ==== Parameters:
|
310
|
-
#
|
311
|
-
# +tgt+:: target object for the timeout [FXObject]
|
312
|
-
# +sel+:: message identifier for the timeout [Integer]
|
313
|
-
#
|
314
|
-
def removeTimeout(tgt, sel); end
|
315
|
-
|
316
|
-
#
|
317
|
-
# Return +true+ if given timeout has been set, otherwise return +false+.
|
318
|
-
#
|
319
|
-
# ==== Parameters:
|
320
|
-
#
|
321
|
-
# +tgt+:: target object for the timeout [FXObject]
|
322
|
-
# +sel+:: message identifier for the timeout [Integer]
|
323
|
-
#
|
324
|
-
def hasTimeout?(tgt, sel); end
|
325
|
-
|
326
|
-
#
|
327
|
-
# Return the time remaining (in milliseconds) until the given timer fires.
|
328
|
-
# If the timer is past due, zero is returned. If there is no such
|
329
|
-
# timer, infinity (UINT_MAX) is returned.
|
330
|
-
#
|
331
|
-
# ==== Parameters:
|
332
|
-
#
|
333
|
-
# +tgt+:: target object for the timeout [FXObject]
|
334
|
-
# +sel+:: message identifier for the timeout [Integer]
|
335
|
-
#
|
336
|
-
def remainingTimeout(tgt, sel); end
|
337
|
-
|
338
290
|
#
|
339
291
|
# Process any timeouts due at this time.
|
340
292
|
#
|
341
293
|
def handleTimeouts(); end
|
342
294
|
|
343
|
-
#
|
344
|
-
# Add a idle processing message to be sent to target object when
|
345
|
-
# the system becomes idle, i.e. there are no events to be processed.
|
346
|
-
# The void* ptr is user data which will be passed into the void* ptr
|
347
|
-
# of the message handler. If a chore with the same target and message
|
348
|
-
# already exists, it will be rescheduled.
|
349
|
-
#
|
350
|
-
def addChore(tgt, sel, ptr=nil) ; end
|
351
|
-
|
352
|
-
#
|
353
|
-
# Remove idle processing message identified by _tgt_ and _sel_.
|
354
|
-
#
|
355
|
-
def removeChore(tgt, sel); end
|
356
|
-
|
357
|
-
#
|
358
|
-
# Return +true+ if given chore has been set, otherwise return +false+.
|
359
|
-
#
|
360
|
-
# ==== Parameters:
|
361
|
-
#
|
362
|
-
# +tgt+:: target object for the chore [FXObject]
|
363
|
-
# +sel+:: message identifier for the chore [Integer]
|
364
|
-
#
|
365
|
-
def hasChore?(tgt, sel); end
|
366
|
-
|
367
295
|
#
|
368
296
|
# Add signal processing message to be sent to target object when
|
369
297
|
# the signal _sig_ is raised; flags are to be set as per POSIX definitions.
|
data/rdoc-sources/FXImage.rb
CHANGED
@@ -67,6 +67,8 @@ module Fox
|
|
67
67
|
|
68
68
|
#
|
69
69
|
# Return the color of the pixel at (_x_, _y_).
|
70
|
+
# Raises RuntimeError if the client-side pixel buffer has already been
|
71
|
+
# released.
|
70
72
|
#
|
71
73
|
# ==== Parameters:
|
72
74
|
#
|
@@ -77,6 +79,8 @@ module Fox
|
|
77
79
|
|
78
80
|
#
|
79
81
|
# Set pixel at (_x_, _y_) to _clr_.
|
82
|
+
# Raises RuntimeError if the client-side pixel buffer has already been
|
83
|
+
# released.
|
80
84
|
#
|
81
85
|
# ==== Parameters:
|
82
86
|
#
|
data/rdoc-sources/FXTable.rb
CHANGED
@@ -529,8 +529,14 @@ module Fox
|
|
529
529
|
#
|
530
530
|
def clearItems(notify=false); end
|
531
531
|
|
532
|
+
#
|
532
533
|
# Scroll to make cell at (_row_, _column_) fully visible.
|
533
|
-
#
|
534
|
+
# If the input value for _row_ is out of bounds (i.e. is less than zero,
|
535
|
+
# or greater than or equal to the numbers of rows), the call to
|
536
|
+
# #makePositionVisible will have no effect on the horizontal position.
|
537
|
+
# Likewise, if the input value for _column_ is out of bounds,
|
538
|
+
# the call will have no effect on the vertical position.
|
539
|
+
#
|
534
540
|
def makePositionVisible(row, column) ; end
|
535
541
|
|
536
542
|
# Returns +true+ if the cell at position (_row_, _column_) is visible.
|
@@ -19,6 +19,7 @@ module Fox
|
|
19
19
|
# +TOGGLEBUTTON_AUTOGRAY+:: Automatically gray out when not updated
|
20
20
|
# +TOGGLEBUTTON_AUTOHIDE+:: Automatically hide toggle button when not updated
|
21
21
|
# +TOGGLEBUTTON_TOOLBAR+:: Toolbar style toggle button [flat look]
|
22
|
+
# +TOGGLEBUTTON_KEEPSTATE+:: Draw button according to state
|
22
23
|
# +TOGGLEBUTTON_NORMAL+:: <tt>FRAME_RAISED|FRAME_THICK|JUSTIFY_NORMAL|ICON_BEFORE_TEXT</tt>
|
23
24
|
#
|
24
25
|
class FXToggleButton < FXLabel
|
data/tests/TC_FXList.rb
CHANGED
@@ -7,7 +7,7 @@ include Fox
|
|
7
7
|
class TC_FXList < TestCase
|
8
8
|
def setup
|
9
9
|
super(self.class.name)
|
10
|
-
@list = FXList.new(mainWindow
|
10
|
+
@list = FXList.new(mainWindow)
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_numVisible
|
@@ -109,8 +109,18 @@ class TC_FXList < TestCase
|
|
109
109
|
assert_raises(IndexError) {
|
110
110
|
@list.makeItemVisible(-1)
|
111
111
|
}
|
112
|
+
items.each_index do |i|
|
113
|
+
assert_nothing_raised {
|
114
|
+
@list.makeItemVisible(i)
|
115
|
+
}
|
116
|
+
end
|
112
117
|
assert_raises(IndexError) {
|
113
118
|
@list.makeItemVisible(3)
|
114
119
|
}
|
120
|
+
items.each do |item|
|
121
|
+
assert_nothing_raised {
|
122
|
+
@list.makeItemVisible(item)
|
123
|
+
}
|
124
|
+
end
|
115
125
|
end
|
116
126
|
end
|
data/tests/TS_All.rb
CHANGED
@@ -7,7 +7,8 @@ class TS_All
|
|
7
7
|
Object.constants.sort.each do |k|
|
8
8
|
next if /^TC_/ !~ k
|
9
9
|
constant = Object.const_get(k)
|
10
|
-
|
10
|
+
# if constant.kind_of?(Class) && constant.superclass == Test::Unit::TestCase
|
11
|
+
if constant.kind_of?(Class)
|
11
12
|
# puts "adding tests for #{constant.to_s}"
|
12
13
|
suite << constant.suite
|
13
14
|
end
|
data/web/home.html
CHANGED
@@ -92,6 +92,7 @@ Projects using FXRuby include:
|
|
92
92
|
<li><a href="http://www.insula.cz/dbtalk" target=_top>DbTalk</a> is an interactive GUI-based tool for database querying, programming, administration, etc. It is developed by Dalibor Sramek.</li>
|
93
93
|
<li><a href="http://freeride.rubyforge.org/wiki/wiki.pl" target=_top>FreeRIDE</a> is an IDE for the Ruby programming language.</li>
|
94
94
|
<li><a href="http://www.fisica.uniud.it/~glast/FRED" target=_top>FRED</a> is a high energy physics event display built out of Ruby and FOX by Riccardo Giannitrapani and Marco Frailis.</li>
|
95
|
+
<li><a href="http://www.mondrian-ide.com/" target=_top>Mondrian</a> is a cross-platform project-manager and editor for the Ruby language. Written in 100% native Ruby using the FOX GUI toolkit, Mondrian has the familiar look and feel of a modern IDE while remaining dedicated to the uniqueness of the Ruby language and its community.</li>
|
95
96
|
</ul>
|
96
97
|
If your project uses FXRuby for its user interface, and you'd like to see it listed
|
97
98
|
here, please send me an e-mail with the information.
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
|
|
3
3
|
specification_version: 1
|
4
4
|
name: fxruby
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.4.
|
7
|
-
date: 2005-
|
6
|
+
version: 1.4.3
|
7
|
+
date: 2005-11-06
|
8
8
|
summary: FXRuby is the Ruby binding to the FOX GUI toolkit.
|
9
9
|
require_paths:
|
10
10
|
- ext/fox14
|