BBjDrawPanel::drawRect

Description

In BBj 16.0 and higher, this method draws a rectangle on the BBjDrawPanel using the current pen and BBjDrawPanel::setRound settings.

Syntax

Return Value

Method

void

drawRect(number x, number y, number width, int height)

Parameters

Variable

Description

x

Horizontal position of the upper left corner of the rectangle.

y

Vertical position of the upper left corner of the rectangle.

width

Width of the rectangle.

height

Height of the rectangle.

Return Value

None.

Remarks

When converting from the 'RECT' mnemonic, note that these method parameters are specified differently.

Example

rem ' BBjDrawPanel::drawRect

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjDrawPanel::drawRect"
window! = sysgui!.addWindow(25,25,1150,375,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setTrack(0)
window!.setFont(sysgui!.makeFont("Arial",8,0))
drawpanel! = window!.getDrawPanel()
drawpanel!.setPenColor(BBjColor.BLUE)
drawpanel!.setTextColor(BBjColor.BLUE)
drawpanel!.setFillColor(BBjColor.GREEN)
for i = 0 to 10
    x = i * 100 + 25
    w = (i+1) * 0.25
    drawpanel!.setFillType(i)
    drawpanel!.setPattern(i)
    drawpanel!.setPenWidth(w)
    drawpanel!.drawText(x,25,"setPenWidth("+str(w)+")")
    drawpanel!.drawText(x,50,"setPattern("+str(i)+")")
    drawpanel!.drawText(x,75,"setFillType("+str(i)+")")
    drawpanel!.setRound(5,5)
    drawpanel!.drawRect(x,100,75,75)
    drawpanel!.setRound(10,10)
    drawpanel!.drawRect(x,200,50,75)
    drawpanel!.setRound(15,15)
    drawpanel!.drawRect(x,300,75,50)
next i
process_events

eoj:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjDrawPanel

RECT Mnemonic - Draw Rectangle (SYSGUI)

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.