BBjToolButton::getHorizontalTextPosition

Description

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

Syntax

Return Value

Method

int

getHorizontalTextPosition()

Parameters

None.

Return Value

Returns one of the following constants:

RIGHT

LEFT

CENTER

LEADING

TRAILING

Remarks

The default horizontal text position is RIGHT.

Example

rem ' BBjToolButton::getHorizontalTextPosition

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjToolButton::setHorizontalTextPosition"
window! = sysgui!.addWindow(100,100,820,350,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")

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)
        print toolbutton!.getText(),": getHorizontalTextPosition",
        print toolbutton!.getHorizontalTextPosition()
    next horizontal
next vertical

process_events

eoj:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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