Home > Working with SGWorld > Creator (ICreator6) > CreateMessage

CreateMessage

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 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(

      Client,

      msgData,

      Type,

      BringToFront)

 

C#

 

ITerraExplorerMessage6 CreateMessage(

      MsgClient6 Client,

      string      msgData,

      MsgType     Type,

      bool        BringToFront = false)

 

C++

 

HRESULT CreateMessage(

       MsgClient6                  Client,

       BSTR                        msgData,

       MsgType                     Type,

       VARIANT_BOOL                BringToFront,

       ITerraExplorerMessage6 **   pITerraExplorerMessage6) 

 

Parameters

Client

An enum that determines where the message appears.

The MsgClient enum has the following values:

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

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

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

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

·         MC_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 has 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 MsgClient is not set to MC_LEFT or MC_MAIN.

Return Value

pITerraExplorerMessage6

An ITerraExplorerMessage6 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 clicked upon in the Project Tree.