Syntax 2: For floating toolbars – PB Docs 2017

Syntax 2: For floating toolbars

Description

Sets the position and size of a floating toolbar.

Applies to

MDI frame and sheet windows

Syntax

Argument

Description

window

The MDI frame or sheet to which the toolbar
belongs

toolbarindex

An integer whose value is the index of the toolbar whose
settings you want to change

x

An integer whose value is the x coordinate of the
floating toolbar

y

An integer whose value is the y coordinate of the
floating toolbar

width

An integer whose value is the width of the floating
toolbar

height

An integer whose value is the height of the floating
toolbar

Return value

Integer.

Returns 1 if it succeeds. SetToolbarPos returns -1 if there is no
toolbar for the index you specify or if an error occurs. If any
argument’s value is null, SetToolbarPos returns null.

Usage

If the toolbar’s alignment is a docked position, instead of
floating, then values you specify with Syntax 2 of SetToolbarPos take
effect when you change the alignment to floating in a script with
SetToolbar.

If the user drags the toolbar to a floating position, the new
position values replace values set with SetToolbarPos.

The floating toolbar is never too large or too small for the
buttons. If you specify width and height values that are too small to
accommodate the buttons, the width and height are adjusted to make room
for the buttons. If both width and height are larger than needed, the
height is reduced.

If you specify x and y coordinates that are outside the frame, the
toolbar becomes inaccessible to the user.

Examples

This example displays toolbar 1 near the upper-left corner of the
frame. An arbitrary width and height lets PowerBuilder size the toolbar
as needed:

This example displays toolbar 2 close to the lower-right corner of
the frame. GetToolbarPos gets the current width and height of the
toolbar so that the toolbar stays the same size:

This example positions floating toolbar 2 just inside the
lower-right corner of the MDI frame. GetToolbarPos gets the current
width and height of the toolbar. These values and the height of the
MicroHelp are used to calculate the x and y coordinates for the floating
toolbar:

See also

GetToolbar

SetToolbar

SetToolbarPos


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x