OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                     
 
Skip Navigation Links
All BooksExpand All Books
Quick HelpExpand Quick Help
ProgrammingExpand Programming

4.50 FAQ-689 What is the User Interface Module (UIM) and how do you edit and program a UIM Object?

Last Update: 3/29/2017


Overview

The User Interface Module (UIM) consists of a set of objects that can be used to develop custom tools. These 14 objects are generally added to a window template and can be programmed to run some LabTalk script. The various types of objects -- bitmap buttons, checkbox controls, radio buttons, etc. -- can be modified and programmed, allowing you to create an intuitive interface for your custom routines.

The UIM has long been an OriginPro-only feature. Beginning with Origin 2015 SR1, it will be included in standard Origin. Go to www.originlab.com to download documentation of the UIM in PDF format .

UIM toolbar.png
  • To add a UIM object to a window template:
  1. Open an Origin window (workbook, matrix book, graph or layout) that you intend to use as your application template.
  2. From the menu, click Edit: Button Edit Mode to select button edit mode (a check mark beside Button Edit Mode indicates that you are in button edit mode).
  3. Click the desired control on the UIM toolbar.
  4. At the location you want to add the object, drag out a rectangle with your mouse. A UIM object will be added.
  5. While in Button Edit Mode, you can select the object and move or resize it, as needed.
  • To rename the UIM object:
  1. In Button Edit Mode, right-click on the object and choose Programming Control.
  2. Edit the Object Name and click OK to close the dialog box.
  • To customize the UIM object:
  1. Use the UIM Object dialog to customize controls, layouts, and background. Click the Titles..., Values... and Special... buttons for further options. These buttons open dialogs for different UIM object types.
  2. To open the UIM Object dialog box, in Button Edit Mode double click on the object. If not in Button Edit Mode, press the Ctrl key and double-click on the object.
  • To add code behind the object:
  1. Use the Programming Control dialog box to add script to run behind the object.
  2. To open the Programming Control dialog box: In Button Edit Mode, right-click the object and choose Programming Control. If you are not already in Button Edit Mode, press the Alt key and double-click on the object.
  3. To access UIM object controls via script, use the ObjectName.ControlName notation. If there are spaces in the Control Name, they should be trimmed when calling your control in the code.


Note: When accessing controls in the current UIM object itself, you can use this.ControlName

Example

In this example we create a simple UIM object that takes From, To and Step Length values from the user, then uses LabTalk script to fill Column A with data when the user clicks a Generate Col(A) button.

UIM sample preview.png
  1. Select Edit: Button Edit Mode. The UIM toolbar displays.
  2. Click the Status button UIM STATUS.png.
  3. Drag out a rectangle on a blank area of a workbook. An object labelled STATUS is added to the workbook window.
  4. Double-click the object to open the UIM Object dialog box.
  5. Edit the object as shown in the image below.
    UIM OBJECT STATUS CONTROLS1.png
  6. Click the Special button and open the Status Object dialog box.
  7. Duplicate the settings as shown in the image below. For From, enter 0.00; For To, enter 100.00; For Step Length, enter 5.00.
    UIM Status Object.png
  8. Click OK twice to close the Status Object dialog box and the UIM Object dialog box.
  9. Right-click on the STATUS object and choose Programming Control.
  10. In the script box, type the following:
    col(A) = data(this.From, this.To, this.StepLength);
  11. From the Script, Run After list, select Button Up.
  12. Click OK to close the dialog box.
  13. From the menu, click Edit: Button Edit Mode to exit button edit mode.
  14. Click the Generate Col(A) button to fill col(A) with data.

Keywords:UIM, User Interface Module, custom routine, custom tool, custom application, GUI, LabTalk

 

© OriginLab Corporation. All rights reserved.