class Fox::Canvas::TextShape

Attributes

font[R]
text[R]

Public Class Methods

new(x, y, w, h, text=nil) click to toggle source
Calls superclass method Fox::Canvas::RectangleShape::new
# File lib/fox16/canvas.rb, line 242
def initialize(x, y, w, h, text=nil)
  super(x, y, w, h)
  @text = text
  @font = FXApp.instance.normalFont
end

Public Instance Methods

draw(dc) click to toggle source
Calls superclass method Fox::Canvas::RectangleShape#draw
# File lib/fox16/canvas.rb, line 248
def draw(dc)
  super(dc)
  oldForeground = dc.foreground
  oldTextFont = dc.font
  dc.font = @font
  dc.drawImageText(x, y, text)
  dc.font = oldTextFont if oldTextFont
  dc.foreground = oldForeground
end