Ole4D Methods

OCSetToolBarRect(p_AreaVar;p_Left;p_Top;p_Right;p_Bottom)


Sets the rectangle in which the object can put toolbars. If the rectangle given as parameter is an empty rectangle like (0,0,0,0) the object can put toolbars anywhere in the top window that contains the plug-in area.
By default the toolbar rectangle is the entire window that contains the plug-in area.
The coordinates are relative to the top-left corner of the top window containing the area.

Parameters
Parameter Type   Description
p_AreaVar Longint -> Variable of the plug-in area.
p_Left Longint -> Left side
p_Top Longint -> Top side
p_Right Longint -> Right side
p_Bottom Longint -> Bottom side


Return Values
0 – The method call was successful.
If the method call was not successful the return value is non zero. For more information call OCLastError.

Remarks
OCSetToolBarRect can be called no matter if the plug-in area contains an Ole object or not. When the area already contains an object you have to call OCUpdateToolBar to apply toolbar rectangle change.
OCSetToolBarRect must be called before activating the Ole object.

Example
`example 1
`restrict the toolbar rectangle
$i:=OCSetToolBarRect(OCONT1;100;0;800;450)
$i:=OCUpdateToolBar(OCONT1)

`example 2 `allow the object to put the toolbars anywhere on plug-in window
$i:=OCSetToolBarRect(OCONT1;0;0;0;0)
$i:=OCUpdateToolBar(OCONT1)
 

See Also
OCGetToolbarRect, OCUpdateToolbar, OCEnableToolbars