Accessing Static Controls and Triggering Origin Events with Origin C

The ActiveLayer example demonstrates how to access static controls in a Dialog Builder resource and how to trigger event handlers for various Origin events. To access the static controls in the Active Layer dialog below the example program uses the Origin C Control class. To trigger event handlers for various Origin events the Active Layer dialog uses several event macros defined in the Origin C system header file MsgMap.h. The example dialog is launched by executing the function TestDlg in the source file ActiveLayer.c found in this zip file, under the \Dialog Builder\ActiveLayer subfolder of Origin.

Accessing Static Controls and Triggering Origin Events with Origin C image148.gif

To launch the ActiveLayer dialog above:

  1. Open the source file ActiveLayer.c in Code Builder.
  2. Add ActiveLayer.c to the Code Builder workspace by activating it and pressing the CTRL + W keys.
  3. Build ActiveLayer.c by clicking the Build button Accessing Static Controls and Triggering Origin Events with Origin C image12.gif.
  4. Type ActiveLayer() in the Script Window or LabTalk Console and press the ENTER key.