CreateMessage

Creates a message object that is displayed in a container or floating popup. The message can be a text string, HTML page, image, script code, multiple links or any other file.

You can assign a message to any object, location, and Project Tree message element, or activate one as part of a presentation. You can also assign a message to be displayed at the beginning of the project. The message is triggered when the user clicks on the object in the 3D Window or double-clicks on the Project Tree message element which is associated with that message object. When a message object is triggered, the message content is displayed in the message-defined client.

 

JavaScript

 

CreateMessage(

       TargetPosition,

       msgData,

       Type,

       BringToFront)

 

C#

 

ITerraExplorerMessage80 CreateMessage(

       MsgTargetPosition   TargetPosition,

       string        msgData,

       MsgType      Type,

       bool   BringToFront = false)

 

C++

 

HRESULT CreateMessage(

       MsgTargetPosition   TargetPosition,

       BSTR   msgData,

       MsgType      Type,

       VARIANT_BOOL  BringToFront,

       ITerraExplorerMessage80 **        pITerraExplorerMessage80) 

 

Parameters

TargetPosition

An enum that determines where the message appears.

The MsgTargetPosition enum can have one of the following values:

·          MTP_LEFT = 0
The message docks in TerraExplorer’s left container.

·          MTP_MAIN = 2
The message appears in TerraExplorer's main container.

·          MTP_MESSAGE_BAR = 3
The message appears in TerraExplorer's message bar.

·          MTP_FLOAT = 4
The message appears in the default external web browser. This value is invalid for Text messages.

·          MTP_POPUP = 5
The message appears in a floating popup window.

msgData

The message that is displayed. The MsgType parameter determines how this parameter is interpreted. If the MsgType parameter is set to TYPE_TEXT, this parameter is the text to be displayed. If MsgType parameter is set to TYPE_URL, this should be a full URL address (or a full path name) of a web page. If MsgType parameter is set to TYPE_ SCRIPT, this should be the content of the VBScript code.

Type

An enum that determines the type of message to be displayed. The MsgType can have one of the following values:

·          TYPE_TEXT = 0

·          TYPE_URL = 1

·          TYPE_SCRIPT = 3

BringToFront

If the client for this message (i.e. the left container) already contains other items (i.e. Project Tree or HTML pages) those items appear in separate tabs. When this message is triggered, a message tab is added to that container (if the message tab already exists the message content replaces the content of the previous message). This parameter determines whether this tab becomes the active tab when the message is triggered. The parameter is ignored if TargetPosition is not set to MTP_LEFT or MTP_MAIN.

Return Value

pITerraExplorerMessage80

An ITerraExplorerMessage80 that represents the newly created message.

Exceptions

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

Remarks

Several objects can own the message object that is created by this method. A rectangle for example, may own a message object that is also owned (at the same time) by a circle object. This means that both objects, the rectangle and the circle, display the same message when either object in the 3D Window or either object’s Project Tree entry is clicked.