Language Reference Guide : 4. System Classes : ExtObjField Class : InsertObject Method
 
Share this page                  
InsertObject Method
The InsertObject method inserts an external object into the ExtObjField container object.
This method has the following syntax:
integer = ExtObjField.InsertObject(extobject=extobject)
This method has the following parameter:
extobject
Specifies an external object to the ExtObjField container object. Any existing external object in the container is replaced by the new object.
The following code is an example of using the ExtObjField object to dynamically add an Active X control to an OpenROAD frame:
//
// This sample shows how to dynamically add an Active X
// control ( webbrowser in this sample ) to a frame using an
// extobjfield object.
//
// The webbrowser Active X control 'webbrowser' should be
// available on any system that uses Microsoft Internet
// Explorer.
//
// It is assumed that the webbrowser class is available to
// this application by prior registration of an external
// class library component which contains the webbrowser
// class.
//
initialize()=
declare
// Declare a variable of type 'extobjfield' which is
// an OpenROAD object that contains an Active X control
axContainer = extobjfield;
// Declare a variable of type 'webbrowser' which has
// already been registered with OpenROAD as an
// external class. This variable is holds the
// external object of type 'webbrowser'.
browser = webbrowser;
enddeclare
begin
// Make sure frame has been created.
curframe.flush();
// Parent the external object field to the frame at 100,100
axContainer.parentfield = curframe.topform;
axContainer.xLeft = 100;
axContainer.yTop = 100;
// Set the size of the external object field
axContainer.outerheight = 2000;
axContainer.outerwidth = 3000;
// Insert the Active X control into the External Object Field.
axContainer.insertobject( extobject = browser );
// Navigate to a web page.
browser.navigate( 'http://www.actian.com' );
end