An OLEControl placed in a window can contain an object, such as a spreadsheet or word processing document, that was created by an OLE-aware application. The PowerBuilder application's user can activate the object and edit it in the application in which it was created (the server application).
OLE controls are displayed in the OLE tab of the Browser as Insertable Objects.
For more information about using OLE in an application, see Using OLE in an Application in Application Techniques.
OLEControl property |
Datatype |
Description |
---|---|---|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
omActivation |
Specifies how the OLE object will be activated. |
|
Long |
Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
BinaryIndex |
Integer |
Internal use only. |
BinaryKey |
String |
Internal use only. |
Boolean |
Specifies whether the control has a border. Values are: TRUE -- Control has a border. FALSE -- Control does not have a border. |
|
BorderStyle (enumerated) |
Specifies the style of the border of the control. Values are: StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order. Values are: TRUE -- Control moved to top. FALSE -- Control not moved to top. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
ClassLongName |
String |
(Read-only) The long name for the server application associated with the OLE object in the control. |
ClassShortName |
String |
(Read-only) The short name for the server application associated with the OLE object in the control. |
omContentsAllowed |
Specifies whether the OLE object in the control must be embedded or linked or whether either method is allowed when Insert is called at runtime. |
|
String |
User-readable name for your OLE control when the control is activated in place. This name is displayed in OLE dialog boxes and windows that show the object's name. If you do not specify a value, the name of the control (such as ole_1) is used for DisplayName. |
|
omDisplayType |
Specifies how the OLE object will be displayed in the control. The control can display the actual contents or an icon to represent the object, or the document can be displayed as an ActiveX document. |
|
DocFileName |
String |
(Read-only) The name of the file containing the object. If the object has never been saved to a disk file, then the value of this property is " ". |
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are: TRUE -- When the control is clicked, the control is automatically in Drag mode. FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function. |
|
String |
Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the control is enabled (can be selected). Values are: TRUE -- Control can be selected. FALSE -- Control cannot be selected. |
|
Boolean |
Specifies whether a dotted rectangle (the focus rectangle) frames the control when it has focus. Values are: TRUE -- Control framed when it has focus. FALSE -- Control not framed when it has focus. |
|
Integer |
Specifies the height of the control, in PowerBuilder units. |
|
IsDragTarget |
Boolean |
Specifies whether an OLE object can be dropped on the control. Values are: TRUE -- OLE object can be dropped on control. FALSE -- OLE object cannot be dropped on control. |
LinkItem |
String |
(Read-only) The entire link name of the item to which the object is linked. For example, if the object is linked to C:\FILENAME.XLS!A1:B2, then LinkItem would contain C:\FILENAME.XLS!A1:B2. |
omLinkUpdateOptions |
Specifies how a linked object in the control is updated. If automatic, the link is updated when the object is opened and whenever the object changes in the server application. If manual, the link is not updated. |
|
Object |
omObject |
Used in scripts to apply server commands to the linked or embedded OLE object within the control. |
ObjectData |
Blob |
If the object is embedded, the object itself is stored as a blob in the ObjectData property. If the object is linked, this property contains the link information and the cached image (for display). |
ParentStorage |
omStorage |
(Read-only) Specifies the parent storage. |
String |
Specifies the name of the stock pointer or the file containing the pointer used for the control. |
|
Boolean |
Specifies whether the control is resizable. Values are: TRUE -- Control is resizable. FALSE -- Control is not resizable. |
|
SizeMode |
SizeMode (enumerated) |
Specifies the size mode for the OLE document. Choices are: Clip! -- The object's image displays full size. If it is larger than the OLE control, the image is clipped by the control's borders. Stretch! -- The object's image is resized to fit into and fill the OLE container control. This is the default value. |
Integer |
Specifies tab value of the control within the window (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the control. |
|
Boolean |
Specifies whether the control is visible. Values are: TRUE -- Control is visible. FALSE -- Control is not visible. |
|
Integer |
Specifies the width of the control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top of the window), in PowerBuilder units. |
OLEControl event |
Occurs |
---|---|
Clicked in PowerScript Reference |
When the control is clicked (selected or unselected) |
Close in PowerScript Reference |
Just before a window is removed from display (closed) |
Constructor in PowerScript Reference |
Immediately before the Open event occurs in the window |
DataChange in PowerScript Reference |
When the server application notifies the control that data has changed |
Destructor in PowerScript Reference |
Immediately after the Close event occurs in the window |
DoubleClicked in PowerScript Reference |
When the control is double-clicked (and possibly activated) |
DragDrop in PowerScript Reference |
When a dragged control is dropped on the control |
DragEnter in PowerScript Reference |
When a dragged control enters the control |
DragLeave in PowerScript Reference |
When a dragged control leaves the control |
DragWithin in PowerScript Reference |
When a dragged control is within the control |
Error in PowerScript Reference |
During OLE automation when an error occurs |
ExternalException in PowerScript Reference |
During OLE automation when the OLE server generates an exception during command execution (getting and setting properties, calling functions) |
GetFocus in PowerScript Reference |
Just before the control receives focus (and possibly becomes activated) |
Help in PowerScript Reference |
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control |
LoseFocus in PowerScript Reference |
When the control loses focus (becomes inactive). |
Other in PowerScript Reference |
When an operating environment message occurs that is not a PowerBuilder event |
PropertyChanged in PowerScript Reference |
When an OLE Server supporting notifications sends this message to the control |
PropertyRequestEdit in PowerScript Reference |
When an OLE Server supporting notifications sends this message to the control |
RButtonDown in PowerScript Reference |
When the right mouse button is pressed in the control |
Rename in PowerScript Reference |
When the server application notifies the control that the object has been renamed |
Save in PowerScript Reference |
When the server application notifies the control that the data has been saved |
SaveObject in PowerScript Reference |
When the server application saves the object in the control |
ViewChange in PowerScript Reference |
When the server application notifies the control that the view shown to the user has changed |
OLEControl function |
Datatype returned |
Description |
---|---|---|
Activate in PowerScript Reference |
Integer |
Activates the object server either in place or offsite |
ClassName in PowerScript Reference |
String |
Returns the name assigned to the control |
Clear in PowerScript Reference |
Integer |
Releases the OLE object and deletes references to it without updating storage |
Copy in PowerScript Reference |
Integer |
Copies the contents of the control to the clipboard |
Cut in PowerScript Reference |
Integer |
Copies the contents of the control to the clipboard and clears the control |
DoVerb in PowerScript Reference |
Integer |
Executes the specified verb |
Drag in PowerScript Reference |
Integer |
Puts the object into drag mode |
GetContextService in PowerScript Reference |
Integer |
Creates a reference to a context-specific instance of the specified service |
GetData in PowerScript Reference |
Integer |
Returns data in a caller-supplied format from an OLE server that supports Uniform Data Transfer |
GetNativePointer in PowerScript Reference |
Integer |
Returns a pointer to the underlying OLE object |
GetParent in PowerScript Reference |
PowerObject |
Returns a reference to the name of the parent object |
Hide in PowerScript Reference |
Integer |
Makes the control invisible |
InsertClass in PowerScript Reference |
Integer |
Inserts a new object created from a class ID |
InsertFile in PowerScript Reference |
Integer |
Inserts a new object where the source is a template file |
InsertObject in PowerScript Reference |
Integer |
Presents the user with a standard dialog box and inserts based on the selection |
LinkTo in PowerScript Reference |
Integer |
Links to a file and (optionally) an item within the file |
Move in PowerScript Reference |
Integer |
Moves the control to a specified location |
Open in PowerScript Reference |
Integer |
Opens a document file and loads the object into the control or opens a substorage within the previously opened storage and loads an object |
Paste in PowerScript Reference |
Integer |
Pastes the contents of the clipboard into the control |
PasteLink in PowerScript Reference |
Integer |
Pastes a link to the contents of the clipboard into the control |
PasteSpecial in PowerScript Reference |
Integer |
Presents a dialog box allowing the user to select Paste or PasteLink |
PointerX in PowerScript Reference |
Integer |
Returns the distance of the pointer from the left edge of the control |
PointerY in PowerScript Reference |
Integer |
Returns the distance of the pointer from the top of the control |
PostEvent in PowerScript Reference |
Boolean |
Adds an event to the end of the message queue for the control |
Print in PowerScript Reference |
Integer |
Prints the control |
ReleaseNativePointer in PowerScript Reference |
Integer |
Releases the pointer to the underlying OLE object |
Resize in PowerScript Reference |
Integer |
Changes the size of the control |
Save in PowerScript Reference |
Integer |
Saves an object previously loaded from a storage |
SaveAs in PowerScript Reference |
Integer |
Saves the contained object as a member in the requested storage or saves the contained object to the requested storage file |
SelectObject in PowerScript Reference |
Integer |
Sets the internal state of the control (updates menu) |
SetData in PowerScript Reference |
Integer |
Sends data in a caller-supplied format to an OLE server that supports Uniform Data Transfer |
SetFocus in PowerScript Reference |
Integer |
Sets focus to the control |
SetPosition in PowerScript Reference |
Integer |
Specifies the position of the control in the front-to-back order of the window |
SetRedraw in PowerScript Reference |
Integer |
Controls automatic redrawing of the control after each change in its properties |
Show in PowerScript Reference |
Integer |
Makes the control visible |
TriggerEvent in PowerScript Reference |
Integer |
Triggers a specific event for the control and executes the script for the event |
TypeOf in PowerScript Reference |
Object |
Returns the type of the control |
UpdateLinksDialog in PowerScript Reference |
Integer |
Invokes the OLE dialog to update link information if the file has moved |