Common Desktop Environment: Application Builder User's Guide

Making Connections Between Objects

In its simplest form a connection is a programmatic relationship between a source object and a target object: when I click on Button A I want Dialog Box B to be displayed. This type of connection is described below in "To Make a Connection between Two Objects".

Different types of connections from menu items are described in "To Connect a Menu Item to a Predefined Action", "To Connect a Menu Item to a Call Function", and "To Connect a Menu Item to an Execute Code Action".

Other types of connections (to On Item Help and to a help volume) were discussed in "To Connect a Help Menu to On Item Help" and in "To Connect a Help Menu to a Help Volume". In "To Connect a Non-Modal Message to a Function", a message dialog box is connected to the function which causes the dialog box to be displayed.

To Make a Connection between Two Objects

  1. Select the source and target objects.

    By "drag-linking": While holding down the Control key, position the mouse cursor over the intended source object, press mouse button 1, drag the cursor to the intended target object, and release the mouse button.

    This can be done in the interface or in the Module Browser (or between the interface and the Module Browser). See "Module Browser" for a description of the Browser.

    A line with a "plug" at its end will extend from the source as you move the mouse. The target object will be highlighted with a dark box. When you release the mouse button on the target object, the Connections Editor will be displayed, with the source and target objects selected.

    • Through the Connections Editor: Display the Connections Editor by choosing Connections in the Editors menu. Choose the object type you want as the source object in the Source menu, and select the object you want as the source in the Source list. Then choose the object type you want as the target object in the Target menu, and select the object you want as the target in the Target list.


      Note -

      If you select an object in the Revolving Property Editor and click the Connections button, the Connections Editor will be displayed with the selected object selected in the Source list.


      Graphic
  2. Choose an action in the When menu.

    This is the action on the source object that will cause an action to be performed on the target object. Choices vary, depending on the source object type.

  3. Choose an action to be performed on the target in the Action Type menu.

    Different target action types require different subsequent action by you:

    • Predefined: Choose an action from a second option menu.

    • Call Function: Type the name of a function in the Function text field. You will also have to write code for the call function, as described in "Adding User Code to Generated Code".

    • Execute Code: Type the code to be performed in the Execute Code Editor and click OK in the editor.

  4. Click Connect to make the connection.

    The connection will be displayed in the View list at the bottom of the Connections Editor.

  5. Click Cancel to dismiss the Connections Editor.