BBjToolButton::setVerticalTextPosition

Description

In BBj 3.01 and higher, this method sets the vertical position of the text in the BBjToolButton control (relative to the image).

Syntax

Return Value

Method

void

setVerticalTextPosition(int position)

Parameters

Variable

Description

position

Use one of the following constants:

CENTER

TOP

BOTTOM

Return Value

None.

Remarks

The default vertical text position is CENTER.

Example

rem 'Set the vertical position of text in a tool button

SYSGUI = UNT
OPEN (SYSGUI)"X0"
sysgui! = BBjAPI().getSysGui()
window! = sysgui!.addWindow(100,100,820,350,"ToolButton Test")

ImageManager! = sysgui!.getImageManager()
Image! = ImageManager!.loadImageFromFile("bbj.ico")

id = 100,width = 150,height = 100
for vertical = 0 to 2
    y = vertical*(height+10)+10
    switch vertical
        case 0; va = sysgui!.TOP,va$ = "TOP"; break
        case 1; va = sysgui!.CENTER,va$ = "CENTER"; break
        case 2; va = sysgui!.BOTTOM,va$ = "BOTTOM"; break
    swend
    for horizontal = 0 to 4
        x = horizontal*(width+10)+10,id = id+1
        switch horizontal
            case 0; ha = sysgui!.LEFT,ha$ = "LEFT"; break
            case 1; ha = sysgui!.CENTER,ha$ = "CENTER"; break
            case 2; ha = sysgui!.RIGHT,ha$ = "RIGHT"; break
            case 3; ha = sysgui!.LEADING,ha$ = "LEADING"; break
            case 4; ha = sysgui!.TRAILING,ha$ = "TRAILING"; break
        swend
        toolbutton! = window!.addToolButton(id,x,y,width,height,"")
        toolbutton!.setText(va$+","+ha$)
        toolbutton!.setImage(Image!)
        toolbutton!.setVerticalTextPosition(va)
        toolbutton!.setHorizontalTextPosition(ha)
    next horizontal
next vertical

CALLBACK(ON_CLOSE,APP_CLOSE,sysgui!.getContext())

rem 'Process Events
process_events

APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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