Syntax 1: For docked toolbars
Description
Sets the position of a docked toolbar.
Applies to
MDI frame and sheet windows
Syntax
1 |
window.SetToolbarPos ( toolbarindex, dockrow, offset, insert ) |
Argument |
Description |
---|---|
window |
The MDI frame or sheet to which the toolbar |
toolbarindex |
An integer whose value is the index of the toolbar whose |
dockrow |
An integer whose value is the number of the docking row |
offset |
An integer whose value specifies the distance of the If insert is true, the offset you specify is adjusted so Specify an offset of 0 to position the toolbar ahead of |
insert |
A boolean value specifying whether you want to insert
|
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, returns null.
Usage
To find out whether the docked toolbar is at the top, bottom,
left, or right edge of the window, call GetToolbar.
If the toolbar’s alignment is floating, instead of docked, then
values you specify with Syntax 1 of SetToolbarPos take effect when you
change the alignment to a docked position with SetToolbar.
When insert is false, to move the toolbar before other toolbars in
dockrow, specify a value that is less than the offset for the existing
toolbars. If there is already a toolbar at offset 1, then you can move
the toolbar to the beginning of the row by setting offset to 0. If
offset is equal to or greater than the offset of existing toolbars, but
less than their end, the newly positioned toolbar will begin just after
the existing one. Otherwise, the toolbar will be positioned at
offset.
If the user drags the toolbar to a docked position, the new row
and offset replace values set with SetToolbarPos.
Examples
This example docks toolbar 1 at the left, adding it to docking row
1:
1 2 |
w_frame.SetToolbar(1, TRUE, AlignAtLeft!) w_frame.SetToolbarPos(1, 1, 1, FALSE) |
This example docks toolbar 2 at the left, adding it to docking row
1. If the toolbars already in the dock extend past offset 250, then the
offset of toolbar 2 is increased to accommodate them. Otherwise, it is
positioned at offset 250:
1 2 |
w_frame.SetToolbar(2, TRUE, AlignAtLeft!) w_frame.SetToolbarPos(2, 1, 250, FALSE) |
This example docks toolbar 2 at the left in docking row 2. Any
toolbar docked on the left in row 2 or higher is moved over a
row:
1 2 |
w_frame.SetToolbar(1, TRUE, AlignAtLeft!) w_frame.SetToolbarPos(1, 2, 1, TRUE) |
See also