The ActiveX Components

TerraExplorer exposes four separate ActiveX components, the 3D Window, the Project Tree, the external 3D Window, and the external Project Tree.

ITE3DWindow

The ITE3DWindow interface provides control over the 3D Window elements.

Note:     If instantiating more than one 3D window, HRESULT returns the following value: TE_E_MULTIPLE_TEX

Only one 3D Window can be opened in a process.

 

 

Properties

 

BorderStyle

Gets and sets the border style surrounding the 3D Window.

Caption

Gets and sets the text displayed in the title bar of messages issued by the object.

TakeControlOfKeyboardAccelerators

Gets and sets the Boolean that determines if TerraExplorer executes all keyboard acceleration commands. If it is set to TRUE, TerraExplorer executes them; if FALSE, the containing application executes them.

Text

Reserved. Currently not used.

BorderStyle

Defines the border style surrounding the 3D Window. The value is a number between 0 and 4, according to the following options:

§  0 = None

§  1 = Solid

§  2 = Three-dimensional border style

§  3 = Border with a sunken edge

§  4 = Double border

 

JavaScript

 

BorderStyle

 

C#

 

int BorderStyle { get; set; }

 

C++

 

HRESULT BorderStyle([in] long pstyle)

HRESULT BorderStyle([out, retval] long* pstyle)

Caption

Gets and sets the text displayed in the title bar of messages issued by the object.

JavaScript

 

Caption

 

C#

 

string Caption { get; set; }

 

C++

 

HRESULT Caption([in] BSTR pstrCaption)

HRESULT Caption([out, retval] BSTR* pstrCaption)

TakeControlOfKeyboardAccelerators

Gets and sets a value that determines if TerraExplorer executes all keyboard acceleration commands. If the value is nonzero (TRUE), TerraExplorer executes the commands; if the value is zero (FALSE), the containing application executes them.

 

JavaScript

 

TakeControlOfKeyboardAccelerators

 

C#

 

int TakeControlOfKeyboardAccelerators { get; set; }

 

C++

 

HRESULT TakeControlOfKeyboardAccelerators([out, retval] long* pVal)

HRESULT TakeControlOfKeyboardAccelerators([in] long rhs)

 

_ITE3DWindowEvents

_ITE3DWindowEvents is the notification interface for events that relate to the 3D Window.

 

 

Events

 

OnKeyboardMessage

This event occurs when the user presses a keyboard key.

OnKeyboardMessage

This event occurs when the user presses a keyboard key.

 

JavaScript

 

OnKeyboardMessage(

       Message,

       KeyCode,

       KeyData,

       pbHandled)

 

C#

 

void OnKeyboardMessage(

       int Message,

       int KeyCode,

       int KeyData,

       ref object pbHandled)

 

C++

 

HRESULT OnKeyboardMessage(

       long Message,

       long KeyCode,

       long KeyData,

       VARIANT* pbHandled)

Parameters

Message

The state of the key that is pressed:

·        WM_KEYDOWN = 256

·        WM_KEYUP = 257

KeyCode

Specifies the virtual-key code of the non-system key. See: MSDN Library (e.g., WM_KEYUP).

KeyData

Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table. See: MSDN Library (e.g., WM_KEYUP)

pbHandled

A Boolean that indicates whether or not the client handled the keyboard message itself and does not wish TerraExplorer to respond to the keyboard action. When the value is FALSE, TerraExplorer handles the keyboard action.

ITE3DWindowEx

In addition to the regular TE3DWindow (which can only be embedded once in an application), the client can create one or more external TE3DWindowEx objects in the same application. The ITE3DWindowEx interface provides control over the 3D window elements of each of the TE3DWindowEx windows. See "In-Process vs. Out-of-Process ActiveX Controls" in this chapter for more information.

 

 

Properties

 

BorderStyle

Gets and sets the border style surrounding the 3D Window.

Caption

Gets and sets the text displayed in the title bar of messages issued by the object.

Text

Reserved. Currently not used.

 

Methods

 

CreateInstance

Creates an SGWorld instance.

BorderStyle

Gets and sets the border style surrounding the 3D Window. The value is a number between 0 and 4, according to the following options.

§  0 = None

§  1 = Solid

§  2 = Three-dimensional border style

§  3 = Border with a sunken edge

§  4 = Double border

 

JavaScript

 

BorderStyle

 

C#

 

int BorderStyle { get; set; }

 

C++

 

HRESULT BorderStyle([in] long pstyle)

HRESULT BorderStyle([out, retval] long* pstyle)

Caption

Gets and sets the text displayed in the title bar of messages issued by the object.

 

JavaScript

 

Caption

 

C#

 

string Caption { get; set; }

 

C++

 

HRESULT Caption([in] BSTR pstrCaption)

HRESULT Caption([out, retval] BSTR* pstrCaption)

CreateInstance

This method is used to create an object, generally an SGWorld81 instance, from a specific 3D Window. When using the ITE3DWindowEx interface to create multiple TE3DWindowEx objects in the same application, a specific SGWorld instance can be created using the CreateInstance method for each of the 3D windows. Each SGWorld instance can then load a different Fly file so that each window displays distinct content. See "Adding ActiveX Components" in this chapter for examples.

 

JavaScript

 

CreateInstance(

       ProgID)

 

C#

 

dynamic CreateInstance(

       string ProgID)

 

C++

 

HRESULT CreateInstance(

       BSTR ProgID,

       IUnknown** ppUnk)

Parameters

ProgID

This parameter can be either of the following values:

·        ProgID of the desired object we want to create (e.g. "TerraExplorerX.SGWorld81")

·        CLSID of the desired object (e.g. "{3A4F91A1-65A8-11D5-85C1-0001023952C1}").

Return Value

ppUnk

A pointer to the newly created object after the call returns successfully.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

ITEInformationWindow

The ITEInformationWindow interface provides control over the Project Tree.

 

 

Properties

 

BorderStyle

Gets and sets the border style surrounding the Project Tree window.

Text

Reserved. Currently not used.

BorderStyle

Gets and sets the border style surrounding the Project Tree window. The value is a number between 0 and 4, according to the following options.

§  0 = None

§  1 = Solid

§  2 = Three-dimensional border style

§  3 = Border with a sunken edge

§  4 = Double border

 

JavaScript

 

BorderStyle

 

C#

 

int BorderStyle { get; set; }

 

C++

 

HRESULT BorderStyle([in] long pstyle)

HRESULT BorderStyle([out, retval] long* pstyle)

ITEInformationWindowEx

In addition to the regular TEInformationWindow (which can only be embedded once in an application), the client can create one or more external TEInformationWindowEx objects in the same application. The ITEInformationWindowEx interface provides control over the properties of these information windows, i.e. project trees.

Each external TEInformationWindowEx should be attached to a specified TE3DWindowEx external window, to display the Project Tree for the project loaded to its attached 3D Window. The external information window and external window are connected using the AttachTo3dWindow method.

 

 

Properties

 

BorderStyle

Gets and sets the border style surrounding the Project Tree window.

Text

Reserved. Currently not used.

 

Methods

 

AttachTo3dWindow

Connects between this TEInformationWindowEx and a specified TE3DWindowEx.

BorderStyle

Gets and sets the border style surrounding the Project Tree window. The value is a number between 0 and 4, according to the following options.

§  0 = None

§  1 = Solid

§  2 = Three-dimensional border style

§  3 = Border with a sunken edge

§  4 = Double border

 

JavaScript

 

BorderStyle

 

C#

 

int BorderStyle { get; set; }

 

C++

 

HRESULT BorderStyle([in] long pstyle)

HRESULT BorderStyle([out, retval] long* pstyle)

 

AttachTo3dWindow

This method connects between this TEInformationWindowEx and a specified TE3DWindowEx.

See "Adding ActiveX Components" in this chapter for usage examples.

 

JavaScript

 

AttachTo3dWindow(

       pI3dWindow)

 

C#

 

AttachTo3dWindow(

       ITE3DWindowEx pI3dWindow)

 

C++

 

HRESULT AttachTo3dWindow(

       ITE3DWindowEx* pI3dWindow)

Parameters

pI3dWindow

An ITE3DWindowEx representing the 3D window to which the Information Window should be attached.

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

 

ITENavigationMap5

The ITENavigationMap5 interface is no longer supported.