Class: VRCanvasPanel

Inherits:
VRPanel show all
Includes:
VRDrawable
Defined in:
lib/vr/vrcontrol.rb

Constant Summary

Constants included from VRMessageHandler

VRMessageHandler::PREHANDLERSTR

Constants inherited from VRPanel

VRPanel::WINCLASSINFO

Constants included from VRParent

VRParent::DEFAULT_FONT, VRParent::VR_ADDCONTROL_FEWARGS

Constants inherited from VRControl

VRControl::WINCLASSINFO

Instance Attribute Summary collapse

Attributes included from VRParent

#screen

Attributes inherited from VRControl

#handlers, #name, #parent

Attributes inherited from VRWinComponent

#parent, #screen

Instance Method Summary collapse

Methods included from VRDrawable

#drawableinit

Methods included from VRMessageHandler

#acceptEvents, #addHandler, #addNoRelayMessages, #controlmsg_dispatching, #deleteHandler, #msghandlerinit, #selfmsg_dispatching

Methods included from VRParent

#addArrayedControl, #addControl, #clearControls, #construct, #countControls, #create, #createControl, #deleteControl, #newControlID, #parentinit, #registerControl, #registerControlAsArrayed, #self_created, #send_parent

Methods inherited from VRControl

Controltype, #add_parentcall, #call_parenthandler, #create, #setFont

Methods inherited from VRWinComponent

#_init, #create, #exwinstyle, #hide, #maximizebox, #maximizebox=, #minimizebox, #minimizebox=, #setscreen, #sizebox, #sizebox=, #tabstop, #tabstop=, #winstyle

Instance Attribute Details

#canvasObject (readonly)

VRCanvasPanel

Bitmap Canvas panel that can display drawable bitmap.

Methods

— createCanvas(w,h,color=0xffffff)

Creates a new canvas dimensioned ( ((|w|)),((|h||)) ) and
colored ((|color|)) on the background.

— canvas

Returns the instance of SWin::Canvas to draw it.


1302
1303
1304
# File 'lib/vr/vrcontrol.rb', line 1302

def canvas
  @canvas
end

Instance Method Details

#createCanvas(w, h, color = 0xffffff) ⇒ Object



1306
1307
1308
1309
1310
1311
1312
# File 'lib/vr/vrcontrol.rb', line 1306

def createCanvas(w,h,color=0xffffff)
  @canvas=@screen.factory.newcanvas(w,h)
  @canvas.setBrush(color)
  @canvas.setPen(color)
  @canvas.fillRect(0,0,w,h)
  @canvas.setPen(0x0)
end

#self_paintObject



1319
1320
1321
# File 'lib/vr/vrcontrol.rb', line 1319

def self_paint
  bitblt @canvas if @canvas
end

#vrinitObject



1314
1315
1316
1317
# File 'lib/vr/vrcontrol.rb', line 1314

def vrinit
  super
  @canvas=nil
end