fxruby 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fox12/core.rb CHANGED
@@ -1,5 +1,31 @@
1
1
  module Fox
2
2
 
3
+ class FXCheckButton
4
+ #
5
+ # Return +true+ if the check state for this check button is +TRUE+,
6
+ # or +false+ if the check state is either +FALSE+ or +MAYBE+.
7
+ #
8
+ def checked?
9
+ self.check == TRUE
10
+ end
11
+
12
+ #
13
+ # Return +true+ if the check state for this check button is +FALSE+,
14
+ # or +false+ if the check state is either +TRUE+ or +MAYBE+.
15
+ #
16
+ def unchecked?
17
+ self.check == FALSE
18
+ end
19
+
20
+ #
21
+ # Return +true+ if the check state for this check button is +MAYBE+,
22
+ # or +false+ if the check state is either +TRUE+ or +FALSE+.
23
+ #
24
+ def maybe?
25
+ self.check == MAYBE
26
+ end
27
+ end
28
+
3
29
  class FXIconItem
4
30
  def <=>(otherItem)
5
31
  text <=> otherItem.text
@@ -66,6 +92,32 @@ module Fox
66
92
  end
67
93
  end
68
94
 
95
+ class FXMenuCheck
96
+ #
97
+ # Return +true+ if the check state for this menu check item is +TRUE+,
98
+ # or +false+ if the check state is either +FALSE+ or +MAYBE+.
99
+ #
100
+ def checked?
101
+ self.check == TRUE
102
+ end
103
+
104
+ #
105
+ # Return +true+ if the check state for this menu check item is +FALSE+,
106
+ # or +false+ if the check state is either +TRUE+ or +MAYBE+.
107
+ #
108
+ def unchecked?
109
+ self.check == FALSE
110
+ end
111
+
112
+ #
113
+ # Return +true+ if the check state for this menu check item is +MAYBE+,
114
+ # or +false+ if the check state is either +TRUE+ or +FALSE+.
115
+ #
116
+ def maybe?
117
+ self.check == MAYBE
118
+ end
119
+ end
120
+
69
121
  class FXScrollArea
70
122
  # Returns a reference to the scroll corner (an FXScrollCorner instance) for this window.
71
123
  def scrollCorner
data/lib/fox12/version.rb CHANGED
@@ -5,7 +5,7 @@ module Fox
5
5
  # Returns the FXRuby version number as a string, e.g. "1.0.19".
6
6
  #
7
7
  def Fox.fxrubyversion
8
- "1.2.5"
8
+ "1.2.6"
9
9
  end
10
10
  end
11
11
 
@@ -38,20 +38,5 @@ module Fox
38
38
  # Construct new check button
39
39
  def initialize(parent, text, target=nil, selector=0, opts=CHECKBUTTON_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theCheckButton
40
40
  end
41
-
42
- # Return +true+ if the check button state is +TRUE+
43
- def checked?
44
- self.check == TRUE
45
- end
46
-
47
- # Return +true+ if the check button state is +FALSE+
48
- def unchecked?
49
- self.check == FALSE
50
- end
51
-
52
- # Return +true+ if the check button state is +MAYBE+
53
- def maybe?
54
- self.check == MAYBE
55
- end
56
41
  end
57
42
  end
data/rdoc-sources/FXDC.rb CHANGED
@@ -193,7 +193,7 @@ module Fox
193
193
  attr_reader :clipHeight
194
194
 
195
195
  # Font to draw text with [FXFont]
196
- attr_accessor :textFont
196
+ attr_accessor :font
197
197
 
198
198
  # Construct dummy DC
199
199
  def initialize(app) ; end
@@ -311,7 +311,14 @@ module Fox
311
311
  def fontMono? ; end
312
312
 
313
313
  #
314
- # Return +true+ if font has glyph for _ch_.
314
+ # Return +true+ if font has glyph for _ch_. Here, _ch_ can either be an
315
+ # ordinal value, e.g.
316
+ #
317
+ # aFont.hasChar?(?a)
318
+ #
319
+ # or a string of length one (i.e. a single character), e.g.
320
+ #
321
+ # aFont.hasChar?('a')
315
322
  #
316
323
  def hasChar?(ch) ; end
317
324
 
@@ -23,8 +23,6 @@ module Fox
23
23
  # Dither image to look better
24
24
  # +IMAGE_NEAREST+::
25
25
  # Turn off dithering and map to nearest color
26
- # +IMAGE_ALPHA+::
27
- # Data has alpha channel
28
26
  # +IMAGE_OPAQUE+::
29
27
  # Force opaque background
30
28
  # +IMAGE_ALPHACOLOR+::
@@ -44,11 +44,11 @@ module Fox
44
44
  # Scroll style [Integer]
45
45
  attr_accessor :scrollStyle
46
46
 
47
- # Horizontal scrollbar [FXScrollbar]
48
- attr_reader :horizontalScrollbar
47
+ # Horizontal scrollbar [FXScrollBar]
48
+ attr_reader :horizontalScrollBar
49
49
 
50
- # Vertical scrollbar [FXScrollbar]
51
- attr_reader :verticalScrollbar
50
+ # Vertical scrollbar [FXScrollBar]
51
+ attr_reader :verticalScrollBar
52
52
 
53
53
  # Current x-position [Integer]
54
54
  attr_reader :xPosition
@@ -357,6 +357,9 @@ module Fox
357
357
 
358
358
  # Return item height
359
359
  def getItemHeight(item); end
360
+
361
+ # Return a reference to the tree item at (_x_, _y_), if any.
362
+ def getItemAt(x, y); end
360
363
 
361
364
  # Search items for item by _text_, starting from _startItem_; the
362
365
  # _flags_ argument controls the search direction, and case sensitivity.
data/tests/TC_FXFont.rb CHANGED
@@ -56,4 +56,14 @@ class TC_FXFont < Test::Unit::TestCase
56
56
  assert_instance_of(Array, fonts)
57
57
  assert(fonts.length > 0)
58
58
  end
59
+
60
+ def test_hasChar?
61
+ @app.normalFont.create
62
+ assert(@app.normalFont.hasChar('a'))
63
+ assert(@app.normalFont.hasChar(?a))
64
+ assert(@app.normalFont.hasChar?('a'))
65
+ assert(@app.normalFont.hasChar?(?a))
66
+ assert_raises(ArgumentError) { @app.normalFont.hasChar? "" }
67
+ assert_raises(ArgumentError) { @app.normalFont.hasChar? "ab" }
68
+ end
59
69
  end
@@ -0,0 +1,34 @@
1
+ require 'test/unit'
2
+ require 'fox12'
3
+ require 'testcase'
4
+
5
+ include Fox
6
+
7
+ class TC_FXSettings < TestCase
8
+
9
+ def setup
10
+ super(self.class.name)
11
+ end
12
+
13
+ def test_each_section_empty_settings
14
+ empty = FXSettings.new
15
+ num_sections = 0
16
+ empty.each_section do |sect|
17
+ num_sections = num_sections + 1
18
+ end
19
+ assert_equal(0, num_sections)
20
+ end
21
+
22
+ def test_each_section
23
+ settings = FXSettings.new
24
+ settings.writeStringEntry('sect1', 'key1', 'value1')
25
+ settings.writeStringEntry('sect2', 'key2', 'value2')
26
+ keys = []
27
+ settings.each_section do |sect|
28
+ sect.each_key do |key|
29
+ keys << key
30
+ end
31
+ end
32
+ assert_equal(['key1', 'key2'], keys.sort)
33
+ end
34
+ end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.6
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: fxruby
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.5
7
- date: 2005-03-01
6
+ version: 1.2.6
7
+ date: 2005-04-15
8
8
  summary: FXRuby is the Ruby binding to the FOX GUI toolkit.
9
9
  require_paths:
10
10
  - ext/fox12
@@ -516,6 +516,7 @@ files:
516
516
  - tests/TC_FXScrollArea.rb
517
517
  - tests/TC_FXScrollWindow.rb
518
518
  - tests/TC_FXSegment.rb
519
+ - tests/TC_FXSettings.rb
519
520
  - tests/TC_FXShell.rb
520
521
  - tests/TC_FXSize.rb
521
522
  - tests/TC_FXStream.rb