BBjDrawPanel::drawArrow

Description

In BBj 16.0 and higher, this method draws a line on the BBjDrawPanel from the current pen position to the position defined by x,y, like BBjDrawPanel::drawLineTo, but also places an optional arrow head at either or both ends.

Syntax

Return Value

Method

void

drawArrow(int x, int y, boolean head, boolean tail)

Parameters

Variable

Description

x

Horizontal position of the end point of the line.

y

Vertical position of the end point of the line.

head

If non-zero, an arrow head is drawn at the start of the line (the original pen position).

tail

If non-zero, an arrow head is drawn at the end of the line (the position defined by x,y).

Return Value

None.

Remarks

If head and tail are both zero, this method is equivalent to BBjDrawPanel::drawLineTo.

Example

rem ' BBjDrawPanel::drawArrow

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjDrawPanel::drawArrow"
window! = sysgui!.addWindow(25,25,1125,275,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)
for i = 0 to 10
    x = i * 100
    drawpanel!.drawText(x+25,25,"setPattern("+str(i)+")")
    drawpanel!.setPattern(i)
    drawpanel!.setPenWidth((i+1)*0.25)
    adj = (i-5) * 5
    drawpanel!.moveTo(x+25,75)
    drawpanel!.drawArrow(x+100,75+adj,0,0)
    drawpanel!.moveTo(x+25,125)
    drawpanel!.drawArrow(x+100,125+adj,0,1)
    drawpanel!.moveTo(x+25,175)
    drawpanel!.drawArrow(x+100,175+adj,1,0)
    drawpanel!.moveTo(x+25,225)
    drawpanel!.drawArrow(x+100,225+adj,1,1)
next i
process_events

eoj:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjDrawPanel

ARROW Mnemonic - Draw Arrow (SYSGUI)

BBjDrawPanel::moveTo()

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