Class XbpActiveXControl() Foundation

Class function of the XbpActiveXControl class


The class XbpActiveXControl implements a generic control container for hosting ActiveX controls. Xbase++ applications use instances of the XbpActiveXControl class to integrate ActiveX controls with their user interface and to interact with the control through the methods and instance variables introduced by this class.

An ActiveX control is an automation object that implements a windowed user interface component. An ActiveX control is roughly comparable to an Xbase Part in that it contains logic to display a visual representation and defines interfaces for communicating with the Xbase++ application. However, an ActiveX control is not created directly. Instead, the control's life cycle is managed implicitly by the automation server that exposes the interfaces of the ActiveX control.

XbpActiveXControl uses the functionality inherited from class AutomationObject to create and manage an ActiveX control requested by an Xbase++ application. Also, the class builds on the event handling mechanism introduced by its base class ActiveXObject. Internally, XbpActiveXControl implements COM interfaces required for hosting the control and maintaining its display area. Please see the documentation on class AutomationObject to learn more about automation objects and COM/ActiveX interfaces.

From the perspective of the Xbase++ application, an ActiveX control hosted by an XbpActiveXControl object behaves like a normal Xbase Part. The application communicates with the control by setting instance variables or calling methods on the XbpActiveXControl instance.

Specifically, the class XbpActiveXControl implements the following functionality:

Implicit maintenance of an ActiveX control's life cycle.
Integration of the COM events generated by an ActiveX control with the Xbase Part event protocol.
Automatic mapping of the instance variables and methods defined by class XbpWindow to the corresponding COM/ActiveX properties and methods used by the control.
Implements the COM interfaces for hosting ActiveX controls and for maintaining its display area

Using an ActiveX Control

// Create a label control as a child of an 
// existing dialog. The example uses 
// a Presentation Parameter to defines the 
// label control's background color 
oLabel       := XbpActiveXControl():new( oDlg:drawingArea,{10,250},{100,80} ) 
oLabel:CLSID := "Forms.Label" 
oLabel:create( oDlg:drawingarea,,,aPP,.F.) 

// Assign a code block for handling "left 
// mouse button down" events and show 
// ActiveX control 
oLabel:lbDown := {|| MsgBox("Label was clicked on!")} 

Class methods
Creates an instance of the XbpActiveXControl class.
Life cycle
Requests system resources for the XbpActiveXControl object.
Releases the system resources of the object.
Reconfigures the XbpActiveXControl object after :create() has been executed.
Determines whether the ActiveX control uses a Visual Style for display.
Determines whether the ActiveX control is visible after :create() is called.
Connection Management
Class ID or ProgID identifying the COM/ActiveX component to connect to
The instance variable :server contains the name of the server that is to be used for creating an ActiveX control.
The instance variable :license contains the license string required for creating licensed ActiveX controls.
Information about type and capabilities of the ActiveX control
Runtime Data
Specifies the ActiveX control to be the cancel button of the form.
Specifies the ActiveX control to be the default button of the form.
ActiveX Control Manipulation
Repositions the ActiveX control.
Changes the size of the XbpActiveXControl.
Changes position and size of the ActiveX control.
Redisplays a hidden ActiveX control.
Defines the shape of the mouse pointer displayed by an ActiveX control.
Assigns a value to the :visible instance variable.
Set a new font.
Sets or returns the background color.
Set foreground color.
Sets or returns the presentation parameter array.
Control Container Presentation Parameter Management
Inherits presentation parameters defined by control container's parent object
Synchronize ActiveX control container's presentation parameters
Set the input focus on the ActiveX control.
COM/ActiveX Event Management
Registers event processing for standard ActiveX control events.
Deregisters standard event processing installed by :subscribeStdEvents()
Default handlers for standard COM/ActiveX events
Default event handler for ActiveX control event "KeyDown" (DISPID_KEYDOWN).
Default event handler for ActiveX control event "Click" (DISPID_CLICK).
Default event handler for ActiveX control event "DblClick" (DISPID_DBLCLICK).
Default event handler for ActiveX control event "MouseDown" (DISPID_MOUSEDOWN).
Default event handler for ActiveX control event "MouseUp" (DISPID_MOUSEUP).
Default event handler for ActiveX control event "MouseMove" (DISPID_MOUSEMOVE).
Default handlers for system-internal events
Trigger the standard action associated with an ActiveX control.
Mouse messages
:lbClick / xbeM_LbClick
Left mouse button clicked.
:lbDblClick / xbeM_LbDblClick
Left mouse button double clicked.
:lbDown / xbeM_LbDown
Left mouse button pressed.
:lbUp / xbeM_LbUp
Left mouse button released.
:mbClick / xbeM_MbClick
Middle mouse button click.
:mbDblClick / xbeM_MbDblClick
Middle mouse button double clicked.
:mbDown / xbeM_MbDown
Middle mouse button pressed.
:mbUp / xbeM_MbUp
Middle mouse button released.
:motion / xbeM_Motion
Mouse has been moved.
:rbClick / xbeM_RbClick
Right mouse button clicked.
:rbDblClick / xbeM_RbDblClick
Right mouse button double clicked.
:rbDown / xbeM_RbDown
Right mouse button was pressed.
:rbUp / xbeM_RbUp
Right mouse button released.
Other messages
:helpRequest / xbeP_HelpRequest
Help has been requested.
:keyboard / xbeP_Keyboard
Keyboard input received.
:killInputFocus / xbeP_KillInputFocus
ActiveX control is losing input focus.
:move / xbeP_Move
ActiveX control has been moved.
:resize / xbeP_Resize
Size of the ActiveX control has changed.

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.