UserObjects are custom visual objects that you can build to supplement the standard PowerBuilder objects. UserObjects can display information, request information from a user, and respond to mouse or keyboard actions. You can also create a TabPage UserObject. Use the User Object painter to build UserObjects.
When you place a visible UserObject in a window, you are actually placing a UserObject control in the window. The control holds an instance of the UserObject you select for the window.
UserObject property |
Datatype |
Description |
---|---|---|
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. |
|
Boolean |
Specifies whether the object has a border. Values are: TRUE -- Object has a border. FALSE -- Object does not have a border. |
|
BorderStyle (enumerated) |
Specifies the style of the border of the object. Values are: StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
Boolean |
Specifies whether PowerBuilder moves the object to the top of the front-to-back order of the window. Values are: TRUE -- Object moved to top. FALSE -- Object not moved to top. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
ClassName |
String |
(External user objects only) Returns the name assigned to the object. |
Integer |
Specifies the number of columns on a scroll page. The default is 0 (10 columns per page). For information, see Scrolling in windows and user objects. PowerBuilder multiplies UnitsPerColumn by ColumnsPerPage to determine how many PowerBuilder units to scroll the object horizontally when the user clicks in the scroll bar. |
|
Control[ ] |
WindowObject |
Specifies the control's objects. You cannot change the contents of this array in a script. |
Boolean |
Specifies whether PowerBuilder puts the object automatically into Drag mode. Values are: TRUE -- When the object is clicked, it is automatically in Drag mode. FALSE -- When the object is clicked, it is not automatically in Drag mode. You have to manually put the object 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 object (the ICO file). The default icon is a box the size of the object. When the user drags the object, the icon displays when the object is over an area in which the object can be dropped (a valid drop area). When the object is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the object is enabled (can be selected). Values are: TRUE -- Object can be selected. FALSE -- Object cannot be selected. |
|
Integer |
Specifies the height of the object, in PowerBuilder units. |
|
Boolean |
Specifies whether a horizontal scroll bar displays. Values are: TRUE -- Horizontal scroll bar displays. FALSE -- Horizontal scroll bar does not display. |
|
LibraryName |
String |
(External user objects only) The name of the dynamic-link library (DLL) that contains an external user object class. |
Integer |
Specifies the number of lines on a page. The default is 0 (10 lines per page). For information, see Scrolling in windows and user objects. PowerBuilder multiplies UnitsPerLine by LinesPerPage to determine how many PowerBuilder units to scroll the object vertically when the user clicks in the scroll bar. |
|
ObjectType |
UserObjects (enumerated) |
Specifies the type of user object. Valid values are: CustomVisual! ExternalVisual! |
Long |
Specifies the numeric value of the color in the picture that is changed to the background color. Values can be: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. This property applies only when PictureName is a bitmap and only when the UserObject is a tab page. |
|
String |
Specifies a value of the Pointer enumerated datatype or the filename of the bitmap, cursor, or icon or to be displayed on the tab. This property applies only when the UserObject is a tab page. |
|
String |
Specifies the name of the stock pointer or the file containing the pointer used for the object. |
|
String |
Specifies text to be displayed as a PowerTip for the tab when the Tab control's PowerTips property is true. This property applies only when the UserObject is a tab page. |
|
Style |
Long |
Specifies any additional style bits you want to use to control how the object displays (external user object only). |
Long |
Specifies the numeric value of the tab background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. This property applies only when the UserObject is a tab page. It is not supported on Windows XP because the current XP theme controls the appearance of the tab. |
|
Long |
Specifies the numeric value of the tab text color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. This property applies only when the UserObject is a tab page. |
|
Integer |
Specifies tab value of the control within the user object (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the object. |
|
String |
Specifies the text that displays in the object. |
|
Integer |
Specifies the number of PowerBuilder units to be scrolled right or left when a user clicks the left or right arrow in the horizontal scroll bar in a window or user object. The default is 0 (1/100 of the width of the window). To make the end of the scroll bar match the content, UnitsPerLine must be set according to the content width. For information, see Scrolling in windows and user objects. PowerBuilder multiplies UnitsPerColumn by ColumnsPerPage to determine the number of PowerBuilder units to scroll the window horizontally when the user clicks in the scroll bar. |
|
Integer |
Specifies the number of PowerBuilder units to be scrolled up or down when a user clicks the up or down arrow in the vertical scroll bar in a window or user object. The default is 0 (1/100 of the window height). To make the end of the scroll bar match the content, UnitsPerLine must be set according to the content length. For information, see Scrolling in windows and user objects. PowerBuilder multiplies UnitsPerLine by LinesPerPage to determine the number of PowerBuilder units to scroll the window vertically when the user clicks in the scroll bar. |
|
Boolean |
Specifies whether the object is visible. Values are: TRUE -- Object is visible. FALSE -- Object is not visible. |
|
Boolean |
Specifies whether a vertical scroll bar displays. Values are: TRUE -- Vertical scroll bar displays. FALSE -- Vertical scroll bar does not display. |
|
Integer |
Specifies the width of the object, in PowerBuilder units. |
|
Integer |
Specifies the X position (distance from the left edge of screen) of the object, in PowerBuilder units. |
|
Integer |
Specifies the Y position (distance from the top of screen) of the object, in PowerBuilder units. |
UserObject event |
Occurs |
---|---|
Immediately before the Open event occurs in the window |
|
Immediately after the Close event occurs in the window |
|
When a dragged control is dropped on the object |
|
When a dragged control enters the object |
|
When a dragged control leaves the object |
|
When a dragged control is within the object |
|
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 |
|
When a Windows message occurs that is not a PowerBuilder event |
|
When the right mouse button is pressed on the object |
UserObject function |
Datatype returned |
Description |
---|---|---|
Integer |
Adds item to list. |
|
String |
Returns the name assigned to the object. |
|
Integer |
Removes the specified user object from view, closes it, and executes its Destructor event. |
|
Integer |
Creates a tab page if it has not already been created. |
|
Integer |
Deletes item from list. |
|
Integer |
Starts or ends the dragging of the object. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Integer |
Makes the object invisible. |
|
Integer |
Inserts item in list. |
|
Integer |
Places the object in a new location specified by the X and Y arguments. |
|
Integer |
Displays the specified user object, making its properties available to scripts. |
|
Integer |
Displays the specified user object, making its properties available to scripts, and stores a parameter in the system's Message object. |
|
Boolean |
Reports whether a tab page has been created. |
|
Integer |
Returns the distance from the left edge of the screen to the pointer, in PowerBuilder units. |
|
Integer |
Returns the distance from the top of the screen to the pointer, in PowerBuilder units. |
|
Boolean |
Adds an event to the end of the message queue for the object. |
|
Integer |
Prints the object. |
|
Integer |
Changes the size of the object based on the width and height. |
|
Integer |
Sets focus to the object. |
|
Integer |
Specifies the position of the object in the front-to-back order of the window. |
|
Integer |
Turns on or off automatic redrawing of the object after every change. |
|
Integer |
Makes the object visible. |
|
Integer |
Sends an event to the object and executes the script associated with the event. |
|
Object |
Returns the type of the object. |