GetToolbar
PowerScript function
Description
Gets the current values for alignment, visibility, and title of the
specified toolbar.
Applies to
MDI frame and sheet windows
Syntax
1 |
window.GetToolbar ( toolbarindex, visible {, alignment {, floatingtitle } } ) |
Argument |
Description |
---|---|
window |
The MDI frame or sheet to which the toolbar |
toolbarindex |
An integer whose value is the index of the toolbar |
visible |
A boolean variable in which you want to store a value |
alignment (optional) |
A variable of the ToolbarAlignment enumerated |
floatingtitle (optional) |
A string variable in which you want to store the |
Return value
Integer.
Returns 1 if it succeeds. GetToolbar returns -1 if there is no
toolbar for the index you specify or if an error occurs. If any argument’s
value is null, returns null.
Usage
To find out the position of the docked or floating toolbar, call
GetToolbarPos.
Examples
This example finds out whether toolbar 1 is visible. It also gets
the alignment and title of toolbar 1. The values are stored in the
variables lb_visible, lta_align, and ls_title:
1 2 3 4 5 6 |
integer li_rtn boolean lb_visible toolbaralignment lta_align li_rtn = w_frame.GetToolbar(1, lb_visible, & lta_align, ls_title) |
This example displays the settings for the toolbar index the user
specifies in sle_index. The IF and CHOOSE CASE statements convert the
values to strings so they can be displayed in mle_toolbar:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
integer li_index, li_rtn boolean lb_visible toolbaralignment lta_align string ls_visible, ls_align, ls_title li_index = Integer(sle_index.Text) li_rtn = w_frame.GetToolbar(li_index, & lb_visible, lta_align, ls_title) IF li_rtn = -1 THEN MessageBox("Toolbars", "Can't get" & + " toolbar settings.") RETURN -1 END IF IF lb_visible = TRUE THEN ls_visible = "TRUE" ELSE ls_visible = "FALSE" END IF CHOOSE CASE lta_align CASE AlignAtTop! ls_align = "top" CASE AlignAtLeft! ls_align = "left" CASE AlignAtRight! ls_align = "right" CASE AlignAtBottom! ls_align = "bottom" CASE Floating! ls_align = "floating" END CHOOSE mle_1.Text = ls_visible + "~r~n" & + ls_align + "~r~n" & + ls_title |
See also