You are on page 1of 262

ERDAS Macro Language

Reference Manual December 2010

Copyright 2010 ERDAS, Inc.


All rights reserved. Printed in the United States of America. The information contained in this document is the exclusive property of ERDAS, Inc. This work is protected under United States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing by ERDAS, Inc. All requests should be sent to the attention of: Manager, Technical Documentation ERDAS, Inc. 5051 Peachtree Corners Circle Suite 100 Norcross, GA 30092-2500 USA. The information contained in this document is subject to change without notice. Government Reserved Rights. MrSID technology incorporated in the Software was developed in part through a project at the Los Alamos National Laboratory, funded by the U.S. Government, managed under contract by the University of California (University), and is under exclusive commercial license to LizardTech, Inc. It is used under license from LizardTech. MrSID is protected by U.S. Patent No. 5,710,835. Foreign patents pending. The U.S. Government and the University have reserved rights in MrSID technology, including without limitation: (a) The U.S. Government has a nonexclusive, nontransferable, irrevocable, paid-up license to practice or have practiced throughout the world, for or on behalf of the United States, inventions covered by U.S. Patent No. 5,710,835 and has other rights under 35 U.S.C. 200-212 and applicable implementing regulations; (b) If LizardTech's rights in the MrSID Technology terminate during the term of this Agreement, you may continue to use the Software. Any provisions of this license which could reasonably be deemed to do so would then protect the University and/or the U.S. Government; and (c) The University has no obligation to furnish any know-how, technical assistance, or technical data to users of MrSID software and makes no warranty or representation as to the validity of U.S. Patent 5,710,835 nor that the MrSID Software will not infringe any patent or other proprietary right. For further information about these provisions, contact LizardTech, 1008 Western Ave., Suite 200, Seattle, WA 98104. ERDAS, ERDAS IMAGINE, Stereo Analyst, IMAGINE Essentials, IMAGINE Advantage, IMAGINE, Professional, IMAGINE VirtualGIS, Mapcomposer, Viewfinder, and Imagizer are registered trademarks of ERDAS, Inc. Other companies and products mentioned herein are trademarks or registered trademarks of their respective owners.

Table of Contents
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii Introduction to EML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

How to Write an EML Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11


Introduction . . . . . . . . . . . . Create an EML File . . . . . . . Add Functionality . . . . . . . . Add More Functionality . . . Dialog Access from a Menu Enhancing Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 14 18 22 23

EML Syntax Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27


Introduction . . . . . . . . . Expressions . . . . . . . . . Names . . . . . . . . . . . . . . Constants . . . . . . . . . . . Variables . . . . . . . . . . . . Operators . . . . . . . . . . . Functions . . . . . . . . . . . Application Functions . Built-In Functions . . . . . Procedures . . . . . . . . . . Statements . . . . . . . . . . Command Statements . . Application Commands Function Commands . . . Components . . . . . . . . . Menus . . . . . . . . . . . . . . Frames . . . . . . . . . . . . . Frameparts . . . . . . . . . . Core Attributes . . . . . . . Framepart Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 . 28 . 28 . 28 . 28 . 29 . 38 . 39 . 39 . 64 . 64 . 67 . 84 . 84 . 85 . 86 . 89 . 91 118 121

Table of Contents Table of Contents

iii iii

Number Attributes . . . . . . . . . . Framepart Functions . . . . . . . . CellArray Framepart Functions Filename Framepart Functions . List Framepart Functions . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

147 148 149 154 166

EML User Interface Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169


General Guidelines for EML Punctuation in EML Titles . Info Strings . . . . . . . . . . . . . Toolbars . . . . . . . . . . . . . . . Help Button . . . . . . . . . . . . . Batch Button . . . . . . . . . . . . Components and Frames . . File Naming . . . . . . . . . . . . . Document Frames . . . . . . . . Modal Dialogs . . . . . . . . . . . Modeless Dialogs . . . . . . . . Tool Palettes . . . . . . . . . . . . Menu Dialogs . . . . . . . . . . . Standard Buttons . . . . . . . . Standards for Frameparts . . Icon Formats . . . . . . . . . . . Scripts ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 170 171 171 171 172 172 173 173 173 174 174 175 175 176 180

EML Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183


Parser . . . . . . . . . . . GUI Manager . . . . . . Interpreter . . . . . . . . Message Manager . . Session Manager . . Preference Manager On-Line Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 186 186 188 190 192 195

C Toolkit Interface to EML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Reading the EML Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

iv

Table of Contents

The Main Event Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Getting and Setting Part Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Exiting and Cleaning Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

EML Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205


Number Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 Number Input . . . . . . . . . . . . . . . Device Configuration Properties Preference Database . . . . . . . . . Example Slider EML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 211 224 225

Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Alphabetical Index by Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Index by Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

Table of Contents

vi

Table of Contents

Introduction to EML
Preface
When the designing of ERDAS IMAGINE began, it was clear that a traditional, static GUI would not meet the needs of the variety of users and applications of the ERDAS products. Users wanted to be able to customize the interface and to create scripts which could be used to execute frequently used functions. The ERDAS Macro Language (EML) is the result of this design. EML is designed to serve as a scripting language as well as a user interface language. Unlike simple user interface description tools (such as UIL in Motif), EML is able to define the actions which are to be taken when a user interacts with a dialog. It provides a complete syntax for defining a typical dialog box, as well as constructs for defining scripts which contain branching and control logic. In addition to the macro language itself, EML provides a C level toolkit of functions which allows the programmer to build the EML language into an application, and to extend the language through application specific variables, functions, and commands. In addition to this Introduction, the EML Manual contains the following: How to Write an EML Script - This set of learn-by-doing exercises, takes you through the steps to create a utility dialog that provides graphical access to several UNIX file-handling commands. It is intended for the novice EML programmer. EML Syntax Reference - This section gives a detailed definition of the syntax used to construct an EML script. EML User Interface Standards - This document explains the standards for writing EML scripts that are used by ERDAS, Inc. EML Architecture - A description of EML as a distributed tool shared among cooperating applications. C Toolkit Interface to EML - This section describes the structure of a C program which uses EML and describes the types of things which can be done with the EML API. EML Appendixes - This section consists of tables filled with formatting and configuration information. Keyword Cross Index - A cross index of keywords and symbols arranged both alphabetically and categorically.

Introduction to EML Introduction to EML

1 1

Description

The ERDAS Macro Language is a script language that is designed for generating a graphical user interface. EML allows you to design the same graphical user interface tools (e.g., dialog boxes, menus, and control panels) that are used in ERDAS IMAGINE. With EML you can write scripts to: customize the IMAGINE graphical user interface for your own use, or incorporate your C Programmers Toolkit programs into the IMAGINE graphical user interface.

EML Graphical User Interface Examples

One of the main applications of EML is to create the Graphical User Interface (GUI) elements used in IMAGINE. The following sections give examples of the types of GUI elements which can be created with EML and give a brief description of each of the elements.

How to Write an EML gives a brief tutorial for creating and loading a custom EML script. For complete details of the syntax of EML see EML Syntax Reference. BUTTON A button is a simple framepart whose main purpose is to initiate an action. A button may be a rectangle with the title centered in the button or a rectangle filled with an icon. Both forms behave the same.

CHECKBOX The checkbox provides a toggle mechanism for on/off, yes/no, true/false types of responses.

Introduction to EML

EDITTEXT The edittext is used to implement a simple input text field. It also provides the capabilities of a multi-line text editor.

FILENAME The filename framepart provides a tool for interactively selecting a file.

GROUP The group framepart is used to group other frameparts together for emphasis.

Introduction to EML

LABEL The label framepart is used to place a label in a frame. The label can be a simple text string or it may be a small image provided by an icon file. There is no user interaction with a label.

Click in the window to select

LINE The line framepart creates simple line in a frame which can be used to separate items or call attention to others.

METERNUMBER The meternumber provides a quantitative as well as a qualitative means of entering or displaying a numeric value.

POPUPLIST The popup list provides a means of selecting one value from a list of several fixed choices.

Introduction to EML

RADIOBUTTON The radiobutton provides a means of selecting one value from a set of several fixed choices.

SCROLLIST The scrollist provides a means of selecting a single value from a long list of choices.

TEXTNUMBER The textnumber provides a means of entering or displaying a numeric value.

These basic items are called frameparts and are combined with frames to create the GUI elements described on the following pages.

Introduction to EML

Document Frames

Document frames are used to view or display some information which is saved in one or more files. This is characteristic of an interactive document viewer/editor. IMAGINE applications which have document frames are viewer, modelmaker, dataview, hfaview, imageinfo, editor, dsceditor, and mosaic. Modal Dialogs, Modeless Dialogs, and ToolPalettes are used in support of the editing operations performed in a document frame.

Title Bar Menu Bar Tool Bar

Document Area

Status Bar

Introduction to EML

Modal Dialogs

A Modal Dialog is used to display or query information in a serial fashion. Until the modal dialog is dismissed (through selection of the OK or Cancel button) the rest of the application is non-responsive.

Modeless Dialogs

A modeless dialog exchanges information that is used to interact with a document window in a continuing fashion. All other parts of the application are available while the modeless dialog is displayed.

Introduction to EML

Tool Palettes

A tool palette is a modeless frame which is used to display a series of icons which control the behavior of the pointer while it is within a document window. The top portion of the tool palette consists of a series of icons which represent the function to be performed, with Help, Keep Tool, and Close buttons at the bottom of the palette. A tool palette should be as small as possible since it is occupying screen space which is at a premium.

Keep Tool Help

Menu Dialogs

Several of the top level applications started from the IMAGINE icon panel are menus of functions. These menus are simple dialogs which present a menu of buttons like the following:

Introduction to EML

Job Setup Dialogs

A job setup dialog is somewhat of a hybrid. It acts as the top level frame for an application but it actually represents a document area. It is typically a dialog which displays filename lists to be used for the selection of input and output filenames.

Introduction to EML

10

Introduction to EML

How to Write an EML Script


Introduction
If you prefer to have a more complete understanding of how EML works before embarking on the task of writing one, then you should first read the documentation on EML Architecture, EML Syntax Reference, and C Toolkit Interface to EML. If you learn best through experience and prefer to roll up your sleeves and get your feet wet then lets go ... In this set of learn-by-doing exercises, we are going to create a utility dialog that provides graphical access to several UNIX file-handling commands. You may make mistakes as you perform these exercises. DONT PANIC! The EML parser will provide you with helpful error messages. If you have made a spelling or syntax error, simply edit the EML script to correct the problem and try to load it again. Usually the line number on which the error occurs is given by the warning message.

Create an EML File

Use the IMAGINE Text Editor to create a text file named simple.eml in your local IMAGINE directory (~/.imagineXXX - where XXX is the current version number). Type the following lines into this file:
component simple { frame first_frame { title "Simple Modeless Dialog"; geometry 0,0,260,70; button stopit { title "Quit"; geometry 0,0,82,25; on mousedown unload; } /* end of button stopit */ } /* end of first_frame */ on startup display first_frame; } /* end of component */

You may also use vi, textedit, or any other text editor capable of creating an ASCII file.

How to Write an EML Script How to Write an EML Script

11 11

Every EML should begin with a line containing the component keyword. The name you give the component (simple in our example) must be the same as the root name of the .eml file. The brace ({) at the end of the component statement indicates that more than one statement follows which belongs to the component. All statements within a set of braces ({}) are grouped together. Every EML should have at least one frame or dialog. In our example the keyword frame is followed by the name of the frame (first_frame). This provides a way of addressing a particular frame as we do in the "on startup" line. Every frame should have a title so that when the dialog is displayed, it is easy to tell what it is supposed to do. The title attribute is followed by a quoted string that is displayed in the banner portion of the dialog. Notice the semicolon (;) at the end of this line. Each statement that does not begin a group of statements must be terminated with a semicolon. The geometry attribute in our example specifies the x and y screen coordinates (in pixels) for the location of the upper left corner of the dialog box. It also specifies the x and y dimensions (in screen pixels) of the dialog box. The location of the dialog box is relative to the upper left corner of the screen. A frame without something to click on would be rather uneventful so the next element is a button framepart. Just as with frame, the button keyword takes a name (stopit) and a title (Quit). The geometry attribute is again used to specify the x and y coordinates (in pixels) for the location of the upper left corner of the button and the x and y dimensions (in pixels) of the button. In this case, the location of the button (or other frameparts) is relative to the upper left corner of the dialog box. At last we come to an action statement. The on attribute statement is called a message handler. The basic syntax is on <message> <action>. In the case of our example, when the Quit button is clicked, it receives the mousedown message. The message handler then tells EML to unload the current script. The unload command is most important because without it, there is no means with which to remove the dialog without quitting IMAGINE. OK. So where does the mousedown message come from? Well, when the GUI Manager portion of EML detects a mouse button click, it sends the message mousedown to the framepart that was active when the event occurred.

See the descriptions given in GUI Manager and Message Manager.

12

How to Write an EML Script

The unload command is used because we do not want to quit the calling application (which we will see in a moment is IMAGINE); we simply want the dialog to be removed.

Block Statements

The next couple of lines in the example script contain close braces (}) to conclude block statements. Each of these lines is commented to make script maintenance easier. Commenting is good programming practice regardless of the language. A comment begins with /* and ends with */. Anything appearing between these symbol pairs is ignored. The last statement is another on attribute; this time it is for the component. You can tell this because it is not contained within the statement blocks for either the button or the frame. This message handler takes care of the startup message that is automatically sent by the EML Parser when the EML script is first loaded. When the component receives the startup message, it instructs EML to
display the frame first_frame.

The last line concludes the block of statements that make up the entire component.

Load the EML File

Now its time to see what the example does so far. The simplest method is to load the script from IMAGINE. 1. Start IMAGINE. 2. Select Session | Session Log. The Session Log displays the loading and unloading of the script file. 3. Select Session | Command History. 4. Click in the Command: window of the Command History dialog. The text cursor will change from gray to black and begin to blink. 5. Type the following command then press RETURN:
load "simple.eml"

Our Simple Modeless Dialog is displayed in the upper left corner of the screen. The message Loading [simple.eml]... is displayed in the Session Log window.

How to Write an EML Script

13

6. Click the Quit button to remove (unload) the dialog. The message Unloading [simple.eml]... is displayed in the Session Log window. You now see how easy it is to create a dialog and to display it from IMAGINE using the ERDAS Macro Language.

Add Functionality

Now lets add a little functionality. In this exercise, we are going to add a couple of frameparts to first_frame and show how one framepart can affect another. We will also learn that frameparts can hold a value and we will see how we can access that value. Modify simple.eml to look like the following:
component simple { frame first_frame { title "Simple Modeless Dialog"; geometry 0,0,363,188; button okay2; filename filein { title "Source File:"; geometry 0,0,187,188; on filenamechoosen enable okay2; } /* end filein */ button okay2 { title "OK"; geometry 193,0,82,25; on mousedown echo "File" $filein " selected."; } /* end okay2 */ button stopit { title "Quit"; geometry 281,0,82,25; on mousedown unload; } /* end stopit */ on framedisplay disable okay2; } /* end frame */ on startup display first_frame; } /* end of component */

The first thing you may notice is that the geometry attribute of the frame has been edited to increase the size of the dialog. This is because we are going to add some frameparts.

14

How to Write an EML Script

The first new line added to the file may seem a little odd. It simply declares a button named okay2. No attributes have been given to the button. The reason for this is that no framepart may be referenced before it is declared. When a framepart is declared, it is simply given a name and acknowledged by the EML Parser as existing. Only after it has been defined by attributes can it be displayed. If the okay2 button was not first declared, the EML Parser would give an error when it encountered the reference to it in the last line of the filename part. If okay2 was defined before the filename part, no error would have occurred. The next change is the addition of the filename framepart named filein. This is a fairly complex framepart that is easy to use because of built-in features. All we have to do is provide title and geometry attributes. By default, the filename part automatically displays the names of all subdirectories and files in the current directory. To make this part do something, however, we must add a message handler. A message handler is simply a statement that tells a part what to do when it receives a particular message from the system. In the case of the filename framepart, a special message is sent from the GUI Manager when it sees that a file name has been selected. When a file name is selected, the filenamechoosen message is sent to the filename framepart. When a subdirectory is selected, the subdirectories and files of that directory are then displayed. The spelling of the message filenamechoosen is correct for EML. Initially, the okay2 button is displayed in gray text indicating that it is disabled (this is explained below). Upon receipt of the filenamechoosen message, the okay2 button is enabled by the on attribute of the filename framepart. The next new part is the okay2 button. This button is given the title OK and located 6 pixels to the right of the filename framepart (0 + 187 + 6 = 193). The basic formula for starting location is the sum of the starting location and width of the part to the left of the current part plus a gap value. (See the following illustration.) Sp + Width + Gap = Sc

How to Write an EML Script

15

Sp width

Sc gap new part existing part

The same formula applies to positioning parts vertically. For this exercise, the OK button simply echoes the statement File filename selected. to the Session Log. The name of the file is supplied by the GUI Manager. In addition to sending the filenamechoosen message, the value of the selected file is assigned to the framepart. We access the contents of the filein framepart (its value) by prefixing its name with the $ character. Notice that this portion of the echo statement is not quoted. The geometry of the Quit button is altered to position it to the right of the OK button (193 + 82 + 6 = 281). The last change to the file is the addition of one more message handler. This time we want something to happen when the frame is displayed. Again, when the GUI Manager senses that a frame has been displayed, it sends the message framedisplay to the frame. The on framedisplay disable okay2; statement is what makes the OK button initially gray.

Test It

Everything else is the same as before so lets take another look at our new dialog. 1. Type the following command in the Command: window of the Command History dialog and press RETURN:
load "simple.eml"

The dialog is displayed in the upper left corner of the screen. Initially it contains no file names, but in a few seconds (depending on the size of the current directory) the subdirectories and files are displayed. Also note that the title of the OK button is displayed in gray text.

16

How to Write an EML Script

2. Double click on a subdirectory name. The contents of that directory are displayed but the OK button is still disabled because a directory is not a valid file name. 3. Click on a file name. The selected file name is copied to the text input area, the filein framepart is assigned the value of the selected file (current path/filename), and the OK button is enabled. We have now successfully demonstrated how one framepart can affect or alter another. We have also seen how the value of a framepart can be accessed and used. 4. When you are finished admiring and exploring your handiwork, click the Quit button to unload the dialog. In the next exercise, we are going to do something with the filename we select.

Add More Functionality

By the end of this exercise, you will have a dialog that will assist you in copying, renaming, and deleting files. Modify simple.eml so that it looks like this:
component simple { frame first_frame { title "Copy / Rename / Delete"; geometry 600,150,468,188; filename filein; button copyit; button renameit; button deleteit; button stopit; filename fileout; filename filein { title "Source File:"; geometry 0,0,187,188; on filenamechoosen enable deleteit; } /* end filein */

How to Write an EML Script

17

button copyit { title "Copy"; geometry 193,0,82,25; on mousedown { echo "File " $filein " copied to " $fileout "."; system cp $filein $fileout; disable copyit; disable renameit; disable deleteit; } } /* end copyit */ button renameit { title "Rename"; geometry 193,31,82,25; on mousedown { echo "File " $filein " renamed to " $fileout "."; system mv $filein $fileout; disable copyit; disable renameit; disable deleteit; } } /* end renameit */ button deleteit { title "Delete"; geometry 193,62,82,25; on mousedown { echo "File " $filein " deleted."; system rm $filein; disable copyit; disable renameit; disable deleteit; } } /* end deleteit */ button stopit { title "Quit"; geometry 193,93,82,25; on mousedown unload; } /* end stopit */ filename fileout { title "Destination File:"; geometry 281,0,187,188; newfile; on filenamechoosen {

18

How to Write an EML Script

enable copyit; enable renameit; } } /* end fileout */ on framedisplay { disable copyit; disable renameit; disable deleteit; } } /* end frame */ on startup display first_frame; } /* end of component */

First, its time to give our dialog a new title. After all, it has a real purpose now. Remember to use titles that help explain or define the purpose of the dialog. For this exercise, lets use "Copy / Rename / Delete" since that is what it will do. Then edit the geometry attribute of first_frame so that it will be positioned in a more convenient location. The former coordinates are 0,0 (upper left corner of the screen). The new coordinates 600,150 will position the upper left corner of the dialog box 600 pixels to the right of the left edge of the screen and 150 pixels below the top edge. Next are added declarations for each framepart in this dialog. It is good programming practice to declare all frameparts used in each frame. This allows you to see at a glance the content of each frame. It also prevents parse errors when a part is referenced before it is defined. Frames and frameparts must be declared or defined before they are referenced! In the filein framepart, enable the deleteit button instead of the okay2 button. The other two buttons (copyit and renameit) are not enabled at this time because copying or renaming a file requires two arguments: a source file name and a destination file name. Next, we are going to replace the OK button with three new buttons, each of which will initiate a different action. Remove the block of statements that define the okay2 button. Now define the three new buttons. First is the Copy button. As with the fileout framepart above, it takes advantage of the block statement to perform five actions. It first executes the UNIX system command cp to copy a file.

How to Write an EML Script

19

This is accomplished by using the system keyword. The system command causes the Interpreter to evaluate all variables and expressions in the argument list and pass the list to the UNIX shell for execution. In the case of the Copy button, the variables $filein (the name of the source file) and $fileout (the name of the destination file) are first evaluated. Then the entire argument list is passed to the UNIX operating system. For example, the resulting argument list might be:
cp /tmp_mnt/home/bob/simple1.eml /tmp_mnt/home/bob/simple2.eml

Next, the Copy button echoes a message to the Session Log stating that the source file has been copied to the destination file. Finally, it issues three short commands to disable itself and the Rename and Delete buttons. This lets you know that there are no pending operations. The definitions of the Rename and Delete buttons are virtually identical to the Copy button except that the Rename button uses the UNIX mv (move) command and the Delete button uses the rm (remove) command. Now edit the Quit button geometry so that it is located below the Delete button. The destination filename framepart is the next thing to add. This one we will name fileout and give it the title Destination file:. This is the part that will handle the filenamechoosen message and enable the Copy and Rename buttons. Until now, we have relied upon selecting a file name from a displayed list of available files. What about a new file name? If you have tried typing a new filename in the source file text input area, you have already seen the File ... does not exist. message. How do we enable access to this area? The answer is the newfile keyword. This keyword does two things. First, it allows you to enter a new file name into the text input area. Second, it checks to see if the file name you entered already exists. If it does, it gives you a warning and asks if you wish to replace it. If you select No, the text input area is blanked and you may enter a new file name. If you select Yes, the existing file is deleted so that it can be replaced by the new file of the same name. One final thing to notice about the fileout framepart is the use of multiple statements with the message handler. Any message handler may initiate any number of actions by using a block statement. The last thing to do is to modify the framedisplay message handler to disable the three new buttons so they cannot be used until files are selected.

Test It Again

Lets take another look at our dialog.

20

How to Write an EML Script

1. Type the following command in the Command: window of the Command History dialog and press RETURN:
load "simple.eml"

Initially the titles of the three new buttons are displayed in gray text.

2. Select a file from the Source File window. As soon as you select a file, the Delete button is enabled. If you click the Delete button now, the selected file is deleted from the file system without further approval. 3. Click in the text input area of the Destination File window and enter a new file name. If no file exists in the current directory with this name, the Copy and the Rename buttons are enabled. 4. Click the Copy button. The selected source file is copied to the specified new file and the three file manager buttons are disabled. 5. In the Source File window, select the new file created with the Copy button in the previous step. 6. Click the Delete button. Each time you perform one of the file management functions, the file name display is updated to reflect the change. 7. Click the Quit button. Now lets move on to make our new dialog more accessible.

Dialog Access from a Menu

Getting to your new utility dialog can be made easier. Follow the steps below to add your dialog to the IMAGINE Utility menu.

How to Write an EML Script

21

1. Copy $IMAGINE_HOME/scripts/imagine.eml to $HOME/.imagineXXX/imagine.eml where: $IMAGINE_HOME = <IMAGINE install directory>/XXX, $HOME = <your home directory>, and XXX = the version number. For example:
cp /vol/imagine/830/scripts/imagine.eml /home/smith/.imagine830/imagine.eml

2. Add write permission to the local copy of imagine.eml. For example:


chmod +w /home/smith/.imagine830/imagine.eml

3. Open your local copy of imagine.eml for editing. Find the line that contains:
menu utilmenu "[U]tility" {

This is the beginning of the menu definition block. 4. At the end of the menu definition block, immediately following the line that contains:
{ erdas; }

add the following lines:


utilfile "File Management..." { load "simple.eml" ; }

5. Save the local copy of imagine.eml. 6. Start IMAGINE. If it is already running, quit the session and re-start IMAGINE. You must re-start IMAGINE from your home directory so that your local copy of imagine.eml is read. 7. Select File Management... from the Utility menu. The Copy/Rename/Delete dialog is displayed.

Enhancing Usability

We could add many more features to our dialog but for the sake of time and space, lets learn just one more new command and apply it to our dialog.

22

How to Write an EML Script

The set command allows you to change the value of any variable (frameparts included) to something else. In the case of our dialog, we will add a new button called Clear that will remove the contents of the text input area and disable the Copy, Rename, and Delete buttons. This same command can also be used with the other buttons to clear the text input field following execution. Modify simple.eml to look like this:
component simple { frame first_frame { title "Copy / Rename / Delete"; geometry 600,150,468,188; filename filein; button copyit; button renameit; button deleteit; button clearit; button quitit; filename fileout; filename filein { title "Source File:"; geometry 0,0,187,188; on filenamechoosen enable deleteit; } /* end filein */ button copyit { title "Copy"; geometry 193,0,82,25; on mousedown { echo "File " $filein " copied to " $fileout "."; system cp $filein $fileout; set filein = ""; set fileout = ""; disable copyit; disable renameit; disable deleteit; } } /* end copyit */ button renameit { title "Rename"; geometry 193,31,82,25; on mousedown { echo "File " $filein " renamed to " $fileout "."; system mv $filein $fileout; set filein = "";

How to Write an EML Script

23

set fileout = ""; disable copyit; disable renameit; disable deleteit; } } /* end renameit */ button deleteit { title "Delete"; geometry 193,62,82,25; on mousedown { echo "File " $filein " deleted."; system rm $filein; set filein = ""; set fileout = ""; disable copyit; disable renameit; disable deleteit; } } /* end deleteit */ button clearit { title "Clear"; geometry 193,93,82,25; on mousedown { set filein = ""; set fileout = ""; disable copyit; disable renameit; disable deleteit; } } /* end clearit */ button stopit { title "Quit"; geometry 193,124,82,25; on mousedown unload; } /* end stopit */ filename fileout { title "Destination File:"; geometry 281,0,187,188; newfile; on filenamechoosen { enable copyit; enable renameit; } } /* end fileout */ on framedisplay {

24

How to Write an EML Script

disable copyit; disable renameit; disable deleteit; } } /* end frame */ on startup display first_frame; } /* end of component */

The first addition is the declaration of the new Clear button. Next you will see the addition of the following two lines to the Copy, Rename, and Delete buttons:
set filein = ""; set fileout = "";

These lines change the value of the filein and fileout filename frameparts to nothing ("" - an empty string). Note that these lines are placed following the system commands which rely upon the value of these frameparts. Add the clearit button after the deleteit button and give it a geometry that will place it below the deleteit button (formerly that of the Quit button). Edit the geometry of the Quit button so that it is positioned below the new Clear button (93 + 25 + 6 = 124). The Clear button simply resets the values of the filein and fileout filenames and disables the Copy, Rename, and Delete buttons.

One Last Look


1. Start IMAGINE (if it is not already running). 2. Select Utility | File Management. Your new file management dialog is displayed.

We leave it to you to experiment with further improvements such as view and edit features.

How to Write an EML Script

25

The EML Syntax Reference provides a complete syntax reference of EML operators, functions, commands and parts.

26

How to Write an EML Script

EML Syntax Reference


Introduction
An EML script may consist of a mix of procedural definitions and GUI definitions. The procedural definitions are called procedures and may exist stand-alone in a script or they can be mixed within a script which defines a user interface. The GUI definitions are all contained in a Component which is built of variables, menus, textstrings, and frames. The frames are built of buttons, meters, text areas, etc. Both the procedural and GUI definitions are built of keywords and expressions. Keywords are simply words which have a predefined special meaning to the EML interpreter. This section gives a detailed definition of the syntax used to construct an EML script. It begins with the most basic part of a script, expressions, then moves to procedures and finally defines the GUI elements used to create a complete application. Within this Syntax Reference, you will find: Expressions Names Constants Variables Operators Functions Procedures Statements Command Statements Application Commands Function Commands Components Menus Frames Frameparts Attributes Framepart Attributes Number Attributes Framepart Functions

EML Syntax Reference EML Syntax Reference

27 27

Expressions

An expression is a combination of constants, variables, operators, and functions which is used to provide a value for some operation. The most common use of expressions is in assignment statements that are used to create the values stored in variables. Throughout EML, an expression is typically used when a simple number or string is required.

Names

Throughout an EML file many things are given names. Names in EML are strings of characters up to 256 characters long. The first character must come from the set a...z (upper and lower case are treated the same) and all following characters in the name must come from the set a...z, 0...9, and "_".

Constants

A constant is either a number or string. A number has the form:


[+/-]dddd[.ddddd][E[+/-]ddddd]

Examples of valid numbers are: 1, -3.4, 6.04e23 A string constant is either a simple name or a text string enclosed in double quotes. Examples of valid string constants are: Avogadro, "This string has spaces", "/data/filename.txt". It is necessary to enclose filenames in quotes when they contain the special characters "/" and "." which are defined as operators in EML.

Variables

A variable may be either local (variable) or global (global). Local variables defined at the component level are available to all procedures, menus and frames defined in the component. Global variables are available across applications. Any variable used in an EML script should be declared as either global or variable. The syntax for defining a variable is:
variable name [= <expression>] ; global name [= <expression>] ;

In either case a variable is a named container which may hold one or more values which can be either numbers, characters, or strings of characters. All of the values stored in one variable must be of the same type. For example, a variable cannot contain numbers and strings. The expression is new in version 9.3. The expression is optional. If it is present, it is evaluated at the time that the EML file is read and is used to provide the initial value for the variable. The value of a variable may also be established with the set command. The $ operator is used to get the value of a variable. Both of these are described in following sections.

Variable References

A variable reference has the form:


$name

The value of the variable name is substituted.

28

EML Syntax Reference

Operators

Operators are used to combine one or more values to produce a new one. Typical examples of operators are addition (+), subtraction(-), multiplication (*), division(/), etc. For most operations the operands must be of the same type. Most operators handle variables with multiple values by operating on each of the individual elements. The array operator ([]) can be used to get individual elements from such a variable. The operator examples in this section use the following variable definitions: Variable Name
scale inputfile path name x y

Value
1.0 "data/atlanta.img" "data/" "atlanta.img" 3.04 -4

List-Construction Operator

The syntax is:


{ expression [ expression ...] } { expression [, expression ...] }

The { } (list construction) operator creates a single item which contains multiple values. This is like an array in other programming languages and may be indexed via the [] (index) operator. The individual expressions between the braces may be space or comma separated. Example
{ "A" "B" } { 1, 2, 3 } { "Dog", 3.4, "Cat" }

Result
"A" "B" 1 2 3 "Dog" "3.4" "Cat"

Addition Operator

The syntax is:


expression + expression

EML Syntax Reference

29

The + (addition) operator returns the sum of two expressions. If the two expressions are strings this operator returns the concatenation of the two strings. If the two expressions are numbers then the numerical sum is returned. An error occurs with any other combination. Example
1+1 $x+1 $path+$name $path+x

Result
2 4.04 "data/atlanta.img" <Error>

Array Operator

The syntax is:


$name[expression]

The [ ] (array) operator evaluates expression to use as the index to the nth element of name. Assume that the variable x is a list of values created by set x = {"Layer_1", "Layer_2", "Layer_3" }; . Example
$x[1] $x[3]

Result
"Layer_1" "Layer_3"

Boolean-And Operator

The syntax is:


expression && expression

The && (boolean-and) operator first converts each expression to a 0 (if the expression evaluates to 0) or to a 1 (if the expression evaluates to anything but zero) then if both expressions are 1(true) the result is true (1), otherwise it returns false (0). The && operator is valid only for numeric expressions. An error is produced if a string is used in either expression. Example
$x==3.04 && $x < 10 0 && 1 $name && $x

Result
1(true) 0(false) <Error>

Boolean-Or Operator

The syntax is:


expression or expression

30

EML Syntax Reference

The or (boolean-or) operator first converts each expression to a 0 (if the expression evaluates to 0) or to a 1 (if the expression evaluates to anything but zero) then if either argument is 1(true) the result is true(1), otherwise the result is false (0). The boolean-or operator is valid only for numeric expressions. An error is produced if a string is used in either expression. Example
$x==3.04 or $x < 10 0 or 1 $name or $x

Result
1(true) 1(true) <Error>

Concatenation Operator

The syntax is:


expression // expression

The // (concatenation) operator first converts each expression to a string and then joins the two strings to produce a new string. The // operator is valid for both string and numeric expressions but the output is always a string. Example
$name//$x $path//$name $x//1

Result
"atlanta.img3.04" "data/atlanta.img" "3.041"

Division Operator

The syntax is:


expression / expression

The / (division) operator produces the numerical quotient of the two expressions. Division is valid only for numeric expression. An error is produced if either operand is not a number. Example
$x/2 2/$x $path/2

Result
1.52 .65789473684 <Error>

Equals Operator

The syntax is:


expression == expression

EML Syntax Reference

31

The == (equals) operator returns true (1) if both expressions are the same, otherwise it returns false (0). The == operator is valid for numeric and string expressions. An error is produced only if a string and a numeric expression are compared with each other. Example
$x == 2 $x == 3.04 $name == "atlanta.img" $name == $x

Result
0 (false) 1 (true) 1 (true) <Error>

Exponentiation Operator

The syntax is:


expression ^ expression expression power expression

The ^ or power (exponentiation) operator returns the result of raising the left-hand expression to the value of the right-hand expression. The ^ or power operator is valid only for numeric expressions. An error is produced if either expression is not a number. Example
$x^2 2 power $x $x^$name

Result
9.2416 8.22491061325 <Error>

Greater-Than Operator

The syntax is:


expression > expression

The > (greater-than) operator returns true (1) if the left-hand expression is greater than the right-hand expression, otherwise if returns false (0). The > operator is valid for numeric or string expressions. An error is produced if a string and a numeric expression are compared with each other. Strings are compared based upon the ASCII value of the individual characters, where: A<Z<a<z. Example
$x > 2

Result
1(true)

32

EML Syntax Reference

Example
$x > 3.04 $name > "atlanta.img" "abc" > "def" "def" > "abc" $name > $x

Result
0(false) 0(false) 0(false) 1(true) <Error>

Greater-Than-Or-Equal Operator

The syntax is:


expression >= expression

The >= (greater-than-or-equal) operator returns true (1) if the left-hand expression is greater than or equal to the right-hand expression, otherwise it returns false (0). The >= operator is valid for numeric or string expressions. An error is produced if a string and a numeric expression are compared with each other. Example
$x >= 2 $x >= 3.04 $name >= "atlanta.img" "abc" >= "def" "def" >= "abc" $name >= $x

Result
1(true) 1(true) 1(true) 0(false) 1(true) <Error>

Inequality Operator

The syntax is:


expression != expression

The != (inequality) operator returns true (1) if the two expressions are not the same, otherwise it returns false (0). The != operator is valid for numeric or string expressions. An error is produced if a string and a numeric expression are compared with each other. Example
$x != 2 $x != 3.04 $name != "atlanta.img"

Result
1 (true) 0 (false) 0 (false)

EML Syntax Reference

33

Example
$name != $x

Result
<Error>

Less-Than Operator

The syntax is:


expression < expression

The < (less-than) operator returns true (1) is the left-hand expression is less than the right hand expression, otherwise it returns false (0). The < operator is valid for numeric or string expressions. An error is produced if a string and a numeric expression are compared with each other. Example
$x < 2 $x > 3.04 $name < "atlanta.img" "abc" < "def" $x < $name

Result
0(false) 0(false) 0(false) 1(true) <Error>

Less-Than-Or-Equal Operator

The syntax is:


expression <= expression

The <= (less-than-or-equal) operator returns true (1) if the left-hand expression is less than or equal to the right-hand expression, otherwise it returns false (0). The <= operator is valid for numeric or string expressions. An error is produced if a string and a numeric expression are compared with each other. Example
$x <= 2 $x > = 3.04 $name <= "atlanta.img" "abc" <= "def" $x <= $name

Result
0(false) 1(true) 1(true) 1(true) <Error>

Logical-And Operator

The syntax is:


expression & expression

34

EML Syntax Reference

The & (logical-and) operator first truncates each expression to an integer value then it returns the bitwise logical-and of the two integers. This is commonly used for bit masking operations. The & operator is valid only for numeric expressions. An error is produced if either expression is not a number. Example
$x&255 $x&2 $path&255

Result
3 2 <Error>

Logical-Or Operator

The syntax is:


expression | expression

The | (logical-or) operator first truncates each of is arguments to an integer value then it returns the bitwise logical-or of the two integers. This is commonly used for bit setting operations. The | operator is valid only for numeric expressions. An error is produced if either expression is not a number. Example
$x|255 $x|2 $path|255

Result
255 3 <Error>

Modulus Operator

The syntax is:


expression mod expression

The mod (modulus) operator returns the remainder of the left-hand expression divided by the right-hand expression. The mod operator is valid only for numeric expressions. An error is produced if either expression is not a number. Example
$x mod 2 $path mod 2

Result
1.04 <Error>

Multiplication Operator

The syntax is:


expression * expression

EML Syntax Reference

35

The * (multiplication) operator returns the numerical product of the two expressions. Multiplication is valid only for numeric expressions. An error is produced if either operand is not a number. Example
$x*2 2*$path $x*$path

Result
6.04 <Error> <Error>

Negation Operator

The syntax is:


- expression

The - (negation) operator multiplies the expression by -1. The negation operator is valid only for numeric expressions. An error is produced if a string expression is used. Example
-$x -$name

Result
-3.04 <Error>

Part Message Operator

The syntax is:


$part.string[(arg1, [arg2, arg3...]) ]

The . (part message) operator sends messages to parts with optional arguments and returns the results. The available messages are documented with each part.

Subtraction Operator

The syntax is:


expression - expression

The - (subtraction) operator returns the numerical difference between two expressions. Subtraction is valid only for numeric expressions. An error is produced if either operand is not a number. Example
$x-1 1-$x $path-$name

Result
2.04 -2.04 <Error>

Value-Of Operator

The syntax is:


$variablename

36

EML Syntax Reference

The $ (value-of) operator returns the value of the named variable. Variable Name
$inputfile $path $name

Value
data/atlanta.img data/ atlanta.img

Functions

In addition to operands EML expressions may contain function calls. A function operates on zero or more arguments and returns a result which may be either numeric or string. The type of arguments and the type of the result depends upon the individual function. The syntax for a function is:
functionname ( [expression [,expression...]])

When EML encounters functionname it first checks to see if the name is the name of a built-in function. If it is then the function is called with the arguments and the result is returned. If the name is not the name of a built-in function then EML checks to see if it is an application function. If it is an application function then the application function is called. If the function is not a built-in function or an application function then the message "functionname" is delivered to the source of the script with the function arguments. If the message cannot be delivered then an error is returned.

Application Functions

The ApplicationFunctions DLL Class provides additional application functions and the ability to create new application functions that are available to all applications. Application functions that are provided by an application program are available only to that application. This type of application function is described in Translation Tables and Application Functions.

Built-In Functions
BANDLIST Function

EML provides a set of functions which are available across all applications, these are called built-in functions. The following lists the built-in functions and describes the operation of each one. The syntax is:
bandlist ( expression )

EML Syntax Reference

37

The bandlist function attempts to open the IMAGINE image file named by the argument and to return the list of names of the layers in the file. If the file does not exist, is not an image file, or if the expression is numeric, then an error is returned. Example
bandlist("mobbay.img")

Result
":Layer_1",":Layer_2",":Layer_3",":L ayer_4" <Error>

bandlist($x)

BOTTOM Function

The syntax is:


bottom ( framepart )

The bottom function assumes that the argument names either a frame or a framepart. It returns the bottom most coordinate of the named part. If the argument is not a framepart then an error is returned. Example
bottom(okbutton) bottom(dialogframe) bottom($x)

Result
21.0 200 <Error>

CDMOUNTUTIL Function

The syntax is:


cdmountutil ( )

The cdmountutil function is used to display the CDROM Mounting utility which is used to mount and unmount CDROMs which are configured in IMAGINE. If the function completes successfully then the name of the mount point is returned as a string. If it fails or if the user cancels the dialog an EMPTY value is returned.

CEIL Function

The syntax is:


ceil ( expression )

The ceil function computes the mathematical ceiling of a floating-point number. The ceiling is the next integer that is greater than (or equal to) the number. The argument must be a numeric expression; if a string is used then an error is produced. The argument is assumed to be in degrees. Example
ceil(3.14159)

Result
4

38

EML Syntax Reference

Example
ceil(-1.5) ceil(2.0) ceil($name)

Result
-1 2 <Error>

COS Function

The syntax is:


cos ( expression )

The cos function computes the mathematical cosine of its argument. The argument must be a numeric expression; if a string is used then an error is produced. The argument is assumed to be in degrees. Example
cos($x) cos(45) cos($name)

Result
.998529 .70710678 <Error>

ERROR Function

The syntax is:


error( expression )

The error function is used to display an error message. The argument is the message that will be displayed in the error dialog. The error dialog will remain up until the user dismisses it. See the warning and message functions for other types of dialogs that can be displayed.

EXP Function

The syntax is:


exp ( number )

The exp function computes the exponentiation of a specified number. The exponentiation is the result of raising the constant "e" to the power of the specified number. It is the inverse of the log function.

FEXIST Function

The syntax is:


fexist ( expression )

The fexist function tests to see if the file named expression exists. The argument must be a string. If the argument is numeric then an error is returned. If the named file exists then a 1(true) is returned, otherwise a 0 (false) is returned. Examples
fexist($name)

Result
1(true)

EML Syntax Reference

39

Examples
fexist($x)

Result
<Error>

FEXT Function

The syntax is:


fext ( expression )

The fext function extracts the extension portion from a filename string. The extension is the very last characters of the filename which follow the period (.) character. The extension is typically used to indicate file type. If the argument is numeric then an error is returned. Example
fext("/data/atlanta.img") fext("atlanta.img") fext($inputfile) fext($x)

Result
".img" ".img" ".img" <Error>

FLOOR Function

The syntax is:


floor ( expression )

The floor function computes the mathematical floor of a floating-point number. The floor is the closest integer that is less than (or equal to) the number. The argument must be a numeric expression; if a string is used then an error is produced. Example
floor(3.14159) floor(-1.5) floor(2.0) floor($name)

Result
3 -2 2 <Error>

FMT Function

The syntax is:


fmt ( number, format)

40

EML Syntax Reference

The fmt function is used to format numbers. It converts the number argument (which must be a number) into a string using the format control string. The format control string must contain a valid formatting string as described in Number Formatting . The result of the function is a string. Example
fmt(3.04, "0%") fmt($x, "0.000") fmt($name, "0") fmt($name, $x)

Result
"304%" "3.040" <Error> <Error>

FNAME Function

The syntax is:


fname ( expression )

The fname function extracts the name component of a filename from a string. The name component of a filename is that part which names the file, independent of the location (path) of the file. This is typically the complete filename minus the directory part. An error is returned if the argument is numeric. Example
fname("/data/atlanta.img") fname("atlanta.img") fname($inputfile) fname($x)

Result
"atlanta.img" "atlanta.img" "atlanta.img" <Error>

FPATH Function

The syntax is:


fpath ( expression )

The fpath function extracts the path component of a filename from a string. The path component of a filename is the part of a filename which identifies where a file is located. This is typically a directory name. An error is returned if the argument is numeric. Example
fpath("/data/atlanta.img") fpath("atlanta.img")

Result
"/data/" ""

EML Syntax Reference

41

Example
fpath($inputfile) fpath($x)

Result
"data/" <Error>

FROOT Function

The syntax is:


froot ( expression )

The froot function extracts the root portion from a filename string. The root is the filename minus any path and extension. If the argument is numeric, then an error is returned. Example
froot("/data/atlanta.img") froot("atlanta.img") froot($inputfile) froot($x)

Result
"atlanta" "atlanta" "atlanta" <Error>

GETAOI Function

The syntax is:


getaoi ( )

The getaoi function displays a dialog which allows the user to select an Area Of Interest (AOI) from an existing AOI file or from the viewer.

42

EML Syntax Reference

The user interacts with this dialog to select an AOI. If None is selected, then the string "none" is returned when the user presses OK. It is up to the EML application to check for this special case. If File is selected, then the filelist displays a list of available .aoi files. The name of the selected file is returned when the user presses OK. If Viewer is selected, then the Viewer is queried for an AOI. If there is an AOI in the Viewer, then a temporary file is created and the name of the temporary file is returned when the user presses OK. Example
getaoi() getaoi()

Result
"county.aoi" "none"

GETCFG Function

The syntax is:


getcfg ( deviceclass, devicename, property )

The getcfg function gets information about a configured device from the configuration data base. The deviceclass names a class of devices such as "cdroms," "printers," "tapes," "hosts." These are the device classes presented in the configuration editor. The devicename specifies a particular device in a given class. The property is the name of one of the properties of that device as set using the configuration editor. Refer to Device Configuration Properties for a comprehensive listing. In the example below, this function is used to return the number of horizontal dots per inch configured for a particular printer. Example Result

getcfg("printers","versatec","densitywid 400 th")

GETDEVICELIST Function

The syntax is:


getdevicelist ( deviceclass )

The getdevicelist function is used to get the list of devices available in the system for the named device class. For example, it may be used to get the list of tape drives configured in the system. If the name of the device class is invalid or if there are no devices configured, then the function returns an empty list. The device classes are those supported by the configuration editor, such as "tapes," "cdroms," "hosts," and "printers." Example
getdevicelist("tapes")

Result
"host1:/dev/rmt0" "host2:/dev/rmt1"

EML Syntax Reference

43

GETENV Function

The syntax is:


getenv ( "environment_variable" )

The getenv command returns the value of the environment variable specified as the argument Example
echo "The value of IMAGINE_HOME is " getenv("IMAGINE_HOME")

GETFEATUREFIELDS Function

The syntax is:


getfeaturefields ( filename, layer, filetype, fieldtype )

This getfeaturefields function can be used to inquire for the names of attributes available in a given raster, vector, or annotation. Note: this does not return the values of these attributes. It supplies the names of the attributes that are available. Only a C program can get the attribute values.

argument
filename layer filetype

value
the name of the raster, vector, or annotation. the band number (applies for rasters only). the type of the file to inquire attributes for: raster - Directly readable raster format polycov - Arc/Info polynomial coverage linecov - Arc/Info line coverage pointcov - Arc/Info point coverage annotation - ERDAS .ovr file

fieldtype

the type of attributes to inquire for: any - all types of attributes number - numeric attributes (all but string) integer float complex string date

GETFILELIST Function

The syntax is:


getfilelist ( expression )

44

EML Syntax Reference

The getfilelist function uses the single argument as an expression which contains a wildcard to be used to search for filenames. All of the names which match the list are returned as a single set. The wildcard should include the full path of the files you are looking for, unless you know IMAGINE is running in the directory you wish to search. In a wildcard, asterisk (*) matches any number of characters, while question mark (?) matches exactly one character. Example
getfilelist("*.img") getfilelist("?.img")

Result
a.img b.img zone4.img a.img b.img

GETFILESINPATH Function

The syntax is:


getfilesinpath ( searchpath, expression )

The getfilesinpath function searches directories for files that match a wildcard. The search path is a colon-separated list of directories. The expression contains a wildcard to be used to search for filenames. All of the names which match the list are returned as a single set. The wildcard should not include the full path of the files you are looking for. In a wildcard, asterisk (*) matches any number of characters, while question mark (?) matches exactly one character Example
getfilesinpath("/data1:/data2", "*.img")

Result
/data1/a.img /data2/zone4.img

GETMAPPANELCOUNT Function

The syntax is:


getmappanelcount (mapname, printername, scale, indexpage, filetype, fileunits, dotsperunit, totalpixelsx, totalpixelsy)

This getmappanelcount function is used to determine the number of panels which would be required to produce a given map on a given device.

argument
mapname printername scale

value
the name of the .map file. the name of a configured printer. the scale at which the map would be printed. This is not the cartographic scale, it is a magnification factor; for example, a value of 2 would print a map twice as big as the original.

EML Syntax Reference

45

argument
indexpage

value
a flag which is set to 1 to include an index page and 0 to omit the index page. If the printer name is "file" then the rest of the arguments are used; otherwise, they are ignored. either "rgb" or "black." specifies the units of the output device: "inches" or "cm." specifies how many pixels per fileunit are to be assumed for the plot. specify the maximum number of pixels in each dimension to be assumed for the output file.

filetype fileunits dotsperunit totalpixelsx totalpixelsy

Example
getmappanelcount("test.map","file",1.0, 0.0, "rgb", "inches", 300, 8192, 8192)

Result
4

GETPREF Function

The syntax is:


getpref ( category, preferencename )

The getpref function provides an interface to IMAGINE Preference Database. The database contains a series of named preferences grouped into various categories. Refer to Preference Database for a comprehensive listing of category and preference names. The getpref function returns the value for a given preferencename in a given category. Example
getpref("eml","log_startup")

Result
"no"

getpref("eml","printer_command "lpr" ") getpref($x) getpref($name, $x) <Error> <Error>

GETRECODETABLEFILE Function

The syntax is:


getrecodetablefile ( filename )

The getrecodetablefile function displays a dialog which allows the user to create a recode table. The dialog looks like the following:

46

EML Syntax Reference

This is used in many Raster GIS operations which need to recode class values. If the Cancel button is pressed then an empty value is returned. This can be checked using the isempty() function. When OK is pressed the recode table is written to a simple ASCII file with one new class value per line. The file is created in the /tmp directory and is prefixed with the letters RCOD. The complete path is returned as the value of the function. Example Result

getrecodetablefile("lnsoils.im "/tmp/RCOD006820" g") getrecodetablefile("notfound") <Empty>

GETSCREENNUMBER Function

The syntax is:


getscreennumber ( )

The getscreennumber function will return the number of the screen in which the EML script is running. This is zero for all single-screen displays.

GETSTRINGHEIGHT Function

The syntax is:


getstringheight ( expression )

The getstringheight function will compute the height (in screen pixels) of a string. The argument is the string to be measured.

EML Syntax Reference

47

GETSTRINGWIDTH Function

The syntax is:


getstringwidth ( expression )

The getstringwidth function will compute the width (in screen pixels) of a string. The argument is the string to be measured.

GETTAGGEDDATA Function

The syntax is:


gettaggeddata ( filename, tagname, default )

The gettaggeddata function is used to retrieve a tagged value from a tag file. A tag file is simply a text file which contains one or more lines of the form:
name: data;

The name may be any character string excluding spaces, tabs, and colons. The data is all of the information past the colon and up to but not including the semi-colon. If the semi-colon is excluded then the data includes all of the characters up to but not including the end of the line. Additionally characters included in the comment delimiters /* and */ are ignored. There is a limit of 256 characters for name and data. The function works by scanning the file named filename for a line beginning with the tagname. If a match is found then the data is returned. If no match is found or if the file cannot be located the default value is returned. For the following example, assume there exists a file named "importtif.tag which looks like:
/* * * T hi s f il e c on t ai ns in fo r ma t io n a bo ut th e t if f i mp o rt * * p ro gr a m wh i ch is u s ed b y t h e im p or t s cr i pt s. */ e xt e ns io n : "* . TI F "; s ou r ce : " fi le " ;

Example
gettaggeddata("importtif.tag", "extension", ".XYZ")

Result
"*.TIF"

GETTEXT Function

The syntax is:


gettext ( expression )

48

EML Syntax Reference

The gettext function displays a dialog that prompts the user to enter a text string. The argument is the prompt string that will be presented to be user. If a string is entered and OK is pressed then the contents are returned. If cancel is pressed then an empty value will be returned.

HEIGHT Function

The syntax is:


height ( part )

The height function assumes that the argument names either a frame or a framepart. It returns the height of the named part. If the argument is not a part then an error is returned. Example
height(okbutton) height(dialogframe) height($x)

Result
20.0 100 <Error>

ISBATCHON Function

The syntax is:


isbatchon ( )

The isbatchon function returns a value of true if the system is currently in batch mode. Batch mode is entered by using the Start Batch menu option under the Session menu on the IMAGINE icon panel. When batch mode is on, commands which actually perform processing must be placed into the batch queue. This function would be used in an EML file to determine whether to perform an action now or to defer it until later. Example
isbatchon()

Result
true

ISEMPTY Function

The syntax is:


isempty ( expression )

The isempty function tests to see if the argument is empty. If the argument is empty (has no value) then a 1(true) is returned, otherwise a 0 (false) is returned. Any variable which has not been assigned a value is empty. Example
isempty($x) isempty($name)

Result
0(false) 0(false)

EML Syntax Reference

49

Example
isempty("")

Result
1(true)

ISLICENSED Function

The syntax is:


islicensed ( modulename )

The islicensed function checks to see if there is a license available for the named module. The module name must be a string. This should be used with caution since it does consume a license. Example
islicensed("imvista")

Result
1(true)

ISNUMBER Function

The syntax is:


isnumber ( expression )

The isnumber function tests to see if the argument is a number. If the argument is a number then a 1(true) is returned, otherwise a 0 (false) is returned. Until a variable has been assigned a value, it is neither a string nor numericit is empty. Example
isnumber($x) isnumber($name)

Result
1(true) 0(false)

ISSTRING Function

The syntax is:


isstring ( expression )

The isstring function tests to see if the argument is a string. If the argument is a string then a 1(true) is returned; otherwise a 0 (false) is returned. Until a variable has been assigned a value, it is neither a string nor numericit is empty. Example
isstring($x) isstring($name)

Result
0(false) 1(true)

LEFT Function

The syntax is:


left ( part )

50

EML Syntax Reference

The left function assumes that the argument names either a frame or a framepart. It returns the left most coordinate of the named part. If the argument is not a part then an error is returned. Example
left(okbutton) left(dialogframe) left($x)

Result
10.0 100 <Error>

LOG Function

The syntax is:


log ( number )

The log function computes the natural logarithm of the specified number. The natural logarithm is the number "x", such that the constant "e" raised to the power of "x" yields the specified number. It is the inverse of the exp function.

LOG10 Function

The syntax is:


log10 ( number )

The log10 function computes the base-10 logarithm of the specified number. The base-10 logarithm is the number "x" such that 10 raised to the power "x" equals the specified number.

LOWERCASE Function

The syntax is:


lowercase ( string )

The lowercase function returns a value by converting all of the characters in the string argument to lowercase. Example
lowercase("aBcD")

Result
"abcd"

MAPCREATE Function

The syntax is:


mapcreate ( )

The mapcreate function displays a dialog which allows the user to describe the basic parameters of a Map Composition that the user wishes to create. If the user selects OK, then a Map Composer window is opened for further editing.

EML Syntax Reference

51

MAPPRINT Function

The syntax is:


mapprint ( [expression] )

The mapprint function displays a dialog which allows the user to control various options for printing a Map Composition. If the user selects OK, then the Map Composer will be printed. The expression, which is optional, specifies the full path of the Map Composition to be printed. If the name is omitted, the user will be prompted for the Map Composition to be printed. The mapprint function is identical to the mapprintdelete function, only mapprint does not delete the map composition after printing.

52

EML Syntax Reference

MAPPRINTDELETE Function

The syntax is:


mapprintdelete ( [expression] )

The mapprintdelete function displays the same dialog as mapprint. The mapprintdelete function is identical to the mapprint function, only mapprintdelete will set the option to delete the map composition after printing. This option can be overridden with the Delete Map File after Printing toggle button on the Options tab.

MEMBERCOUNT Function

The syntax is:


membercount ( expression )

The membercount function returns the number of members in the given set. An expression typically has just one value, but several of the functions return expressions with multiple values. For example, bandlist returns a list of the names of the bands in a file. Example Result

membercount(bandlist("mobbay.i 4 mg") membercount($x) 1

MESSAGE Function

The syntax is:


message ( expression )

EML Syntax Reference

53

The message function is used to display an informational message. The argument is the message that will be displayed in the message dialog. The message dialog will remain up until the user dismisses it. See the warning and error functions for other types of dialogs that can be displayed

QUOTE Function

The syntax is:


quote ( expression )

The quote function adds double quotes ("") around its argument. If the argument is not a string, then an error occurs. This is used to place quotes around strings like filenames which contain characters such as / which may be delimiter characters to other parts of the system. Example
quote($name) quote($x)

Result
""atlanta.img"" <Error>

REMOVECHARS Function

The syntax is:


removechars ( list, characters )

The removechars function removes the indicated characters from each of the items in the given list. This can be used to build and manipulate lists which are derived from file lists. Example
removechars("importtif", "import")

Result
"tif"

RIGHT Function

The syntax is:


right ( part )

The right function assumes that the argument names either a frame or a framepart. It returns the right most coordinate of the named part. If the argument is not a part then an error is returned. Example
right(okbutton) right(dialogframe) right($x)

Result
20.0 100 <Error>

54

EML Syntax Reference

RPCSEND Function

The syntax is:


rpcsend(hostname, programnumber, version, process, message)

or
rpcsend(process, message)

The rpcsend function uses the RPC mechanism to send a single text message to an rpc application. The result (which must be a text string) is returned as the value of the function.

SAVEGLOBALPREF Function

The syntax is:


saveglobalpref()

The saveglobalpref function will save the change made by setpref() immediately to the global preference database file; <IMAGINE_HOME>/defaults/v8preference. For example, C:\Program Files\ERDAS\Geospatial Imaging 9.3\defaults\v8preference.

SAVEUSERPREF Function

The syntax is:


saveuserpref()

The saveuserpref function will save the changes made by setpref() immediately to the user preference database file; $HOME\.imagine[version]\v8preference. For example, C:\Documents and Settings\Smith\.imagine930\v8preference.

SCREENNUMBER Function

The syntax is:


screennumber ( )

The screennumber function returns the number of the screen from which the script was executed. This number is usually 0. However, on systems with multiple heads, EML supports multiple screens. EML numbers the screen 0, 1, 2, etc. Example
screennumber()

Result
0

SETPREF Function

The syntax is:


setpref(category, preferencename, value)

The setpref function provides an interface to the IMAGINE Preference Database. The database contains a series of named preferences grouped into various categories. Refer to Preference Database for a comprehensive listing of category and preference names. The setpref function sets the value for a given preferencename in a given category. For example, if you want to change the default horizontal size for the IMAGINE viewer, you can use the following command:
setpref("viewer","window_xsize", 345);

EML Syntax Reference

55

For more details about arguments cateory and perferencename, refer to the actual preference database file for the category of interest. In this case, check <IMAGINE_HOME>\defaults\viewer.pdf.

SIN Function

The syntax is:


sin ( expression )

The sin function computes the mathematical sine of its argument. The argument is interpreted as degrees. The argument must be numeric. If the argument is not numeric then an error is produced. Example
sin($x) sin(45) sin($name)

Result
5.30331E-2 .70710678 <Error>

SORT Function

The syntax is:


sort ( list )

The sort function returns a sorted version of the list which is given to it. The list may consist of numeric or character elements. The sorting is in ascending order. Example
sort({1, 5, 3}) sort({"B", "C" ,"A"}) sort({"C", 2 ,"A"})

Result
1 3 5 "A" "B" "C" 2 "A" "C"

SORTBYFILENAME Function

The syntax is:


sortbyfilename ( list )

The sortbyfilename function returns a sorted version of the list of file names which is given to it. The sorting is in ascending order, and it is based upon the file name part of each item, not the path in which the file exists. For instance, "/tmp/B.img" would appear after "/vol/A.img", and "Z.img" would appear last.

SPLITSTRING Function

The syntax is:


splitstring ( token, string )

56

EML Syntax Reference

The splitstring function splits the input string into a list, using any of the characters in token as delimiters. Example
splitstring(":", "/tmp:/data1:xx") splitstring(":a", "/tmp:/data1:xx")

Result
"/tmp" "/data1" "xx"

"/tmp" "/d" "t" "1" "xx"

SYSTEM Function

The syntax is:


system ( command [, arg ...] )

The system function invokes a system command and returns the completion status of the command. There must be at least one argument which is the name of the command to execute. Any number of additional arguments may be passed to the command. There is an equivalent system command which runs the command but does not return any status. Example
system("rm", "mobbay.img") system()

Result
1 <error>

TAN Function

The syntax is:


tan ( expression )

The tan function computes the mathematical tangent of its argument. The argument is assumed to be in degrees. The argument must be a numeric expression. If a string is used then an error is produced. Example
tan($x) tan(45) tan($name)

Result
5.3107 1 <Error>

TOP Function

The syntax is:


top ( part )

EML Syntax Reference

57

The top function assumes that the argument names either a frame or a framepart. It returns the topmost coordinate of the named part. If the argument is not a part then an error is returned. Example
top(okbutton) top(dialogframe) top($x)

Result
20.0 100 <Error>

UPPERCASE Function

The syntax is:


uppercase ( string )

The uppercase function returns a value which is made by converting all of the characters in the string argument to uppercase. Example
uppercase("aBcDe")

Result
"ABCDE"

VERIFYSAVE Function

The syntax is:


verifysave ( expression )

The verifysave function displays a dialog which asks the user if they wish to save changes before closing an object. The argument is a prompt string that typically identifies the unsaved object that is about to be closed. The user makes their choice, and verifysave returns "yes", "no", "cancel" or an empty string if some unexpected condition occurs

WARNING Function

The syntax is:


warning ( expression )

The warning function is used to display a warning message. The argument is the message that will be displayed in the warning dialog. The warning dialog will remain up until the user dismisses it. See the error and message functions for other types of dialogs that can be displayed.

WIDTH Function

The syntax is:


width ( part )

The width function assumes that the argument names either a frame or a framepart. It returns the width of the named part. If the argument is not a part then an error is returned. Example
width(okbutton)

Result
20.0

58

EML Syntax Reference

Example
width(dialogframe) width($x)

Result
100 <Error>

WMBORDERWIDTH Function

The syntax is:


wmborderwidth ( )

The wmborderwidth function returns the width of the borders which the window manager places around frames. This is used to align frames on the screen. If an argument is given, an error is returned. Example
wmborderwidth() wmborderwidth($x) wmborderwidth("frame")

Result
5 <Error> <Error>

WMTITLEHEIGHT Function

The syntax is:


wmtitleheight ( )

The wmtitleheight function returns the height of the title areas which the window manager places at the top of frames. This is used to align frames on the screen. If an argument is given, an error is returned. Example
wmtitleheight() wmtitleheight($x) wmtitleheight("frame")

Result
5 <Error> <Error>

YESNO Function

The syntax is:


yesno ( expression )

The yesno function displays a dialog which asks the user a yes or no question. The argument is a string containing the question being asked. The user makes their choice, and yesno returns "yes" or "no". yesnocancel is similar to yesno, only yesnocancel also provides an option to cancel the operation that the question relates to.

YESNOCANCEL Function

The syntax is:


yesnocancel ( expression )

EML Syntax Reference

59

The yesnocancel function displays a dialog which asks the user a yes or no question, with the option to cancel the operation to which the question pertains. The argument is a string containing the question being asked. The user makes their choice, and yesnocancel returns "yes", "no", "cancel", or an empty string is an unexpected error occurs. yesno is similar to yesnocancel, but yesno does not let supply a cancel button.

Procedures

A procedure is a list of one or more statements which is used to initiate, modify, or control an operation. A script may consist of only a procedure, though an EML script typically consists of frame definitions with imbedded procedures. When a procedure is imbedded in a frame definition, it is as a message handler or a menu action specification.

Statements

There are four types of statements from which procedures are constructed: Compound Statements Variable Definition Statements Flow Control Statements Command Statements

Compound Statements

A compound statement is one or more statements contained in a pair of braces "{}". A compound statement can be used wherever a single statement may be used. A procedure may define local variables which are available only within the procedure. The syntax is:
variable name [= <expression>] ;

Variable Definition Statements

Variables defined in a procedure may only be accessed in that procedure. Plus, if the name is the same as that of a containing procedure then the current definition hides the external one. Example
component xyz { variable bob; /* this variable is available to any procedure within this component, except to those that contain their own declarations of bob */ on startup {

60

EML Syntax Reference

variable bob; /* this variable is available only to this procedure and the other bob is unavailable */ } }

Flow Control Statements

EML provides a number of constructs for controlling the flow of execution of statements in a script. Normally EML executes statements in a sequential order. This order may be modified by using the flow control statements. These include simple conditional branching (if...elsif...else) and looping structures. The syntax is:
exit;

EXIT Statement

The exit statement is used to exit from a loop. If the exit statement occurs outside of a loop it has no effect. Example
set x = 0; loop { echo "x is " $x; if ( $x > 10 ) exit; set x = $x + 1; }

FOREACH Statement

The syntax is:


foreach name in ( expression ) statement

The foreach statement provides a looping mechanism that allows the statement to be executed once for each member which results from the evaluation of the expression. During each iteration of the statement the current value from the expression is assigned to the temporary variable name. Example
foreach file in ( findfiles( "*.img") ) { echo "Working on file " $file; }

IF Statement

The syntax is:


if ( expression ) statement [ elsif ( expression ) statement ] . . [ else statement ]

The if statement allows control to pass through one of several paths in a script based on the result of one or more logical expressions.

EML Syntax Reference

61

Any of the statements may be a compound statement. That is, it may be a series of statements enclosed in braces "{}".
{statement; .; .; statement;}

Each statement may contain any number of elsif clauses but there may be, at most, one else clause. If the first expression is true, then the first statement is executed and control continues with the first statement after the else clause (if present). If the second expression is true, then the second statement is executed and control continues with the first statement after the else clause (if present). If none of the expressions are true, then the statement in the else clause is executed if the else clause is present. Example
if ( fexist ($name) ) echo "The file " $name "was found"; else { echo "The file " $name "was not found"; set name = ""; }

LOOP Statement

The syntax is:


loop statement

The loop statement is a very simple type of looping control which requires that the user provide a means of exit from the loop with the exit statement. The statement is executed continuously. The statement should be a compound statement which contains a test that conditionally executes the exit statement. Example
set x = 0; loop { echo "x is " $x; if ( $x > 10 ) exit; set x = $x + 1; }

RETURN Statement

The syntax is:


return expression ;

The return statement allows a procedure to return a value. The expression is evaluated and the result is returned as the value of the procedure. No further statements from the procedure are executed.

62

EML Syntax Reference

SWITCH Statement

The syntax is :
switch ( controlexpression ) { case testexpression1: statement case testexpression2 : statement : case testexpressionN : statement else : statement }

The switch statement provides an easy means of selecting one set of operations from many based on a single expression. First the controlexpression is evaluated and then its value is compared against each of the testexpressions. If the value of the controlexpression matches the testexpression then the associated statement is executed. If none of the testexpressions match, then the optional else statement will be executed. If there is no else then no statement will be executed. Example
switch ( $choice ) { case "file": echo "He chose file"; case "map" : echo "He chose map"; }

WHILE Statement

The syntax is :
while ( expression ) statement

The while statement provides a simple loop until a condition is met. The expression is evaluated and if the result is true then the statement is executed. This continues until the expression returns a false value. Example
variable x; set x = 0; while ( $x ) { echo "x is " $x; set x = $x + 1; }

Command Statements

A command is a statement of the form:


command [arg [arg...]] ;

There are three types of commands: Built-In commands (below) Application Commands Function Commands

EML Syntax Reference

63

The built-in commands are available across all applications, while the application commands and function commands are specific to one application.

Built-In Commands

This section describes the built-in commands supported by EML. Other built-in commands are discussed in the IMAGINE Command and Function Syntax on-line help under the Job Commands topic. The syntax is:
batchjobname name ;

BATCHJOBNAME Command

The batchjobname command is used to specify the name for the current batch job. The batch manager uses this name as the default job name when job submit dialog is brought up. If a batch job name is not specified using this command, then the batch manager uses "batch_job_1," "batch_job_2," etc.

CLOSE Command

The syntax is:


close comlog ; close statuslog ;

The close command closes one of the two output log files. If the argument is comlog then the command history file is closed and a new one is created using the default name. If the argument is statuslog then the Session Log file is closed and a new one is created using the default name derived from the Preference Data Base. Example
on mousedown { close comlog; close statuslog; }

COMLOG Command

The syntax is:


comlog logname ;

The comlog command renames the Session Log file. The Session Log is written to an output file whose name is initially derived from the Preference Data Base. This command renames the output file to logname. Example
on mousedown { comlog "/home/myname/session.log"; }

CONFIGURATIONEDITO R Command

The syntax is:


configurationeditor ;

The configurationeditor command invokes the configuration editor which is used to display and edit the currently configured devices in the system.

64

EML Syntax Reference

The configuration editor dialog looks like:

DISABLE Command

The syntax is:


disable part [ part ...];

The disable command disables a framepart so that the user may not interact with it. The part must be a string constant which names an existing framepart. This is often used to disable the OK button until valid inputs are present. When a framepart is disabled, the user cannot interact with it and it is displayed in a "grayed out" fashion to provide visual indication that the part is inactive. Example
on framedisplay { disable okbutton; }

DISPLAY Command

The syntax is:


display framename ;

EML Syntax Reference

65

The display command is used to display a frame if it is not currently displayed. This also sends the message "framedisplay" to the frame so that any message handlers for "on framedisplay" are executed. The framename argument must be the name of a frame or one of the two keywords described below. It cannot be an expression. If the framename is statuswindow then the Session Log is displayed. The Session Log displays the list of all commands, messages and errors with a time stamp on each line. The status log is an information log which simply provides a history of a users session. If the framename is commandwindow then the command history is displayed. The command history is a log of all commands which have been issued since the start of the current session. The command window also contains a text input box where commands may be entered. This is useful for learning the commands and for debugging scripts. Examples:
on mousedown { display inputrasterframe ; } on mousedown { display commandwindow ; }

ECHO Command

The syntax is:


echo [ arg [ arg ... ] ] ;

The echo command prints its arguments to the Session Log. There may be any number of arguments of either string or numeric type. A newline is printed after all of the arguments. This command is typically used to debug scripts. Example
echo "The chosen filename is " $filename ; echo "The layers in file " $filename " are " bandList ($filename) ;

ENABLE Command

The syntax is:


enable part [ part ...] ;

The enable command enables a framepart. If a framepart is disabled the user cannot interact with it and it is displayed in a "grayed out" fashion to provide visual indication that the part is inactive. This command enables the part so that the user may interact with it. The part must be a string constant which names an existing framepart. This is often used to enable the OK button when valid inputs are present. Example
on input { if ( fexist ($filename) ) enable okbutton; }

66

EML Syntax Reference

HELPOUTLINE Command HIDE Command

Obsolete in IMAGINE version 8.2.

The syntax is:


hide part [ part ...];

The hide command makes a frame or a framepart invisible. In this state it is still an active entity, but it is not visible and the user may not interact with it. This is most often used to allow one or more groups of frameparts to occupy a single position in a frame so that only the appropriate one is shown at any one time. The part must be a string constant which names an existing framepart. Example
on input { if ( $type == "A" ) { show agroup; hide bgroup; hide cgroup; } elsif ( $type == "B" ) { hide agroup; show bgroup; hide cgroup; } else { hide agroup; hide bgroup; show cgroup; } }

INSERTTEXT Command

The syntax is:


inserttext part expression ;

The inserttext command allows text to be inserted into the text of an edittext framepart. In an edittext part there is always a current insertion point. It is typically indicated by a flashing cursor. This function allows text to be inserted at the current insertion point. The command does more than a simple insertion though. It first scans to the left and right of the insertion point looking for bounding angle brackets, "<>". If it finds that the current insertion point is bracketed by a pair of angle brackets, it then replaces the text between the brackets (including the brackets) with the text of the expression. If no angle brackets are found, then it simply inserts the expression at the cursor position. If a primary selection is made on a portion of text in the edittext part, this function replaces the text in the primary selection with the text in the expression. The following illustrations show the edittext framepart before and after an insertion made by the example code. The insertion point is indicated by a vertical bar. Example

EML Syntax Reference

67

on mousedown { inserttext formulapart "$Histogram" ; }

before

abs(<a>)

Insertion point

after

abs($Histogram)

JOB Command

The syntax is:


job name [ arg [ arg ...] ];

The job command is used to execute an application as a job. Each arg may be a string or number expression which is evaluated and then used as an argument for the application specified by name. The name argument must be a string. If Batch Mode is in effect, the command and its arguments are placed into the batchlist to be executed at a later time. If Batch Mode is not in effect, the application is executed immediately and a Job Status Box is displayed to track the progress of the job. The Job Status Box looks like:

This box is displayed as soon as the application is started. The name of the application appears as the title of the box. Since each job may have several phases, Job State is used to indicate the current state of the application. The Percent Done bar indicates the percent completion of the current state. The user may click on the Cancel button at any time to terminate the job. When the job completes, either due to termination or due to normal completion, the Done button is enabled to signal that the job is complete. Clicking on the Done button at this time removes the Job Status Box.

68

EML Syntax Reference

Example
on mousedown { job resample $inputfile $outputfile -s $scalefactor ; }

LOAD Command

The syntax is:


load macroname ;

The load command loads an EML Macro. When the macro has been loaded into memory EML sends it the "startup" message. The macro should have a "startup" message handler which displays the initial frame. If it does not have a "startup" message handler then nothing happens. The macro must use the unload command to remove the macro from memory. If the macro is still in memory, then the load command simply sends the "startup" message to the macro; it does not load a duplicate copy of the macro.

LOGMESSAGE Command

The syntax is:


logmessage level message [, message...] ;

The logmessage command places a message in the session log. This can also be used to place comments into the Session Log. Level must be "level0" or "level1". All level1 messages are logged. Level0 messages are logged only when verbose is selected for Log Message Level in the eml Preferences.

MOVE Command

The syntax is:


move frame x y ;

The move command repositions a frame on the screen. The frame is repositioned to the location specified by x and y expressions. The frame argument must be the name of a frame and may not be an expression. The x and y arguments may be any numeric expression. The x and y values are interpreted as pixel position with 0 0 as the upper left most pixel on the display. Example
on mousedown { move iconpanel 100 0; }

PLAY Command (Sun Systems Only)

The syntax is:


play filename [, filename ... ] ;

The play command sends a Sun Audio file to the audio device. This can be used to add sound to applications on the Sun Workstation. It simply sends the named file to the audio device (/dev/audio).

PREFERENCEEDITOR Command

The syntax is:


preferenceeditor ;

EML Syntax Reference

69

The preferenceeditor command displays the Preference Editor. The Preference Editor is used to display and edit the values of the system preferences. The dialog is shown on the following page. The Menu Bar is used to save the preferences and to quit the editor. The Status Bar shows a short explanation of each preference. category is a popup list of all the categories which are available. The preference values are displayed in a scrollable area so that they may be viewed and edited. Example
on mousedown { preferenceeditor; }

Menu bar

Left-click to see popup list

Status Bar

QUIT Command

The syntax is:


quit;

The quit command causes the termination of the EML interpreter. This command takes no arguments and causes immediate termination of the EML application. Example

70

EML Syntax Reference

on mousedown { quit; }

REFLOW Command REFRESHLIST Command

Obsolete in IMAGINE version 8.2. The syntax is:


refreshlist filenamepart [, filenamepart ...] ;

The refreshlist command updates the list of files displayed in a filename framepart. One or more filename parts may be named. Each named filename framepart is updated.

RESIZE Command

The syntax is:


resize frame width height ;

The resize command changes the size of a frame. The frame must be the name of a frame. If frame is an expression, then an error is produced. The width and height are numeric expressions which are used to specify the new width and height of the given frame. Example
on mousedown { resize iconpanel 50 200 ; }

The part MUST be inside the non-resizable dialog frame. If the part is in a resizable dialog the results will be unpredictable

SEND Command

The syntax is:


send message [ to destination ] [ with arg [ arg ... ] ];

The send command delivers a message to a destination. Messages are typically generated and delivered by the core of the EML system in response to user input events. However, messages may be explicitly generated and delivered using the send command. The message argument must be a string. There are standard messages which are created and delivered by the system in response to user input and other actions, these are detailed in Event Messages. However, any string may be used as a message.

EML Syntax Reference

71

The to clause specifies the destination frame or framepart. The message is delivered to the named destination. If no destination is given then the message is delivered to the source of the script. This is usually the framepart to which the script belongs. If the destination is of the form name then the message is sent to a part of the given name at the current level. That is, if the command occurs in a script in a frame then the message will be sent to a part in the current frame. If the destination is of the form component:frame:name then the message will be sent to the part named in the given component and frame. This mechanism will not work across processes. The with clause specifies a list of one or more arguments which are to be sent along with the message. The arguments may be string or numeric expressions. It is up to the message handler to use these arguments. Example
on doubleclick send mousedown to okbutton;

See also the on attribute and the receive attribute.

SET Command

The syntax is:


set destination = expression ; set destination[index] = expression ;

The set command is used to assign a value to a variable or to a framepart. Before a variable is assigned a value, it is empty. An assignment statement determines the type of variable dynamically. The second form can be used to assign values to specific locations, treating the variable or part like an array. If the variable or part is not currently big enough to accommodate the given index it will be extended with empty values before the assignment takes place. The index expression must evaluate to a positive number. The first location in the array is 1. If the destination refers to a variable then value of the expression is placed into the named variable. If the destination refers to a framepart, the value of the expression is placed into the framepart, the framepart is updated on the screen (if it is visible), and the message valuechanged is sent to the framepart. If the destination is of the form name then the value is assigned to a part or variable of the given name at the current level. That is, if the assignment occurs in a script in a frame then the value will be assigned to a part or variable in the current frame. If the destination is of the form component:frame:name then the value will be assigned to the part or variable named in the given component and frame. This mechanism will not work across processes.

72

EML Syntax Reference

If there is an message handler for "valuechanged" attached to that part, it is executed upon receipt of the message. Example
set x = 4; set x = $name; set x = 2 * $x; set x = $name + "_2"; set fname = "/data/atlanta.img"

Result
The value of the variable x is set to 4. The value of the variable x is set to the value of the variable name. The value of the variable x is set to two times its previous value. If $name is "data_set", then the value of the variable x is set to "data_set_2". Assuming that fname is a filename framepart then the value of the part is set to "/data/atlanta.img".

SHOW Command

The syntax is:


show part [ part ...];

The show command makes a frame or a framepart visible. Frames and framepart may be made invisible. In this state it is still an active entity but the user may not interact with it and it is not visible. This is most often used to allow one or more groups of frameparts to occupy a single position in a frame so that only the appropriate one is shown at any one time. The part must be a string constant which names an existing framepart. Example
on input { if ( $type == "A" ) { show agroup; hide bgroup; hide cgroup; } elsif ( $type == "B" ) { hide agroup; show bgroup; hide cgroup; } else { hide agroup; hide bgroup; show cgroup; } }

SHOWHELP Command

The syntax is:


showhelp [component frame];

EML Syntax Reference

73

The showhelp command displays help from the On-Line Help data base. It requires two arguments, a component and a frame, both of which must be strings. The On-Line Help system is organized into application manuals. The component and frame are used to construct the name of a hypertext link which is used to locate and display the appropriate page of on-line help text. If no arguments are given, the current (calling) component and frame are used. This is how the Help button on a dialog is usually connected to On-Line Help. If you wanted to connect to the help file of another dialog, you must use a command as in the example below. Example
on mousedown { showhelp "viewer" "openrasterlayer"; }

SHOWVERSION Command

The syntax is:


showversion ;

The showversion command displays a frame which gives the current version of IMAGINE. The version dialog looks like:

SPAWN Command

The syntax is:


spawn name [, arg...] ;

The spawn command starts a separate copy of an application, shell script, or other executable. Refer to Starting Processes for descriptions of this and other commands. Example
button viewB { title "View..."; below ok; size 6,1.5; on mousedown spawn editor $cname; }

STARTBATCH Command

The syntax is:


startbatch ;

74

EML Syntax Reference

The startbatch command begins multiple job batch mode. When multiple job batchmode is in effect, all jobs specified by the job command are placed into a queue. When batch mode is terminated, a dialog is displayed which allows the user to defer execution of the list of commands to a later time. The list of batch jobs may be displayed and edited using the viewbatchlist command. On UNIX systems, this is accomplished by using the cron utility. Example
on mousedown { startbatch ; }

STARTBATCHSINGLE Command

The syntax is:


startbatchsingle ;

The startbatchsingle command begins single job batch mode. When single job batch mode is in effect, the next job specified by the job command is placed into the batch queue and the user is queried for the time at which the job is to start. The batch queue may be viewed and edited using the viewbatchlist command. On UNIX systems, the batch queue is implemented using the cron utility. Example
on mousedown { startbatchsingle; }

STATUSLOG Command

The syntax is:


statuslog name ;

The statuslog command renames the command history file. The Session Manager writes all commands to a log file called the command history. The name of this file is initially derived from the Preference Data Base, but this command can be used to change the name of the command history file to name. Example
on mousedown { statuslog $outfilename ; }

STOPBATCH Command

The syntax is:


stopbatch ;

The stopbatch command terminates the batch job mode. When batch job mode is terminated all of the job commands in the job queue are submitted to the batch queue. A dialog is displayed which lets the user pick the time at which the jobs are executed. The batch queue may be viewed and edited with the viewbatchlist command.On UNIX systems the batch queue is implemented using the cron utility. Example

EML Syntax Reference

75

on mousedown { stopbatch ; }

SYNCJOB Command

The syntax is:


syncjob name [ arg [ arg ...] ];

The syncjob command is used to execute an application synchronously as a job. Unlike the job command which does not wait for the completion of the job this command places the script into a suspended state which will resume when the task completes. Each arg may be a string or number expression which is evaluated and then used as an argument for the application specified by name. The name argument must be a string. If Batch Mode is in effect, the command and its arguments are placed into the batchlist to be executed at a later time. If Batch Mode is not in effect, the application is executed immediately and a Job Status Box is displayed to track the progress of the job. The Job Status Box looks like:

This box is displayed as soon as the application is started. The name of the application appears as the title of the box. Since each job may have several phases, Job State is used to indicate the current state of the application. The Percent Done bar indicates the percent completion of the current state. The user may click on the Cancel button at any time to terminate the job. When the job completes, either due to termination or due to normal completion, the Done button is enabled to signal that the job is complete. Clicking on the Done button at this time removes the Job Status Box. Example
on mousedown { syncjob resample $inputfile $outputfile -s $scalefactor ; Message("The resample is done"); }

SYSTEM Command

The syntax is:


system command [ arg ...] ;

76

EML Syntax Reference

The system command indicates that the arguments following it are to be passed to the UNIX shell for execution. The Script Interpreter evaluates the contents of any variables or expressions and passes all arguments to a new shell and waits for the command to terminate before continuing. There is an equivalent system() function which runs the command and returns the completion status as the value of the function. Refer to Starting Processes for descriptions of this and other commands. Example
on mousedown { system rm $infilename ; }

UNDISPLAY Command

The syntax is:


undisplay frame ;

The undisplay command removes a frame from the display. The frame must be a string constant which names an existing frame. When the command is executed the name frame is undisplayed. If frame is commandwindow then the session log frame is removed. If frame is statuswindow then the command history frame is removed. Example
on mousedown { undisplay statuswindow; }

UNLOAD Command

The syntax is:


unload ;

The unload command removes a macro from memory. This should always be part of a macro which is to be loaded with the load command.

VIEWBATCHLIST Command

The syntax is:


viewbatchlist ;

The viewbatchlist command displays the Batch Editor. The Batch Editor allows the user to view and edit the list of batch files which are currently in the system batch queue. Example
on mousedown { viewbatchlist ; }

EML Syntax Reference

77

Application Commands

The EML script interpreter can send application commands to the currently running applications. When the script interpreter encounters a command name, it first checks to see if that command is a built-in EML command. If the command name is not one of those listed in the command names table, it then looks up the application commands list supplied by the calling application. If the above fails, it assumes the command name is the name of an IMAGINE application. If the application is already running, it sends any arguments to the application. If the application is not running, it tries to start the application with the arguments. The following EML script code starts the IMAGINE Viewer and opens a Viewer window.
on mousedown { viewer create at 10 10 size 200 300; }

The description and syntax of IMAGINE application commands are provided in the IMAGINE Command and Function Syntax on-line help under the Application Commands topic.

Function Commands

An application function may be used like a command when it is not embedded in an expression. For example:
on valuechanged processdata ($dataformat);

The description and syntax of IMAGINE function commands are provided in the IMAGINE Command and Function Syntax on-line help under the Function Commands topic.

Components

All GUI elements in an EML script are contained in a Component. The component is simply a means of collecting one or more GUI objects into a single named group. Components may contain one or more of the following elements: Variable Definitions Menu Definitions TextString Definitions Message Handlers Attribute Definitions Frame Definitions

78

EML Syntax Reference

The syntax is:


component name { [ [ [ [ [ [ [ [ [ font fontname; ] titleplacement titleposition ; ] foreground color ; ] background color ; ] variable name ; ] global name ; ] menu ] textstring name string ; ] on message with arg [ arg ...] do

procedure ] procedure ] }

[ on message ( arg [, arg...] ) [ frame ]

The font, titleplacement, foreground and background attributes of the component apply to each of the frames defined within the component. This gives a simple way of setting, for example, the background color for all of the frames defined in one component. Each of these attributes may be overridden by a similar one given at either the frame or framepart level. Variables defined at the component level are available to all procedures, menus and frames defined in the component. Global variables are available across applications. Menus defined at the component level do not automatically appear anywhere. They can only be accessed within an application using C Toolkit functions. These are typically used to define popup menus which are used in an application. The textstring keyword allows a name to be associated with a text string. This is also a feature which is used only at the C Toolkit level. This allows an application to have access to text strings which can be modified by the user. An application can query the EML script for the value of a string by its name. These are used for status messages in many cases. The message handlers defined at the component level with the on attribute are available to all of the menus and frames in the component. The following standard messages are delivered to the component. Message(s) Delivered
startup restart

Event/Action
When the script is read into memory. When at attempt is to reread the script into memory.

EML Syntax Reference

79

Menus

The menu system in EML allows both pulldown and popup menus to be created. Pulldown menu definitions may appear as attributes in frames and popup menu definitions may appear as stand-alone items in a component. The syntax of a menu is:
menu menuname menutitle [info string] { [ separator; ] [ itemname itemtitle [info string] procedure [closeaction]]; [ itemname itemtitle [info string] checkbox procedure [value];] [ itemname radiogroup { radioname radiotitle [info string] [, radioname radiotitle [info string]... ] } procedure [ value ]; ] [ menudefinition ] }

Every menu has a name which is expressed by the menuname argument. The menuname argument is a simple character constant. The menutitle argument is the string which is displayed to the user when the menu is displayed. The menu then consists of a series of zero or more menu items enclosed between a pair of braces {}. Each menu item can be one of the five types described below. The first type of item is a separator. This simply produces an entry in the menu which is displayed as a horizontal line. The separator is used to provide a visual separation between different parts of a menu. There is no user interaction with this item in a menu. The second type of menu item executes an EML procedure when the menu item is chosen. The itemname argument is used to assign a name to the menu item, while the itemtitle argument determines the title string that the user sees. The procedure may be any number and type of EML statements. If closeaction is specified, then this is the menu item which closes the dialog. The third type of menu item has a checkbox on the left-hand side. This is used to create a menu item which has a state that can be toggled by selecting the item. The itemname is used to assign a name to the menu item, while the itemtitle is used to determine what the user sees. The procedure is any sequence of EML commands which is executed along with the current value of the item when the menu item is selected. The initial state of the item is determined from the value expression.

80

EML Syntax Reference

The fourth type of menu item creates a radiogroup which consists of one or more menu entries each with a radio button displayed to the left of it. Within this group of items only one may be checked at a time. This allows a menu to be used to select between one of a number of choices. The itemname is used to assign a name to the set of menu items. Each one of the items in the radiogroup has its own name, radioname and its own title, radiotitle. Whenever one of the members of the radiogroup is selected, the specified procedure is executed with the current value of the group (the value of radioname) contained in the variable menuvalue. The initial value of the radiogroup menu item is determined by the optional value expression. If no value expression is given, the first item in the group is selected. EML provides a pseudo-variable called menuvalue which may be used in any procedure within a menu definition. The value of the variable depends upon the type of menu item in which the procedure was defined. For checkbox menu items the value is 0 or 1. For radiobutton menu items the value is the radioname of the selected radiomenu item. For other menu items, the value is undefined. Therefore $menuvalue should only be used in checkbox and radiogroup menu items. The fifth type is simply a nested menu definition consisting of a menu declaration and any of the four types of menu items described above. This creates a submenu which is called a pull-right menu, because when the user selects this item, a child menu is displayed to the right of the parent. Menus may be nested to any level, though it is not a good idea from a user interface design point of view to exceed two levels.

Menu Item Titles

All of the menu items have a title associated with them. This title may be a simple string or it may have some special characters embedded in it which allow the menu item to have either a keyboard mnemonic or a keyboard accelerator associated with it; or both. A keyboard mnemonic is a single key on the keyboard which can be used to select the menu item if the menu is displayed. The mnemonic is usually one of the letters in the title itself. The mnemonic character is indicated by surrounding it in square brackets []. For example:
menu file_menu "[F]ile" {

A keyboard accelerator is a key combination which can be typed at any time to perform the action associated with a menu item without actually invoking the menu. The accelerator has two parts, one is the accelerator label which is displayed to the right of the menu item in the menu and the other is the actual definition of the key strokes to be used to invoke the menu item. The syntax for a title is:
"actualtitlestring [ | acceleratordefinition | acceleratorlabel ]"

Example
filesave "Save|Ctrl<Key>S|Ctl+S"

EML Syntax Reference

81

Notice that the acceleratordefinition and the acceleratorlabel are separated from the main string by the vertical bar character. The accelerator label is displayed to the right of the menu item title as given. The acceleratordefinition is built of the following components:

Character Sequence Ctrl

Meaning
This indicates that the Control key must be pressed in combination with the character that follows it. This indicates that the Alt (or Meta) key must be pressed in combination with the character that follows it. This indicates that the Shift key must be pressed in combination with the character that follows it. This indicates that the following character is a keyboard key name. The key is to be taken literally with no interpretation. This indicates one of the alphabetic characters.

Alt Shift <Key> A..Z a..z Example

menu demo "DemoItems " { demoecho "Echo Hello" info "Execute a Simple Procedure" { echo "Hello"; } separator; democheck "Fit To Page" info "Execute a Procedure From a Checkbox Item" checkbox { echo "Fit" $menuvalue;}; separator; demoradio radiogroup { demoasis "As Is" info "Leave Unchanged", demoplain "Plain" info "Set Plain Mode", demobold "Bold" info "Set Bold" } {echo "Style is " $menuvalue;} ; separator; menu pullright "Pull Right" { oddball "Odd Ball" echo "Odd Ball"; evenball "Even Ball" echo "Even Ball"; } }

82

EML Syntax Reference

Frames

The syntax is:


frame name { [ [ [ [ [ [ [ [ [ [ Attributes... ] variable... ] menu... ] framepart... ] modal;] nomap; ] resizable; ] minimumsize number , number ; ] toolbar { toolpart [toolpart...] } ] statusbar; ]

A frame is a rectangular region which contains one or more GUI elements called frameparts. Frames are used in one of two major ways in IMAGINE, they may be used as document frames or as dialog frames. A document frame displays some sort of information (an image, a model, etc) which the user is editing, while a dialog frame provides a form with which the user interacts. The components of a typical document frame are shown in the following illustration:

EML Syntax Reference

83

The frame is has a titlebar across the top which indicates the document being edited. Under the titlebar is the menubar which contains the menus of commands used to edit/view the document. After the menubar is the toolbar. The toolbar contains buttons which give quick access to commonly used commands. The area below the toolbar is the document area. Below the document area is the statusbar. The statusbar displays information about each of the frameparts as the cursor passes over each part. The statusbar also displays information about the current state of the application. The following diagram illustrates a typical dialog frame:

84

EML Syntax Reference

A dialog frame always has a titlebar which gives an indication of the purpose of the dialog. The rest of the frame is filled with the various frameparts as defined in the following section.

Messages
The following standard messages may be delivered to the framepart.

Message(s) Delivered
framedisplay frameresize

Action/Event
When the frame is displayed. When the frame is resized.

mousedown (sent to the button When the quit option is selected from the frame in the frame called cancel or menu or when the pushpin is removed. quit).

Frameparts

Every frame is populated with one or more user interface elements such as buttons, meters, text areas, etc. Each of these has specific attributes and behaviors as described below.

EML Syntax Reference

85

BUTTON Framepart

The syntax is:


button name { [ [ [ [ [ Attributes...] closeaction ;] colorbutton [defaultcolor];] defaultaction ;] icon iconfile ; ]

A button is a very simple framepart. Its main purpose is to initiate an action. A button has a value which is always 0. Simple buttons appear in one of two forms. In the first form the button is a rectangle with the title centered in the button. In the second form the button is rectangle filled with an icon. Both forms have the same behavior.

Simple Text Button


origin origin

ICON Button

Color Button A button may also take the form of a color button. A color button is used to provide a means of selecting and displaying a color. The color button looks like:

86

EML Syntax Reference

Color Button

Right-hold on the color button to display a popup menu of colors shown above. You can choose one of the colors in the menu or select the Other... option to display the color selection dialog (ColorWheel). When the color is selected, the color of the button changes and the application is notified that the change has taken place. The color button can only interact with code in a C Toolkit application.

Messages
The following are the standard messages that may be delivered to buttons: Message(s) Delivered
mousedown input

Event/Action
Click and Release on the button Selecting a Button Color

EML Syntax Reference

87

CANVASPART Framepart

The syntax is:


canvaspart name { [ [ [ [ [ Attributes...] horizontalscrollbar ; ] offscreen ; ] verticalscrollbar ; ] visual string ; ]

The canvaspart part supplies access to onscreen graphics. A canvas is an area into which arbitrary graphics may be drawn. The canvas can only interact with code in a C Toolkit application

CELLARRAYPART Framepart

The syntax is:


cellarraypart name { [ [ [ [ [ [ [ Attributes...] horizontalscrollbar ; ] rowcount number ; ] rowtitle string ; ] showrowcolumn ; ] verticalscrollbar ; ] Column Definitions... ]

} column name {

The syntax for a Column Definition is:


[ [ [ [ [ [ [ [ Attributes...] changeable ; ] columnalignment alignment ; ] columndatatype string ; ] columnlinewidth number ; ] columnwidth number ; ] editable ; ] format string ; ]

The cellarraypart framepart allows the user to view and edit a large (virtual) arrays of rows and columns. In earlier releases of IMAGINE, this capability was (and still is) available by installing a cellarray into a generic framepart. The cellarraypart allows the cellarray to be created directly in the EML script. There are several cellarray framepart functions.

Cell Array

88

EML Syntax Reference

CHECK BOX Framepart

The syntax is:


checkbox name { [ Attributes...] [ icon iconfile ; ] [ icons unarmediconfile ,

armediconfile ; ] }

The check box framepart is used to provide user input of a boolean value. A check box is either on (armed, value 1) or off (unarmed, value 0). Like a button, a check box can have two forms. The first is the simple label form with the title displayed (by default) to the right of the check box.

Simple Checkbox
Armed origin Unarmed

Icon Checkbox

Messages
The following standard messages may be delivered to the check box: Message(s) Delivered
valuechanged valuechanged mousedown input

Event/Action
Check box value changed by assign statement User clicks on the check box and changes its value

EDITTEXT Framepart

The syntax is:


edittext name { [ [ [ [ Attributes... ] hscroll ; ] readonly ; ] vscroll ; ]

The edittext framepart is a moderately complex framepart which can be used to implement a simple input text field or it can provide the capabilities of a multiline text editor. The value of the edittext is the text which it contains.

EML Syntax Reference

89

If the height of the part is one or less than one, a single line edittext is created. If the height is greater than one, then a multiline edittext is created. The multiline edittext always displays a vertical scrollbar to the right which is used to scroll up and down through the text. The text value can be set with the assignment commands and it may be modified using the inserttext command.

Single Line Edittext


origin

Title

Text Input Area

Multiple Line Edittext

Messages
The following standard messages may be delivered to the edittext. Message(s) Delivered
input valuechanged valuechanged

Event/Action
The user presses return or changes the text and moves the mouse from the window. The edittext framepart value is changed by an assignment statement.

90

EML Syntax Reference

FILENAME Framepart

The syntax is:


filename name { [ [ [ [ [ [ [ Attribute... ] filetypedef filterspec ; ] fullpath ; ] newfile ; ] nocheck ; ] select wildcard ; ] shortform; ]

The filename framepart provides a tool for interactively selecting a file. The user may simply enter the filename or he may navigate through the file system and use file selection filters to select files. There are several filename framepart functions.

text input area

Filename Framepart
title file chooser button

go up one directory subdirectories

files

scrollbar

directory popup list

The filename framepart consists of four main areas: the title, the text input area, the scrolling file list and the directory popup. These areas work together to provide a range of means for selecting files. The title is the title defined by the title attribute, plus the current file filter in parenthesis. In the example above the *.img in parenthesis indicates that this file list is currently displaying only those files which end with the .img extension. The filter may be changed at any time by typing a wildcard name into the text input area. Refer to your operating system documentation for a discussion of the use of wildcard characters in file selection.

EML Syntax Reference

91

The text input area is used to enter a name by hand. The name may be a complete path name, a simple filename or a directory name. The text input area is also used to change the file selection filter. To the right of the text input area is the "Chooser Button", which will launch the File Chooser, which provides more options in the selection of files. The scrolling file list displays a list of all subdirectories and all files which match the current filter. Clicking on a filename places that filename into the text input area. This makes the filename plus the path given by the directory popup the value for the filename part. Double clicking on a subdirectory makes that the current directory and the scrolling file list is updated to display the contents of the new directory. The filename framepart checks about every 10 seconds to see if the directory contents has changed, if so it automatically updates the contents of the scrolling file list. The directory popup contains a list of each of the directories above the current one. Clicking on this with the left mouse button displays the list of parent directories. To move to any of the parent directories simply select that one from the list.

Filename Framepart (Short Form)


title text input area

file chooser button

Messages
The following standard messages may be delivered to the filename part. Note that these events are not delivered for the File Chooser, until the user hits OK to approve the selected file name.. Message(s) Delivered
valuechanged input filenamechoosen

Event/Action
The user enters a new filename, or clicks on a filename in the scrolling list

92

EML Syntax Reference

Message(s) Delivered
valuechanged input doubleclick valuechanged valuechanged input

Event/Action
The user clears out the filename, or changes directories. The user doubleclicks on a filename in the scrolling list. The filename framepart value is changed by the script or program The filename framepart value is cleared by the user.

GENERIC Framepart

The syntax is:


generic name { } [ Attribute... ]

The generic framepart is a simple placeholder used by C Toolkit applications to provide a means of plugging parts such as the CellArray or ColorWheel into a frame. The C application looks for the framepart by name and uses the title, position and size attributes of the part. The generic framepart has no visible characteristics of its own so it is displayed as an empty area in the frame, unless a C Toolkit application overloads the behavior of the generic framepart with new methods.

There are no standard messages delivered to the generic framepart. Refer to Custom Parts for more information on the use of the generic framepart. Note: There are now specific frameparts which used a generic framepart in earlier releases of Imagine. See the documentation of the canvaspart, cellarraypart, and colorwheel frameparts.

EML Syntax Reference

93

GROUP Framepart

The syntax is:


group name { } [ Attribute... ] [ framepart... ;]

The group framepart is used to group other frameparts together for emphasis. The group is indicated by a rectangular box drawn around the frameparts contained in the group.

The group supports the standard framepart attributes. There are no standard messages delivered to the group part.

LABEL Framepart

The syntax is:


label name { [ [ [ [ Attribute... ] align [ left | center | right ] ; ] format formatstring ; ] icon iconfile ; ]

The label framepart is used to place a label in a frame. The label can be a simple text string or it may be a small image (bitmap or pixmap) provided by an icon file. There is no user interaction with a label.

94

EML Syntax Reference

Text Label
origin origin

ICON Label

Cick in the window to select

There are no standard messages sent to the label part.

LINE Framepart

The syntax is:


line name { [ Attribute... ] [ layout [ vertical | horizontal ]] ; [ size width, height ];

The line framepart creates simple line in a frame which can be used to separate items or call attention to others. The lines look like:

Horizontal Layout

Vertical Layout

The line framepart accepts only the layout and size framepart attributes. There are no standard messages delivered to the line part.

EML Syntax Reference

95

METERNUMBER Framepart

The syntax is:


meternumber name { [ [ [ [ [ [ [ Attribute... ] delta [strict] expression ; ] format string ; ] max expression ; ] min expression ; ] readonly ; ] rangespec [min, max]

The meternumber framepart provides a quantitative as well as a qualitative means of entering or displaying a numeric value. The meter provides a text input area on the left which can be used to enter a number from the keyboard. Either a numeric constant or an expression may be entered. Refer to Number Input for the syntax of valid expressions. The increment and decrement buttons (nudgers) attached to the text input area are used to increase or decrease the number, in a manner controlled by the delta attribute. If a delta with the strict modifier is used, then the nudgers will use the exact delta value specified, and the user cannot select a value that is not a specific multiple of the delta away from the minimum value. If a delta without the strict modifier is used, then the delta will be a nearby power of 10 (such as 100 or 0.1); the user can choose a different delta by middle-holding on the increment or decrement buttons. The meternumber has a minimum and maximum value which it may assume. The default is 0.0 to 100.0. The slider is used to change the value continuously from the minimum value to the maximum value.

Interactive Meternumber
origin title increment nudger slider

text input area

min decrement nudger

max

If the readonly attribute is given, then the meter is read only and the user may not interact with it.

96

EML Syntax Reference

Read Only Meternumber


title

current value

min

max

Messages
The following standard messages may be delivered to the meternumber part. Message(s) Delivered
valuechanged input valuechanged input mousedown valuechanged input mousedown valuechanged input valuechanged The part value is changed by an assignment statement. The user clicks in the trough to the left or right of the slider. The user increments or decrements the number with the increment or decrement buttons. The user moves the slider.

Event/Action
The user enters a number in the text input area.

POPUPLIST Framepart

The syntax is:


popuplist name { [ [ [ [ [ Attribute...] editable ; ] names stringlist ; ] staticlist ; ] titlelist stringlist ; ]

EML Syntax Reference

97

The popuplist framepart provides a means of selecting one value from a list of several fixed choices. The popup list appears as a button which displays the current value of the part. Left-click on the button to display the list of choices. Selecting a choice makes that the current value of the popup. Each item in the list has a title and a value. By default the titles and the values are the same, however, the titlelist attribute may be used to change the label for each item to a more readable form. There are several popuplist framepart functions.

Popuplist
list option button title

Messages
The following standard messages may be delivered to the popup list. Message(s) Delivered
valuechanged input valuechanged The value of the list is changed with an assignment statement.

Event/Action
The user selects a new item using the popup list.

RADIOBUTTON Framepart

The syntax is:


radiobutton name { [ Attribute... ] [ column count ; ] [ iconlist { iconfile [ , iconfile ... [ options stringlist ; ] [ row count ; ] [ titlelist stringlist ; ]

] } ; ]

The radiobutton framepart provides a means of selecting one value from a set of several fixed choices. The radiobutton appears as a group of buttons, in which only one may be selected at any one time. Clicking on one of the options enables it and disables the others. Each item in the set has a title and a value. Initially the titles and the values are the same, however, the titlelist or iconlist attribute may be used to change the label for each item to a more readable form or to an icon.

98

EML Syntax Reference

Titlelist Radiobutton
enabled radiobutton titlelist strings disabled radiotbutton

Iconlist Radiobutton

Messages
These standard messages may be delivered to the radiobutton. Message(s) Delivered
valuechanged input mousedown valuechanged The value of the radiobutton is changed with an assignment statement.

Event/Action
The user selects a newvalue using the mouse.

SCROLLLIST Framepart

The syntax is:


scrolllist name { [ Attribute... ] [ names stringlist ; ] [ picturelist ; ]

The scrolllist framepart provides a means of selecting a single value from a long list of choices. The highlighted value in the list is the current value for the part. There are several scrolllist framepart functions.

EML Syntax Reference

99

origin

Scrolllist

selected name

list area

scrollbar

Messages
These standard messages may be delivered to the radiobutton. Message(s) Delivered
input valuechanged mousedown doubleclick valuechanged The user doubleclicks on an item. The value of the radiobutton is changed with an assignment statement.

Event/Action
The user selects a newvalue using the mouse.

SLIDER Framepart

The syntax is:


slider name { [ Attribute... ] [ min expression; ] [ max expression; ] [ delta expression; ] [ showcurrentvalue ; ] [ noborder ; ] [ layout [ horizontal | vertical ] ; ] }

The slider framepart provides a means to interactively set one or more values in a range defined by a minimum and a maximum. These values are represented as a movable indicator placed along a scale. The indicator, called a handle, graphically shows its value by its position on the scale as a linear proportion. The scale shows a gray value ramp. A slider with three handles is shown below:

100

EML Syntax Reference

The gray scale in the current value area is computed as piecewise linear function, shown below. For N handles there will be N+1 sections to the curve. The areas from the mimimum to the first handle will be mapped to 0, or black. The areas from the last handle to the maximum will be mapped to 1.0, or white using the default foreground color for the part, and the given color if the foreground is specified. For N handles there will be N-1 segments between these as shown below.

An active handle is darker and will move when it is dragged by the mouse or when the up/down arrow keys are pressed or when the mouse wheel is turned. Pressing the Tab key will move the active state to the next handle to the right (it wraps back to the first after the rightmost handle). Pressing the Shift+Tab keys will move the active state to the next handle to the left (it wraps back to the last after the leftmost handle is reached). More than one handle may be active at a time, allowing for entire ranges to be moved. To make multiple handles active, press Ctrl+left mouse button on an inactive handle. If the handle is active, this action will remove it from the group of active handles. Clicking on an inactive handle will make all other handles inactive and the current one active. The slider framepart supports all of the base keywords of any framepart such as title or geometry, as well as the following keywords described below. The minimum and maximum expressions are evaluated at the time the part is instantiated and is used as the initial setting for the minimum and maximum value. The default is 0.0 for min and 100.0 for max. Refer to Number Input for the syntax of valid expressions.

EML Syntax Reference

101

The delta expression is evaluated at the time the part is instantiated and is used as the initial setting for the delta value. The delta value is the amount that a handle is incremented on a single mouse wheel click or a single up/down arrow press. The default is 1.0. If the showcurrentvalue attribute is given, then the current value area is shown. If it is not given, then a simple graticule of 10 divisions is shown. The default is 0, meaning the grayscale will not be shown. The noborder attribute indicates that the part is to be drawn without a border. The default is to draw the slider without a border. The layout attribute controls whether the slider is drawn horizontally or vertically. The default is horizontal. The background color controls the color of the grayscale. The default is white, providing a black to white transition. The value expression is evaluated at the time the part is instantiated and is used to provide the initial value for the part. The slider recognizes when a triple value is used and produces the respective number of handles. For example, a value of {10.0, 50.0, 90.0} will produce three handles at the corresponding values.

Messages
The slider sends messages to indicate various changes or actions which take place. The messages can be received by on statements in the EML script or by callbacks added in the code. The messages and the events triggering them are listed in the table below: Message
mousedown mouseup valuechanged

Event/Action
Sent when the left mouse button is used to click on one of the handles. Sent when the mouse button has been released after a successful grab of a handle. Sent when the value of any of the handles on the slider has been changed. This occurs when any of these actions are used to change a position: Mousewheel was used Up/down arrow keys were used Mouse was used Slider API is used

102

EML Syntax Reference

Message
input

Event/Action
Sent when the value of any of the handles has been changed by user interaction with keyboard or mouse. This occurs when any of these actions are used to change a position: Mousewheel was used Up/down arrow keys were used Mouse was used

Examples
The following example produced the slider in the figure above.
slider gray { title "Gray"; titleoffset 50 noalign; geometry 10, 40, 300, 25; lock top, left, width, height; noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; }

The following EML code reads the list of values from one slider named Gray and copies them to three other sliders named Red, Green and Blue respectively. Note that EML will transfer these lists (arrays) of values in the same manner as copying a scalar.
on mousedown { set red = $gray; set green = $gray; set blue = $gray; }

The EML file in the Appendix named SliderTest.eml can be used with the command line:
eml "SliderTest.eml"

to produce the example shown below:

EML Syntax Reference

103

The Reset button will reset the values of the Gray slider. The Copy button will take the current values of the Gray slider and copy them to the Red, Green and Blue sliders in the previous example.

SPLITPANEL Framepart

The syntax is:


splitpanel name { [ Attribute...] [ raisedgrab ; ] [ noraisedgrab ; ] [ locksplit [ top | bottom | left | right ; ] [ layout [vertical|horizonal ] ] }

The splitpanel framepart is a container part which manages a set of children as a vertical or horizontal tiling. It is used to divide or split the area in a frame. The grab area, or bar, separating the two areas is used to grab and drag the split. An example of a splitpanel is shown below within the red box. Clicking on the grab handle and dragging resizes the split to the right or left.

104

EML Syntax Reference

The splitpanel framepart supports all of the base keywords of any framepart such as title or geometry, as well as the following keywords described below. The raisedgrab attribute causes the grab handle between the two child parts to have a 3-dimensional raised effect. This is the default. The noraisedgrab attribute causes the grab handle to appear as a three-pixels wide narrow gray band between the two child parts. The locksplit attribute controls the behavior of the split when the entire splitpanel is resized. If none of the arguments are given, then the split will be moved proportionally. For example, if the split started as 20% on the left and 80% on the right, then this ratio is preserved as the part is resized. If any of the arguments are given, the indicated side will remain the same size in total pixels and the remainder of the space will be allocated to the other child. The layout attribute controls whether the splitpanel is drawn horizontally or vertically. In the figure above, the layout is horizontal so the two children are managed with one on the left and one on the right. When the layout is vertical, the children are managed with one above the other. The default is horizontal. The splitpanel does not send any messages.

TABSHEET Framepart

The syntax is:


tabsheet name { [ Attribute... ] }

EML Syntax Reference

105

The tabsheet framepart is a container part which manages a set of children as a stack of cards with index tabs. Each of the children of the tabsheet framepart must be a group. The title of the group is used as the title of the tab on the index card. The group is positioned in the upper left corner of the card. The "value" of the tabsheet is the name (not title) of the currently selected group.

The tabposition statement is new for version 9.3. The tabsheet can now have tabs appear at the bottom as well as at the top. The default position is at the top of the tabsheet, but the new tabposition statement allows the tabs to be located at the bottom of the tabsheet, as shown in the figure below. The syntax is:
tabposition [top|bottom] ;

TEXTNUMBER Framepart

The syntax is:


textnumber name { [ Attribute... ] [ delta [strict] expression ; ] [ format string ; ] [ max expression ; ] [ min expression ; ] [ rangespec [min, max] }

The textnumber framepart provides a means of entering or displaying a numeric value. The textnumber provides a text input area to the left which can be used to enter a number by typing it in. Either a numeric constant or an expression may be entered. Refer to Number Input for the syntax of valid expressions.

106

EML Syntax Reference

The increment and decrement buttons attached to the text input area can be used to increase or decrease the value, in a manner controlled by the delta attribute. If a delta with the strict modifier is used, then the nudgers will use the exact delta value specified, and the user cannot select a value that is not a specific multiple of the delta away from the minimum value. If a delta without the strict modifier is used, then the delta will be a nearby power of 10 (such as 100 or 0.1); the user can choose a different delta by middle-holding on the increment or decrement buttons. by delta. If the delta attribute is not given, a default value of 1.0 is used. The textnumber has a minimum and maximum value which it may assume. If the min and max attributes are not given, the default range is 0.0 to 100.0.

Textnumber
origin increment button title text input area "nudgers" decrement button

Messages
The following standard messages may be delivered to the meternumber part. Message(s) Delivered
valuechanged input valuechanged input valuechanged The user increments or decrements the number with the increment or decrement buttons. The part value is changed by an assignment statement.

Event/Action
The user enters a number in the text input area.

THUMBWHEEL Framepart

The syntax is:


thumbwheel name { [ Attribute... ] [ min expression; ] [ max expression; ] [ delta expression; ]

EML Syntax Reference

107

[ showcurrentvalue ; ] [ noborder ; ] [ layout [ horizontal | vertical ] ; ] }

The thumbwheel framepart provides a means to interactively change a value by clicking and dragging a wheel, resembling the action of turning an analog dial. This allows fine control of a value by spinning or turning a wheel. A typical thumbwheel instance is shown below.

Turning the wheel to the right increases the value being controlled, and turning the wheel to the left decreases the value. By default the value does not have a maximum or a minimum value imposed, though these can be set. The thumbwheel can also display a bar indicating its current value as shown below.

The thumbwheel framepart supports all of the base keywords of any framepart such as title or geometry, as well as the following keywords described below. The minimum and maximum expressions are evaluated at the time the part is instantiated and is used as the initial setting for the minimum and maximum value. The default is 0.0 for min and 100.0 for max. Refer to Number Input for the syntax of valid expressions. The delta expression is evaluated at the time the part is instantiated and is used as the initial setting for the delta value. The delta value is the amount that the value can change when receiving input from the mouse. The default is 1.0. If the showcurrentvalue attribute is given, then the current value bar is shown. The default is 0, meaning the value will not be shown. The noborder attribute indicates that the part is to be drawn without a border. The default is to draw the thumbwheel with a border. The layout attribute controls whether the thumbwheel is drawn horizontally or vertically. The default is horizontal.

108

EML Syntax Reference

Messages
The thumbwheel sends messages to indicate various changes or actions which take place. The messages can be received by on statements in the EML script or by callbacks added in the code. The messages and the events triggering them are listed in the table below: Message
mousedown

Event/Action
Sent when the user clicks the left mouse button on the thumbwheel. In effect this lets the applications know that some change is about to start. Sent when the user releases the left mouse button on the thumbwheel. In effect this lets the applications know that some change is just completed. Sent when the value of the thumbwheel has changed.

mouseup

valuechanged

Core Attributes

All EML GUI elements share a set of common attributes including value, position, size, color, and message handlers. The value of each part is either a number or a string and may be used just like a variable. The position specifies the parts placement in the frame. The size specifies the parts size. The color specifies the parts color. The message handler specifies the list of actions to be taken for given messages. All attributes are described below. Attributes which are applicable to only a few frameparts are so noted. Attributes that are applicable to frames only are so noted.

BACKGROUND Attribute

The syntax is:


background [ color | red, green, blue | #rrggbb ] ;

The background attribute specifies the color to be used as the background for the part. The color may be a name or it may be a triplet of numbers specifying the red, green, and blue components of the color. The name is system specific. On an X-Window system it represents any one of the names represented in the X color database. The name may also be a hexadecimal constant of the form "#rrggbb" where rr, gg, and bb are two-digit hexadecimal numbers which range from 00 to FF. If the color triplet is used then the numbers range 0.0 to 1.0. Examples
background "cyan" ; background "#81b4c1" ;

FONT Attribute

The syntax is:


font fontname ;

EML Syntax Reference

109

The font attribute is used to specify the font which is used for displaying text in the part. The font names are system specific. The list of names which may be used in an X-Window system are found by using the xlsfonts command. The fontname is a string constant and may not be an expression.

FOREGROUND Attribute

The syntax is:


foreground [ color | red, green, blue | #rrggbb ] ;

The foreground attribute specifies the color to be used as the foreground for the part. The color may be a name or it may be a triplet of numbers specifying the red, green, and blue components of the color. The name is system specific. On an X-Window system it represents any one of the names represented in the X color database. The name may also be a hexadecimal constant of the form "#rrggbb" where rr, gg, and bb are two-digit hexadecimal numbers which range from 00 to FF. If the color triplet is used then the numbers range 0.0 to 1.0. Examples
foreground "cyan" ; foreground "#81b4c1" ;

ON Attribute

The syntaxes are:


on message [ with arg [ arg...] do ] procedure on message [ ( arg [ arg ... ] ) ] procedure

The on attribute is used to define a message handler. Every part may have one or more message handlers associated with it. The message handler specifies a procedure which is to be executed when a particular message is received. There are standard messages which are created and delivered by the system in response to user input and other actions, these are detailed in Event Messages. For example when a button part is selected with a mouse click, a "mousedown" message is sent to the button part, so the button part can do something (that is, display other frames, quit, or execute a procedure). A message handler may accept arguments like a function call in a traditional language. There are two forms which can be used to specify the argument list (either form may be used). The first form uses the with keyword to denote the beginning of the argument list and the do keyword to denote the end of the argument list (beginning of the procedure). The second form simply uses parentheses to delimit the argument list. Each of the arguments may be referenced as a local variable in the body of the procedure. None of the default messages sent to frameparts have any arguments. Placing message handlers at the component level of a script can be used to create functions which can be used in all of the other procedures within the script. Example

110

EML Syntax Reference

button closeb { title "Close; size 4,1.5; on mousedown { echo "Close button Selected"; /* Script code */ echo "Exiting application..."; if ($oktoquit == "Yes") /* Flow control statements */ quit; /* EML quit command * } }

See also the receive attribute and the send command.

RECEIVE Attribute

The syntax is:


receive message ;

The receive attribute places a part on the receiver list for a particular message. When a message is delivered to a part, the system checks to see if the part has a message handler. If not, then the system attempts to deliver the message to the parent of the part. Message delivery continues from child to parent until a message handler is found or until all parents are exhausted. When this happens, the message system checks the receiver list for parts in other components that have used the receive attribute for the current message. The current message is delivered to all parts in the receiver list whose message matches the current message. This can be used to send messages between parts in different components. Refer to Message Manager for more detail.

See also the on attribute and the send command.

TITLEFONT Attribute

The syntax is:


titlefont fontname ;

The titlefont attribute specifies the font to be used for the title string. The fontname is system specific. On X-Window systems the available names can be seen by using the xlsfonts command.

TITLEPLACEMENT Attribute

The syntax is:


titleplacement [ titleposition ] ;

The titleplacement attribute is used to specify the default position for the titles of all parts contained in a frame. See the title attribute description for the meanings of the different positions.

EML Syntax Reference

111

Framepart Attributes

All frameparts share a set of common attributes including value, position, size, color, and message handlers. The value of each part is either a number or a string and may be used just like a variable. The position specifies the parts placement in the frame. The size specifies the parts size. The color specifies the parts color. The message handler specifies the list of actions to be taken for given messages. All attributes are described below. Attributes which are applicable to only a few frameparts are so noted. Attributes that are applicable to frames only are so noted.

ABOVE Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable. The syntax is:
above [ left | center | right ] partname [ nogap ];

The above attribute is used to position one part above another. By default it is positioned above and aligned with the left side of the named part. This is the same as using the left modifier. If the center modifier is used the part is positioned centered above the named part. If the right modifier is given the part is positioned above but aligned with the right side of the named part. If the nogap modifier is given then there is no space between the part and the named part.

ALIGN Attribute

The syntax is:


align [ left | center | right ] ;

The align attribute controls the alignment of the label text in the area defined for the label. The left modifier causes the label to be left aligned. The center modifier causes the label to be center aligned. The right modifier causes the label to be right aligned. A label is left aligned by default. This attribute is used ONLY by the label framepart.

AT Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable.
at xnumber , ynumber ;

112

EML Syntax Reference

The at attribute is used to specify a position for the part. The numbers are constants and are given in character positions for all frameparts. The position attribute may be used to specify a position using an expression for the x and y positions.

ATTACH Attribute

Obsolete in IMAGINE version 8.2. Use the lock attribute instead. This attribute is supported only in the sense that it will not cause failure of the eml script. The result of using it in the current version is unpredictable.

BELOW Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable. The syntax is:
below [ left | center | right ] partname [ nogap ] ;

The below attribute is used to position one part below another. By default it is positioned below and aligned with the left side of the named part. This is the same as using the left modifier. If the center modifier is used, the part is positioned centered below the named part. If the right modifier is given, the part is positioned below but aligned with the right side of the named part. If the nogap keyword is given, then there is no space between the part and the named part.

CENTER Attribute

The syntax is:


center source | screen ;

The center attribute is used to position a frame. It is followed by one of the modifiers source, or screen. If source is used then the frame is positioned in the center of the parent dialog. If screen is used then the frame is positioned in the center of the display screen.

CHANGEABLE Attribute

The syntax is:


changeable ;

The changeable attribute controls whether the user can change the width of a column in a cellarray. If not specified, the width of the column is unchangeable. This attribute is used ONLY by a column in the cellarray framepart.

EML Syntax Reference

113

CHOOSERBUTTON Attribute

The syntax is:


chooserbutton ;

The chooserbutton attribute indicates that the button will be attached to a chooser. This special type of button has a canvas representing the currently chosen item and a button that brings up a popup window with other common choices. This can only be used within C Toolkit Applications. This attribute is used ONLY by the button framepart.

CLOSEACTION Attribute

The syntax is:


closeaction;

The closeaction attribute indicates a button framepart or menu item that should used when the user closes the window. On Windows, this enables the X button in the upper-right hand of the window. On UNIX, this enables the Close item in the windows system menu and the standard "close window" action by double-clicking on the system menu. If the user does try to close the window, a mousedown message is sent to the button framepart, or menu items procedure is executed. The standard user expectation is that the close action will actually result in the removal of the frame without causing any additional processing to occur. If the frame contains any buttons or menus, this attribute should be used to identify which button or menu is the "Cancel" or "Close" action for this frame. If nothing is labelled as the close action, EML will look though button and manu part names for strings like "close" or "quit", trying to find an appropriate default. It is undesirable for more than one item to be labeled as the close action. Whenever EML must choose, the choice may not always be predictable or the most desirable. This attribute is used ONLY by the button framepart or a menu item.

COLORBUTTON Attribute

The syntax is:


colorbutton [red,green,blue[,opacity]];

The colorbutton attribute indicates that the button is a color button, and optionally a default color for the chooser. red, green, blue are numbers ranging from (0-1) that specify the intensity of each component within the default color. opacity, when applicable, specifies a colors which blend with the background color(s) upon which the color is rendered. opacity can vary continuously from 0, where the color is completely transparent and the background dominates to 1, where the color is completely opaque and the background becomes irrelevant. This can only be used within C Toolkit Applications.

114

EML Syntax Reference

This attribute is used ONLY by the button framepart.

COLUMN Attribute

The syntax is:


column count ;

The column attribute specifies the number of columns to be used when displaying the radiobutton. The default is 1 for the vertical layout. The count is a constant. This attribute is used ONLY by the radiobutton framepart.

COLUMN-ALIGNMENT Attribute

The syntax is:


columnalignment [ left | center | right ] ;

The columnalignment attribute controls the alignment of text within a column in a cellarray. If not specified, the cell contents are aligned according to the default alignment of the columns datatype. If the left modifier is used, the text is aligned with the left side of the column. If the center modifier is used, the cell contents are centered within the column. If the right modifier is given, the cell contents are aligned with the right side of the column. This attribute is used ONLY by a column in the cellarray framepart.

COLUMNDATATYPE Attribute

The syntax is:


columndatatype [ text | boolean | exclusive | double | color ] ;

The columndatatype attribute controls the appearance of column data within a cellarray. If not specified, the text modifier is used by default. The contents of the cell are treated as a normal text string, which is aligned to the left of the cell by default. If the boolean modifier is used, the cell is displayed as a space or an "x". "x" indicates a true value, while empty space indicates false. If the exclusive modifier is given, then a ">" appears in one and only one row of the column. The other rows are blank. This provides a way to let the user select exactly one item. If the double modifier is used, the contents of the cell are treated as numeric text, which is right-justified by default. If the color modifier is used, the contents of the cell are displayed as a block of the given color. The value is three or four values (red, green, blue, and perhaps opacity) between 0.0 and 1.0.

EML Syntax Reference

115

This attribute is used ONLY by a column in the cellarray framepart.

COLUMNLINEWIDTH Attribute

The syntax is:


columnlinewidth number ;

The columnlinewidth attribute controls the width, in pixels, of the line that appears to the right of a column in a cellarray. If not specified, the default line width is 1. This attribute is used ONLY by a column in the cellarray framepart.

COLUMNWIDTH Attribute

The syntax is:


columnwidth number ;

The columnwidth attribute controls the width, in pixels, of a column in a cellarray. Since the font is proportional, this does not directly control how many characters will fit in a given column. This attribute is used ONLY by a column in the cellarray framepart.

DEFAULTACTION Attribute

The syntax is:


defaultaction;

On Windows, the defaultaction attribute indicates the button framepart which is highlighted by default. This is a convenience for the user, allowing them to select the return key, in which case a mousedown message is sent to this button framepart. On UNIX, this attribute has no effect. If the frame contains any buttons, this attribute should be used to identify the "OK" button for the frame. If no buttons have the attribute, EML will look at the names of button frameparts trying to find one. If more than one, the first button found will be the default. Whenever EML must decide which button is the default, the choice may not always be predictable or the most desirable. This attribute is used ONLY by the button framepart.

DIMENSION Attribute EDITABLE Attribute

Obsolete in IMAGINE version 8.2. The syntax is:


editable ;

The editable attribute, in a cellarray column definition, controls whether the user can change the value of a cell in that column. In a popuplist, it allows the user to type their own value for the popuplist. Without this attribute, the user can only use the predefined values made available by the popuplist.

116

EML Syntax Reference

This attribute is used ONLY by the popuplist framepart or by column(s) in the cellarray framepart.

FILETYPEDEF Attribute

The syntax is:


filetypedef filterspec [ modifier [ modifier ...] ] ;

The filetypedef attribute(s) specify the file filter types to be allowed by a filename part. The filterspec specifies which FileFilter DLL should be referenced and has the following syntax:
filtertitle [ ( template [ , template [ ... ] ) ]

filtertitle identifies the FileFilters DLL (without the .dll extension). The template list, if present, specifies which templates to use from that FileFilters DLL. If no template list is present, all applicable types from that DLL are used. Alternatively, filtertitle may be a descriptive pseudotitle. A pseudotitle does not refer to any DLL, and the template list must contain exactly one item, which is the wildcard for the data type. Pseudotypes have reasonable default behavior based upon the template. Each filetypedef can have one or modifiers which affect how the filterspec is handled. Valid modifiers are:
optionframe framename

Specifies that the first group with framename should be displayed as the options tab, whenever one of the types identified by filterspec is selected. framename must identify a frame which has already been defined in the EML script containing this filename part.
visible { on | off | allowed }

Further modifies the application of filtertitle, based upon the visibility flag. The visibility flag determines whether a data type should be shown to the user or not. If "on", then only types marked to be uservisible will be included. If "off", then only those types which are hidden will be included. If "allowed" then both types are included. If not specified, the default behavior is "visible on".
creatable { on | off | allowed }

Further modifies the application of filtertitle, based upon the creatable flag. The creatable flag determines whether the software can create files of the given data type. If "on", then only types marked to be creatable will be included. If "off", then only those types which are not creatable will be included. If "allowed" then both types are included. If not specified, the default behavior is "creatable on" if the newfile attribute is specified, and "creatable allowed" if not.
pseudotemplates { on | off | allowed }

EML Syntax Reference

117

Further modifies the application of filtertitle, based upon the pseudotemplate flag. Pseudo-templates are templates like "*.arcinfo" which identify the data type, but cannot be used for wildcard matching on file or directory names. Coverages, GRIDs, and some generic binary files use pseudo-templates. If "on", then only pseudo-template types will be included. If "off", then only those types with true wildcards will be included. If "allowed" then both types are included. If not specified, the default behavior is "pseudotemplates off" if the newfile attribute is specified, and "pseudotemplates allowed" if not. This modifier was originally named pseudotypes. The name pseudotypes is somewhat misleading, since it implies the type is artificial, when in fact it is the template (wildcard) which is artificial. While OBSOLETE and identical to pseudotemplates, the pseudotypes modifier is still supported for compatibility reasons. Note: the visible, creatable, and pseudotemplate modifiers do not affect filterspecs which include an explicit list of templates. If the templates are enumerated, then those are the ones that will be included, regardless of the modifiers. Example
filetypedef "vector"; filetypedef "raster(*.img,*.jpg)"; filetypedef "Map Composition(*.map)";

File Types Allowed


All types in vector.dll IMAGINE and JPEG from raster.dll

Any files with a .map extension

You can specify as many filetypedef attributes as necessary to identify all of the data types to be allowed by the filename part. If no filetypedef attributes are specified, then the select attribute will determine what filtering (however limited) will be used.

FORMAT Attribute

The syntax is:


format xlformatstring ;

The format attribute, when specified for a cellarray column, controls how values in that column will be displayed. Consult the documentation for Number Formatting for a discussion of the format strings. This form of the format attribute is used ONLY by columns in a cellarray framepart. Consult the format (Number) attribute under "Number Attributes" for the formats supported by the label, textnumber, and meternumber frameparts.

FULLPATH Attribute

The syntax is:

118

EML Syntax Reference

fullpath ; The fullpath attribute specifies that a filename part shall display the full path of the current file, rather than just the name of the file. This can be useful for shortform filenames where the directory is not immediately apparent.

GAP Attribute

The syntax is:


gap gapvalue ;

The gap attribute specifies the amount of space to be left between parts when they are positioned automatically. When parts are positioned automatically there is a gap left between them. The initial gap is 0.5 character space, however, this may be changed by using the gap attribute.

GEOMETRY Attribute

The syntax is:


geometry x,y,width,height ;

Where x,y are the position, and the width and height are the size of part in pixel units. Previously only hard number constants could be used when specifying the initial size of an EML Frame, Component, or Part. Beginning with version 9.3, any arithmetic EML expression can be used for x, y, width, and height. 9.3 syntax is:
geometry <expression>, <expression>, <expression>, <expression> ;

Where <expression> is any arithmetic expression. Note that a numeric constant itself is an expression. The geometry attribute is new in Rev 8.2, it replaces the at/size attributes which are obsolete in this version. For compatibility reasons, EML tries to translate the at/size attributes to the closest possible geometry attributes. Always use the geometry attributes since the translation of at/size to geometry may not provide the expected results. This is due to the fact that the units in geometry are pixels as opposed to character units in at/size.

HORIZONTALSCROLLB AR Attribute

The syntax is:


horizontalscrollbar ;

The horizontalscrollbar attribute specifies that the cellarray or canvas is to have a horizontal scroll bar. This attribute is used ONLY by the cellarray and canvas frameparts.

HSCROLL Attribute

The syntax is:


hscroll ;

EML Syntax Reference

119

The hscroll attribute specifies that the edittext is to have a horizontal scroll bar if it is a multiline text. If the hscroll attribute is not present then the text automatically wraps. This attribute is used ONLY by the edittext framepart.

ICON Attribute

The syntax is:


icon iconfile ;

The icon attribute is used to specify an iconfile which may be used instead of the title. The icon file may be in either the xbitmap or xpixmap formats. The xbitmap is a one bit image which is created by either the Sun iconeditor or the X bitmap editor. The xpixmap format is a color format with 8 bits per pixel. When an xpixmap (xpm) is used, EML takes the value of the upper left most pixel to be the "background" color. That is, it substitutes the current background color for all pixels in the pixmap which match the upper left most pixel. This is done because the X pixmap format does not support a transparent color. This could be done by using an associated mask file, but that would double the number of files used. This attribute is used ONLY by the button, checkbox, and label frameparts.

ICONS Attribute

The syntax is:


icons unarmedicon, armedicon ;

The icons attribute specifies the icons to be used for both the armed and unarmed states of the check box. See the icon attribute for a description of the icon files. This attribute is used ONLY by the checkbox framepart.

ICONLIST Attribute

The syntax is:


iconlist { iconfile [ , iconfile... ] } ; ];

The iconlist attribute is used to specify a list of iconfiles which may be used instead of the title. The icon files may be in either the xbitmap or xpixmap formats. The xbitmap is a one bit image which is created by either the Sun iconeditor or the X bitmap editor. The xpixmap format is a color format with 8 bits per pixel. When an xpixmap (xpm) is used, EML takes the value of the upper left most pixel to be the "background" color. That is, it substitutes the current background color for all pixels in the pixmap which match the upper left most pixel. This is done because the X pixmap format does not support a transparent color. This could be done by using an associated mask file, but that would double the number of files used.

120

EML Syntax Reference

This attribute is used only by the popuplist, scrolllist, and radiobutton frameparts.

INFO Attribute

The syntax is:


info string ;

The info attribute specifies the string which is to be displayed in the Status Bar when the cursor is on top of this part. This provides a means of providing the user with constant feedback about the function of each of the parts in the system.

LAYOUT Attribute

The syntax is:


layout [ vertical | horizontal ] ;

The layout attribute is used to specify whether the part is to be drawn in a vertical or horizontal direction. This attribute is used only by the line, radiobutton, slider, splitpanel, and thumbwheel frameparts.

LEFT Attribute

The syntax is:


left [ top | center | bottom ] partname [ nogap ] ;

The left attribute is used to position one part relative to another. It is followed by one of the modifiers top, center, or bottom. If top is used (the default) then the part is positioned to the left of the named part with their tops aligned. If center is used then the part is positioned to the left of the named part with their centers aligned. If bottom is used then the part is positioned to the left of the named part with their bottoms aligned.

LEFTOF Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable. The syntax is:
leftof partname [ nogap ] ;

The leftof attribute is used to position one part to the left of another part. It has the same effect as the left attribute with the top modifier.

LOCK Attribute

The syntax is:


lock <[left, right, top, bottom, width, height]> ;

EML Syntax Reference

121

The lock attribute is new in Rev 8.2, it replaces the attach attribute which is obsolete in this version. The lock attribute is used to specify how a change in frame size will be distributed among the frameparts within the frame. For compatibility reasons, EML tries to translate the attach syntax to the closest possible lock syntax. The lock mechanism is very simple when compared to attach. Due to this fact, the translation of attach to lock may not always provide the expected results. The following describes each lock argument width height left right top bottom
Width is always constant Height is always constant Left side of part is locked to frame (that is, the left side always has the same offset to the frame) Right side of part is locked to frame (that is, the right side always has the same offset to the frame) Top side of part is locked to frame (that is, the top side always has the same offset to the frame) Bottom side of part is locked to frame (that is, the bottom side always has the same offset to the frame)

In order to work correctly, the lock mechanism requires the frame parts to be laid out with absolute geometry (that is, use the geometry attribute to specify absolute geometry, DO NOT use size/at ). By default, the locks in all the parts in a resizable frame will be set to be proportional to their geometry (that is, width, height, left, right, top and bottom are unlocked -- during the resize, the increment in frame size is proportionally divided among all the frame parts). lock can be used to specify how to distribute the change in frame size. See the example lock.eml below for reference. Example
component lock_test { frame geom_frame { title "Geometry Test"; geometry 100,100,200,250; resizable; edittext text_entry { title above center "Text Entry:"; geometry 0,0,200,220; lock left, right, top, bottom; }

122

EML Syntax Reference

} on startup display geom_frame;

button quitit { title "Quit"; geometry 67,222,65,25; lock width, height, bottom; on mousedown quit; }

LOCKSPLIT Attribute

The syntax is:


locksplit [top, bottom, left, right] ;

The locksplit attribute is used in a splitpanel framepart to control the behavior of the split when the entire splitpanel is resized. When any of the arguments (top, bottom, left, right) are given, the indicated side remains the same size in total pixels and the remainder of the space is allocated to the other child. If none of the arguments are given, then the split will be moved proportionally. For example, if the split started as 20% on the left and 80% on the right, then this ratio is preserved as the part is resized.

MAX Attribute

The syntax is:


max value ;

The max attribute sets the maximum value which the meternumber may assume. The default for this value is 100.0. The value is an expression which is evaluated at the time the framepart is created. This attribute is used ONLY by the meternumber, textnumber, slider, and thumbwheel frameparts.

MIN Attribute

The syntax is:


min value ;

The min attribute sets the minimum value which the meternumber may assume. The default for this value is 0.0. The value is an expression which is evaluated at the time the framepart is created. This attribute is used ONLY by the meternumber, textnumber, slider, and thumbwheel frameparts.

MINIMUMSIZE Attribute

The syntax is:


minimumsize width, height ;

The minimumsize attribute must be specified when the frame is resizeable. This indicates the minimum size to which the frame may be resized.

EML Syntax Reference

123

This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

MODAL Attribute

The syntax is:


modal ;

A frame may be modal or non-modal. A modal frame receives all input to the exclusion of all others. This means that while a modal frame is displayed no other dialogs in the application are active. This is used when the user must enter some information before proceeding. Frames are non-modal by default. This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

NAMES Attribute

The syntax is:


names stringlist ;

The names attribute specifies the list of values which the popuplist may assume or the list of names which is placed in the scrolllist. The stringlist is an expression which is evaluated when the framepart is created. This attribute is used ONLY by the popuplist and scrolllist frameparts.

NEWFILE Attribute

The syntax is:


newfile ;

The newfile attribute indicates that the selected filename must represent a new file. If the user enters the name of an existing file the following dialog is displayed:

If "Yes" is selected then the selected file is deleted. If "No" is selected then the text input area of the filename framepart is cleared. This attribute is used ONLY by the filename framepart.

124

EML Syntax Reference

NOBORDER Attribute

The syntax is:


noborder ;

The noborder attribute indicates that the part is to be drawn without a border. Default is to draw the part with a border.

NOCHECK Attribute

The syntax is:


nocheck ;

The nocheck attribute indicates that no checking on the validity of the filename is to be done. This is used for applications which may create new files or overwrite existing ones. This attribute is used ONLY by the filename framepart.

NOMAP Attribute

The syntax is:


nomap ;

The nomap attribute causes a frame to be invisible after it is invoked by the display command. It is made visible only when the show command is used. This was implemented to allow some frames to be displayed at startup time, but to remain invisible until they were needed. This improves the perceived performance, but at the expense of more memory. This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

NORAISEDGRAB Attribute

The syntax is:


noraisedgrab ;

The noraisedgrab attribute causes the grab handle in a splitpanel framepart to appear as a three-pixel wide narrow gray band between the two child parts.

OFFSCREEN Attribute

The syntax is:


offscreen ;

The offscreen attribute causes a canvaspart to be an offscreen memory canvas. It can be drawn to, like any other canvas, but it is not displayed. The contents of the memory canvas can be copied to and from other canvases. An offscreen canvas may not always be useful for canvases displayed on other screens. This attribute is used ONLY by the canvaspart framepart.

OPTIONS Attribute

The syntax is:


options stringlist ;

EML Syntax Reference

125

The options attribute specifies the list of values which the radiobutton may assume. The stringlist is an expression which is evaluated when the framepart is created. This attribute is used ONLY by the radiobutton framepart.

PICTURELIST Attribute

The syntax is:


picturelist ;

The picturelist attribute indicates that the scrolling list contains pixmaps instead of text strings. This feature is only useful to C Toolkit programmers since the actual pixmaps have to be provided by C Toolkit Functions. This attribute is used ONLY by the scrolllist framepart.

POSITION Attribute RAISEDGRAB Attribute

Obsolete in IMAGINE version 8.2. The syntax is:


raisedgrab ;

The raisedgrab attribute causes the grab handle between the two child parts in a splitpanel framepart to have a 3-dimensional raised effect.

RANGESPEC Attribute

The syntax is:


rangespec [min, max] ;

The rangespec attribute sets the minimum and maximum values for the number to be entered in the part. If used without any arguments this attribute sets a maximum and minimum values to the highest/lowest values possible for a double precision number. You can also substitute the keyword nolimit, for either the min or max number specifications to set the lowest/highest number. Examples
rangespec; rangespec 0, 100; rangespec nolimit, 100; rangespec 100, nolimit;

READONLY Attribute

The syntax is:


readonly ;

The readonly attribute indicates that the framepart is for display purposes only and the user cannot interact with it. For a single line edittext, the text area does not appear inset.

126

EML Syntax Reference

This attribute is used ONLY by the edittext and meternumber frameparts.

RESIZABLE Attribute

The syntax is:


resizable ;

The resizable attribute is given to a frame to make it resizeable. A resizeable frame is indicated by the presence of "grab handles" on the corners of the frame. These can be used to enlarge or reduce the size of the frame. Most document frames are resizeable so that the user can change the area of the document being viewed or edited. Most dialog frames are not resizeable since the information content of the frame is fixed. Frames are fixed (not resizeable) by default. If a frame is resizeable a minimum size for the frame must be given. This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

RIGHT Attribute

The syntax is:


right [ top | center | bottom ] partname [ nogap ] ;

The right attribute is used to position one part relative to another. It is followed by one of the modifiers top, center, or bottom. If top is used (the default) then the part is positioned to the right of the named part with their tops aligned. If center is used then the part is positioned to the right of the named part with their centers aligned. If bottom is used then the part is positioned to the right of the named part with their bottoms aligned.

RIGHTOF Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable. The syntax is:
rightof partname [ nogap ] ;

The rightof attribute is used to position one part to the right of another part specified by partname. It has the same effect as the right attribute with the top modifier. If the nogap modifier is given then there is no space left between the part and partname.

ROW Attribute

The syntax is:


row count ;

EML Syntax Reference

127

The row attribute specifies the number of rows to be used when displaying the radiobutton. The default is 1 for the horizontal layout. The count is a constant. This attribute is used ONLY by the radiobutton framepart.

ROWCOUNT Attribute

The syntax is:


rowcount count ;

The rowcount attribute specifies the number of rows in a cellarray. The default is 0. This attribute is used ONLY by the cellarray framepart.

ROWTITLE Attribute

The syntax is:


rowtitle string ;

The rowtitle attribute specifies the title of the column of a cellarray which is used to number the rows. This column is the left-most column in the cellarray, but will only appear if enabled by the showrowcolumn attribute. The default title is "Row". This attribute is used ONLY by the cellarray framepart.

SELECT Attribute

The syntax is:


select wildcard ;

The select attribute is used to specify the initial file filter for the filename list. The wildcard is a string expression which contains a path and wildcard. Example
select "/data/*.img";

This attribute is used ONLY by the filename framepart.

SHORTFORM Attribute

The syntax is:


shortform ;

The shortform attribute creates a short version of the filename part with only a text input area and an open icon at the right end. Clicking the icon will bring a full form filename list. The behavior of shortform filename will be exactly the same.

SHOWCURRENTVALUE Attribute

The syntax is:


showcurrentvalue ;

128

EML Syntax Reference

The showcurrentvalue attribute specifies that the current value area should be displayed in a slider or thumbwheel framepart. In the slider instance, if the current value is not displayed, then a simple graticule of 10 divisions is displayed instead. In the thumbwheel instance, if the current value is not displayed, then the current value bar above the thumbwheel is not shown. The default value for this attribute is 0, meaning the grayscale will not be shown with the slider, or the current value bar above the thumbwheel is not shown.

SHOWROWCOLUMN Attribute

The syntax is:


showrowcolumn ;

The showrowcolumn attribute specifies that the left-most column of a cellarray, which is used to number the rows, should be displayed. By default, this column will not be displayed. This attribute is used ONLY by the cellarray framepart.

SIZE Attribute

Obsolete in IMAGINE version 8.2 - Use geometry attribute instead. For compatibility reasons this attribute is still supported, but the result of using it in future versions is unpredictable. The syntax is:
size width, height ;

The size attribute specifies the size of a part. The width and height are constants which are given in character units. See the dimension attribute which can be used to specify the size with an expression for width and height.

STATICLIST Attribute

The syntax is:


staticlist ;

The staticlist attribute is used to indicate that the list of choices for a popuplist framepart will always be displayed. By default, only the current choice is displayed, and the user must left-click on the arrow button to see the list of choices. This attribute is used ONLY by the popuplist framepart.

STATUSBAR Attribute

The syntax is:


statusbar ;

The statusbar attribute is used to indicate that the frame should have a status bar. The statusbar is placed at the bottom of the frame.

EML Syntax Reference

129

This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

TITLE Attribute

The syntax is:


title [ titleposition ] titlestring ;

The title attribute of a part displays titlestring near the part to identify the purpose of the part. The value of titleposition may be set to any one of 12 different locations relative to the part as shown below. See the titlefont and titlegap attributes described below for more information about part titles.
title gap left top left center left bottom below left title gap below center below right

above left

above center

above right right top

PART

right center right bottom

TITLEGAP Attribute

The syntax is:


titlegap number ;

The titlegap attribute specifies the spacing between the part and the title. A value of zero places the title adjacent to the part with no intervening space. See the diagram on the previous page with the title attribute.

TITLELIST Attribute

The syntax is:


titlelist stringlist ;

When used with the popuplist framepart, the titlelist attribute specifies the list of values which are displayed in the popuplist. This list must have the same number of items as the list given in the names attribute. These strings are displayed in the popuplist though the actual values of the popuplist are obtained from the names list. When used with the radiobutton framepart, the titlelist attribute specifies the list of values which are displayed in the radiobutton. This list must have the same number of items as the list given in the options attribute. These strings are displayed in the radiobutton though the actual values of the radiobutton are obtained from the options list.

130

EML Syntax Reference

This attribute is used ONLY by the popuplist and radiobutton frameparts.

TITLEOFFSET Attribute

The syntax is:


titleoffset offset [align | noalign];

The titleoffset attributes is used to control the spacing of the area provided for the title associated with each part. The area set aside for each frame part is divided into two areas, one is the titlearea and the other is the control area. The diagram below illustrates the four possible divisions and shows how the titleoffset is used in each case.

Top Center Bottom


TitleOffset

Part Width Control Area

Part Width

Top

Control Area

Center Bottom
TitleOffset

Left

Right

Left
Part Height

Center

Right
Part Height Title Offset Control Area

Control Area

Left Above
TOOLBAR Attribute
The syntax is:

Center Below

Right

toolbar { framepart [ framepart ...] }

EML Syntax Reference

131

The toolbar attribute is used to specify the list of frameparts to display in the toolbar. The list may consist of any mix of buttons, labels, radiobuttons, checkboxes, edittexts, textnumbers, meternumbers and popuplists. The toolbar is always positioned immediately below the menubar if present. Any function available through the toolbar should also be accessible from the menu bar of the frame. Toolbars support resizing of their children beginning in version 9.3. Previously the lock statement on any parts in the toolbar would have been ignored and treated like lock left, top, width, height. This continues to be the default behavior if the lock statement is not used. When the lock statement is used, parts in the toolbar will resize. For example, the text entry field in the toolbar shown here will resize as the frame itself is resized.

The code used in this example is:


toolbar { ... edittext keywords { gap 0; size 29, 1.4; lock left, right, top, height; hint Enter keyword search here; info Enter keyword search; } ... }

This attribute is used ONLY by the frame. It is NOT applicable to any framepart.

VALUE Attribute

The syntax is
value expression ;

132

EML Syntax Reference

The value attribute specifies an expression to be used to compute the value of a framepart. Every framepart in EML has a value. Initially the value of most parts is empty. Through interaction with the user, however, each part can receive a value which is either a number or a string. The value of a part can be used in an expression just like a variable using the notation "$partname". The dollar sign ($) indicates the value of the part is to be used. An assignment statement has the form "set partname = expression". If the name of the part appears on the left-hand side of an assignment statement, then the value of the part is changed and the appearance of the part on the screen is updated to reflect the change. The value attribute may be specified for a framepart to define its initial value. If the expression used to give the value contains a reference to another framepart then the value is updated whenever the value of the part in the expression changes. This allows a spreadsheet-like automatic calculation of framepart values. Also see Linked Part Values and Getting and Setting Part Values.

VERTICALSCROLLBAR Attribute

The syntax is:


verticalscrollbar ;

The verticalscrollbar attribute specifies that the cellarray or canvas is to have a vertical scroll bar. This attribute is used ONLY by the cellarray and canvas frameparts. the xlsfonts command. The fontname is a string constant and may not be an expression.

VISUAL Attribute

The syntax is:


visual [ default | pseudocolor | directcolor | truecolor ] ;

The visual attribute controls the display type to be used by the drawing area within a canvaspart framepart. This can affect how much memory is used by the canvas. If the default modifier is used, the system default display type is used. If the pseudocolor modifier is used, then an 8-bit pseudocolor display is used. If the directcolor modifier is used, then a 24-bit direct color display is used. If the truecolor modifier is used, then a 24-bit true color display is used. This attribute is used ONLY by the canvaspart framepart.

EML Syntax Reference

133

VSCROLL Attribute

The syntax is:


vscroll ;

The vscroll attribute specifies that the edittext is to have a vertical scroll bar if it is a multiline text. If the vscroll attribute is not present, some lines may not be accessible to the user. This attribute is used ONLY by the edittext framepart.

Number Attributes
DELTA Attribute

The textnumber and meternumber parts have a number of attributes in common. These are described below. The syntax is:
delta [strict] value ;

The delta attribute affects the value by which the number is incremented or decremented when the "nudgers" are used. If the delta attribute is not given, a default value of 1.0 is assumed. The value is an expression which is evaluated at the time the framepart is created. The actual increment used by the nudger may not be exactly the same as value. If the strict modifier is not specified, then the nudgers use a power of 10 (such as 100 or 0.1) which is near to value. The user can choose a different power of 10 by middle-holding on the increment or decrement buttons. If the strict modifier is used, then the nudgers will increment and decrement by exactly value. Middle-holding on the nudgers will have no effect. The user can only select a value which is exactly the same as the minimum value or is an exact multiple of value larger than the minimum value. For the slider framepart, the delta value is the amount that a value can change when receiving input from the mouse or arrow keys. For the thumbwheel framepart, the delta value is the amount that a value can change when receiving input from the mouse. This attribute is used ONLY by the meternumber, textnumber, slider, and thumbwheel frameparts.

FORMAT Attribute

The syntax is:


format string ;

134

EML Syntax Reference

The format attribute sets the display format to be used if the value of the label is a number. It describes how to convert the numeric value of a label into a string. This is not the same formatting as discussed in Number Formatting. This is a much simpler format which specifies the total number of digits (T) and the number of decimal places (D) to be displayed in the form "T.D". Example
format "6.3" ; format "10.0" ;

Result:
123.456 1234567890

This form of the format attribute is used ONLY by the label, meternumber, and textnumber frameparts. Consult the format attribute under "Framepart Attributes" for the format strings supported by columns in a cellarray framepart.

Framepart Functions
DEFAULTSOURCESET Function

The following functions are used with all frameparts.

Syntax Return Arguments Description

$part.DefaultSourceSet() None None. The defaultsourceset function identifies this part to be the default source of frames created in the future. Any frame created without an explicit source will use this part as its source.

GEOMETRYSET Function
Syntax Return Arguments Description
$part.GeometrySet(x, y, width, height) None All arguments are integers. The geometryset part function is used to set the position and size of a part in a single statement. This function takes four numeric parameters: x, y, width, height.

EML Syntax Reference

135

TITLEGET Function
Syntax Return Arguments Description
$part.TitleGet() This function returns a string which contains the title of the part. None The titleget part function is used to get the title of a part. Every part in EML may have a title. The title is typically used to label the part when it is displayed.

TITLESET Function
Syntax Return Arguments
$part.TitleSet(<title>) None <title> is a string to be used as the new title for the part. The titleset function sets the title of a part. For most frameparts, this is only effective if done before the part is displayed. The title of frames and buttons, however, can be changed at any time and the change will be immediately reflected.

Description

CellArray Framepart Functions


COLUMNSELECT Function

The following functions are used only with cellarray frameparts. All non-keyword strings including the empty string must be enclosed within double quotes.

Syntax Return

$cellarray.ColumnSelect( selectstring ) None The selectstring is all, none, or invert. all causes all columns to be selected. none deselects every column. invert selects everything that was not selected, and deselects everything that was selected. The columnselect part function changes which columns (if any) are currently selected in the cellarray.

Arguments

Description

136

EML Syntax Reference

COPY Function
Syntax Return Arguments Description
$cellarray.Copy( ) None None The copy part function causes the currently selected rows and/or columns to be duplicated to the clipboard, which can be pasted into other cells in the array.

DELETE Function
Syntax Return Arguments Description
$cellarray.Delete( ) None None The delete part function removes the currently selected columns from the cellarray. This operation cannot be undone.

EXPORT Function
Syntax Return Arguments Description
$cellarray.Export( ) None None The export part function causes the cellarray export dialog to be displayed, giving the user an opportunity to export the contents of the selected rows and columns to a file.

FORMAT Function
Syntax Return Arguments Description
$cellarray.Format( [ formatstring ] ) None An optional string that represents the new format for the selected columns. If no value is supplied, a dialog will allow the user to select a new format. The format part function allows the user to change the display format (numeric, date, etc.) of the selected columns.

EML Syntax Reference

137

IMPORT Function
Syntax Return Arguments Description
$cellarray.Import( ) None None The import part function causes the cellarray import dialog to be displayed, giving the user an opportunity to import the contents of a file into the selected rows and columns.

PASTE Function
Syntax Return Arguments Description
$cellarray.Paste( ) None None The paste part function causes the contents of the clipboard to be inserted into the currently selected rows and/or columns. The clipboard must be previously populated by a copy operation.

REPORT Function
Syntax Return Arguments
$cellarray.Report( ) None None The report part function causes the cellarray report dialog to be displayed, giving the user an opportunity to format a report file based upon the cellarray. The report will cover the entire cellarray, or upon any rows or columns that are selected.

Description

ROWINSERT Function
Syntax Return
$cellarray.RowInsert( where ) None The argument states where the row should be inserted. The value of where must be before or after or nothing will happen. before means that the new row should be inserted before the selected row. after means that the new row should be inserted after the selected row. The rowinsert part function will cause an empty row to be inserted before or after the first selected row in the cellarray.

Arguments

Description

138

EML Syntax Reference

ROWSELECT Function
Syntax Return
$cellarray.RowSelect( [ selectstring ] ) None The optional selectstring is all, none, invert, or a query string. all causes all rows to be selected. none deselects every row. invert selects every row that was not selected, and deselects every row that was selected. An empty string ("") will cause the row criteria dialog to be opened, allowing the user to form their own query that controls what rows will be selected. A query string causes rows that match that criteria to be selected, deselecting all others. The rowselect part function changes which rows (if any) are currently selected in the cellarray. This function is identical to the other rowselect part functions, except when a query string is supplied. In that case, this function acts as if performing the Select function from the row Selection Criteria dialog.

Arguments

Description

ROWSELECTADD Function
Syntax Return
$cellarray.RowSelectAdd( [ selectstring ] ) None The optional selectstring is all, none, invert, or a query string. all causes all rows to be selected. none deselects every row. invert selects every row that was not selected, and deselects every row that was selected. An empty string will cause the row criteria dialog to be opened, allowing the user to form their own query that controls what rows will be selected. A query string selects those rows that match the criteria, without disturbing any others. The rowselectadd part function changes which rows (if any) are currently selected in the cellarray. This function is identical to the other rowselect part functions, except when a query string is supplied. In that case, this function acts as if performing the Add function from the row Selection Criteria dialog.

Arguments

Description

EML Syntax Reference

139

ROWSELECT-REMOVE Function
Syntax Return
$cellarray.RowSelectRemove( [ selectstring ] ) None The optional selectstring is all, none, invert, or a query string. all causes all rows to be selected. none deselects every row. invert selects every row that was not selected, and deselects every row that was selected. An empty string will cause the row criteria dialog to be opened, allowing the user to form their own query that controls what rows will be selected. A query string deselects those rows that match that criteria, without disturbing any others. The rowselectremove part function changes which rows (if any) are currently selected in the cellarray. This function is identical to the other rowselect part functions, except when a query string is supplied. In that case, this function acts as if performing the Remove function from the row Selection Criteria dialog.

Arguments

Description

ROWSELECTRESELECT Function
Syntax Return
$cellarray.RowSelectReselect( [ selectstring ] ) None The optional selectstring is all, none, invert, or a query string. all causes all rows to be selected. none deselects every row. invert selects every row that was not selected, and deselects every row that was selected. An empty string will cause the row criteria dialog to be brought up, allowing the user to form their own query that controls what rows will be selected. A query string selects only those rows that meet the criteria and are already selected. All others are deselected. The rowselectreselect part function changes which rows (if any) are currently selected in the cellarray. This function is identical to the other rowselect part functions, except when a query string is supplied. In that case, this function acts as if performing the Subset function from the row Selection Criteria dialog.

Arguments

Description

140

EML Syntax Reference

STATS Function
Syntax Return Arguments Description
$cellarray.Stats() None None The stats part function causes column statistics to be computed and displayed as another cellarray. This function is equivalent to selecting "Compute Stats..." item from the column options menu

Filename Framepart Functions


ADDTYPEDEF Function

The following functions are available only for filename list frameparts.

Syntax Return

$filename.AddTypeDef( filterspec[, modifiers] ) None The filterspec argument specifies the types that should be added to the list allowed by the given filename part. All of the optional modifiers supported by the filetypedef attribute are permitted. If using the optionframe modifier, the name of the option frame must exist in the same EML script as the filename part, and its name must be specified as a text string. Consult the documentation of the filetypedef attribute for the syntax of filterspec and its modifiers. The addtypedef part function adds one or more types from a FileFilter DLL to the list of types supported by a filename part. By calling the cleartypedefs part function and calling addtypedef as many times as is necessary, you can dynamically configure and reconfigure the set of types supported by filename.

Arguments

Description

EML Syntax Reference

141

AUTOEXTEND Function
Syntax Return Arguments
$filename.AutoExtend( filenamebase ) This function returns the full filename, after adding the default extension (if any apply) to filenamebase. The result is the same as when you enter filenamebase in the filename part. The base part of a file name. The autoextend part function, will add an extension to a filename, according to the filename parts autoextension rules. If the file already has an extension, or is enclosed in double quotes, no extension is added. Otherwise, if the current file type has a well-known extension (i.e. ".img"), then that extension is added.

Description

BOUNDARIESKNOWN Function
Syntax
$filename.BoundariesKnown() This returns a Boolean value which is 1 if the map boundaries of the named file are known, or 0 otherwise. This function can be helpful in determining if the values returned by the ulx, uly, lrx, and lry part functions will be of any use. None The boundariesknown part function is used to determine whether or not the file named by the filename part has map boundaries. This includes raster images that have been calibrated. If you would rather exclude calibrated raster images, the flag part function can be used instead. In this example the filename part input has the value "$IMAGINE_HOME/examples/lanier.img"

Return

Arguments

Description

Example

on mousedown { if ( $input.BoundariesKnown() ) { echo "The map boundaries are known"; }

142

EML Syntax Reference

CATEGORYTEST Function
Syntax
$filename.CategoryTest( candidatefilename ) This function tries to determine the category of candidatefilename, using the list of categories allowed by the filename part. Possible values include the name of the FileFilter DLL (e.g. "raster", "vector", "Annotation") or pseudotitles for types that do not have a DLL (e.g. "Map Composition") None Each filenamepart may name a list of valid file categories by using the filetypedef keyword. The categorytest function checks to see which category a given filename would fall under. In other words, categorytest("foo") returns what getcategory() would return, if "foo" were selected in the filename part. In this example the filename part has the following list of filetypedef keywords and the named file is "$IMAGINE_HOME/examples/lanier.img".

Return

Arguments

Description

Example

filetypedef "raster"; filetypedef "Annotation (*.ovr)" filetypedef "coverage(*.arcinfo)" on input { echo "This would be " $input.CategoryTest("lnanno.ovr"); }

This would be Annotation

CLEARTYPEDEFS Function
Syntax Return Arguments
$filename.ClearTypeDefs() None None. The cleartypedefs part function will restore the filename part to a state where it does not recognize any specific file types. In conjunction with the addtypedef part function, you can completely control the set of types allowed by the filename part. After calling cleartypedefs, it is recommended that you call addtypedef or templateset, so that the filename part has some basis for filtering.

Description

EML Syntax Reference

143

DATATYPE Function
Syntax Return Arguments Description Example
$filename.DataType() The pixel type of the raster file currently named by filename. The values specify a datatype (e.g. "U8", "S16", "F32", "C128"). If the named file is not a raster, an empty string is returned. None The datatype part function is used to determine the data type of the image named by the filename part. In this example the filename part input has the value "$IMAGINE_HOME/examples/lanier.img"

on mousedown { echo "File Data Type is " $input.DataType(); File Data Type is U8

FILETYPE Function
Syntax
$filename.FileType() The filetype of the file currently named by the filename part is returned. The return values depend upon the FileFilter DLL involved. The raster.dll returns "truecolor", "greyscale", or "pseudocolor", Annotation.dll returns "Annotation", coverage.dll returns "coverage". If the DLL does not supply layer information, the return value is "unknown". None The filetype part function is used to obtain the type of image named by the filename part. In this example the filename part input has the value "$IMAGINE_HOME/examples/lanier.img"

Return

Arguments Description Example

on mousedown { echo "The File Type is " $input.FileType(); The file type is truecolor

144

EML Syntax Reference

FLAG Function
Syntax
$filename.Flag() This returns a Boolean value which is 1 if the named file is: (a) a raster image with non-calibrated Map Information, (b) an annotation with Map Boundaries, or (c) a coverage with Map Boundaries. If none of the above are true, flag returns 0. None The flag part function is used to determine whether or not the file named by the filename part has map boundaries other than through calibration. The boundariesknown function is a more general way to determine if values are known for the map boundaries of the image, as returned by the ulx, uly, lrx, and lry part functions. In this example the filename part input has the value "$IMAGINE_HOME/examples/lanier.img"

Return

Arguments

Description

Example

on mousedown { if ( $input.Flag() ) { echo "The map boundaries are known for this non-calibrated image"; } }

GETCATEGORY Function
Syntax
$filename.GetCategory() This function returns the category of the file named by the current filename part. The category is determined by comparing against the list of file categories defined by the filetypedef keywords in the named filename part. Possible values include the name of the FileFilter DLL (e.g. "raster", "vector", "Annotation") or pseudotitles for types that do not have a DLL (e.g. "Map Composition") None Each filenamepart may name a list of valid file categories by using the filetypedef attribute. The getcategory function checks against the named categories and determines which is the category of the file currently named by the filename part. In this example the filename part has the following list of filetypedef keywords and the named file is "$IMAGINE_HOME/examples/lanier.img".

Return

Arguments

Description

Example

EML Syntax Reference

145

filetypedef "raster"; filetypedef "Annotation (*.ovr)" filetypedef "coverage(*.arcinfo)" on input { echo "The category is " $input.GetCategory(); }

The category is raster

HEIGHT Function
Syntax Return Arguments Description
$filename.Height() This function returns the height of the image as the number of rows, if the filename is a raster image, or 0 otherwise. None The height function supplies the height of a raster image.

LAYERCOUNT Function
Syntax Return Arguments Description
$filename.layercount() This function returns the number of layers, if the file named by the filename part is a raster image, or 0 otherwise. None The layercount function supplies the number of layers in a raster image. This is OBSOLETE in 8.3; the nbands part function should be used instead.

146

EML Syntax Reference

LONGNAME Function
Syntax
$filename.LongName() A "long" descriptive name of the kind of file currently named by the filename part is returned. The return values depend upon the FileFilter DLL involved. Some example values are "JFIF", "Arc Coverage", or "Terramodel Layer". If no DLL is involved, the name will be descriptive as possible. If no filetypedef attribute is specified at all, the values could be "input", "output", "unknown" , or "default". None The longname part function is used to describe the type of file named by the filename part. In this example the filename part input has the value "$IMAGINE_HOME/examples/lanier.img"

Return

Arguments Description Example

on mousedown { echo "The long name for type is " $input.LongName(); } The long name for type is IMAGINE Image

LRX Function
Syntax Return Arguments
$filename.lrx() This function returns the X position, in map coordinates, of the lower right corner of the file named by the filename part, provided that location is known. None The lrx part function supplies the lower right X coordinate of the bounding box of an image. This is not always known. It is recommended you use the boundariesknown or flag part function to determine if a useful value is available.

Description

EML Syntax Reference

147

LRY Function
Syntax Return Arguments
$filename.lry() This function returns the Y position, in map coordinates, of the lower right corner of the file named by the filename part, provided that location is known. None The lry part function supplies the lower right Y coordinate of the bounding box of an image. This is not always known. It is recommended you use the boundariesknown or flag part function to determine if a useful value is available.

Description

NBANDS Function
Syntax Return Arguments Description
$filename.nBands() This function returns the number of layers, if the file named by the filename part is a raster image, or 0 otherwise. None The nbands function supplies the number of layers in a raster image.

PIXELHEIGHT Function
Syntax
$filename.PixelHeight() This function returns the height, in map units, of a row of a raster image, if filename is a raster image with map coordinates. This function returns a nominal pixel size for annotations and for raster images with rotation or skew. This function returns 1 for files without map coordinates.

Return

PIXELWIDTH Function
Syntax
$filename.PixelWidth() This function returns the width, in map units, of a column of a raster image, if filename is a raster image with map coordinates. This function returns a nominal pixel size for annotations and for raster images with rotation or skew. This function returns 1 for files without map coordinates.

Return

148

EML Syntax Reference

QUERYFORFILENAME Function
Syntax Return
$filename.QueryForFilename( [ template ] ) This function returns a Boolean value which is1 the user selects a new file name, or 0 if the user cancels out of the File Chooser. The template argument, which is optional, can be used to specify the default type that the File Chooser will be looking for. The user may switch among the types allowed by the filename part. Refer to the cleartypedefs and addtypedef part functions if you wish to change the set of types allowed by the File Chooser. The queryforfilename part function launches the File Chooser, which allows the user select a file that matches any of the types allowed by the given filename. This function is typically used for an "off-screen" filename that is never displayed to the user. In this way, the user only sees the File Chooser when it is launched at times determined by the EML script. If the filename part is "on-screen", then the user typically chooses when to launch the File Chooser by pressing on the chooser button in the text entry area.

Arguments

Description

RASTERLAYERLIST Function
Syntax Return Arguments Description
$filename.RasterLayerList() This function returns a list of the layers, in the raster file named by the filename part. An empty list is returned if the file is not a raster image. None The rasterlayerlist function supplies the names of the layers in a raster image.

EML Syntax Reference

149

TEMPLATEGET Function
Syntax Return Arguments
$filename.TemplateGet( )

The template (a wildcard) of the filetype currently selected in the file chooser. Some example values are "*.img", "*.arcinfo", or "*.map". None The templateget part function returns the wildcard that the filename currently uses to scan directories. This may be a real wildcard, such as "*.jpg", or a pseudo-wildcard such as "*.grid" which yields all GRID coverages, regardless of the coverage name. This function is not symmetrical to the templateset part function. It returns the currently selected wildcard, which is not necessarily the value "remembered" by templateset.

Description

TEMPLATESET Function
Syntax Return Arguments
$filename.TemplateSet( template ) None The template to be allowed (and remembered) by the file chooser. This should be a wildcard such as "*.doq". The templateset part function changes the current template of the filename part (thereby causing a rescan). In addition, this template is remembered, and enforced by output choosers (those that have specified the newfile attribute). Even if the user changes the wildcard, the filenamepart will warn the user if they try to specify an output filename that does not conform to this template.

Description

This function essentially allows the user to override the template specified by the select attribute. It is superceded by filterspecs, which are a better way to control the filename filtering. To use filterspecs, use the filetypedef attribute(s), which can be changed dynamically using the cleartypedefs and the addtypedef part functions. templateset is needed for occasions when it is not convenient to specify a filterspec If you just need to change the template to rescan the directory, you can assign the value of the filename to the template.

150

EML Syntax Reference

ULX Function
Syntax Return Arguments
$filename.ulx() This function returns the X position, in map coordinates, of the upper left corner of the file named by the filename part, provided that location is known. None The ulx part function supplies the upper left X coordinate of the bounding box of an image. This is not always known. It is recommended you use the boundariesknown or flag part function to determine if a useful value is available.

Description

ULY Function
Syntax Return Arguments
$filename.uly() This function returns the Y position, in map coordinates, of the upper left corner of the file named by the filename part, provided that location is known. None The uly part function supplies the upper left Y coordinate of the bounding box of an image. This is not always known. It is recommended you use the boundariesknown or flag part function to determine if a useful value is available.

Description

UNITS Function
Syntax
$filename.Units() This function returns the units of any map coordinates associated with filename. If the file has no map coordinates, or the specific units are not known, this function returns "other" (or in some rare cases "unknown").

Return

WIDTH Function
Syntax Return Arguments Description
$filename.Width() This function returns the width of the image as the number of columns, if the filename is a raster image, or 0 otherwise. None The width part function supplies the width of a raster image.

EML Syntax Reference

151

List Framepart Functions


GETLISTINDEX Function

The following functions are used only with scrolllist and popuplist frameparts.

Syntax Return Arguments Description

$<listpartname>.GetListIndex() This function returns the numeric index of the currently select item in the scrolllist or the popuplist. The index starts at zero for the first item. If no item is selected, -1 is returned. None The getlistindex part function can be used to find the numeric index of the item currently selected in a scrolllist or popuplist

SETNAMEANDTITLELIST Function
Syntax Return
$<listpartname>.SetNameAndTitleList( namelist, titlelist ) None The namelist contains the actual possible values for the scrolllist or the popuplist part. The titlelist is the set of names to be presented to the user. Each list should contain the same number of items. The setnameandtitlelist part function changes both the internally used names for items and the externally displayed names for the items in the scrolllist or the popup list. The setnamelist and settitlelist part functions can be used to set these lists independently.

Arguments

Description

SETNAMELIST Function
Syntax Return
$<listpartname>.SetNameList( namelist ) None The list of possible values for the scrolllist or the popuplist part. This list is only displayed to the user if there is no titlelist for the part. Otherwise, the values in the titlelist are displayed to the user. The setnamelist part function changes the internally used names for items in thescrolllist or the popup list. The setnameandtitlelist part function can be used to simultaneously set both this list and the list of titles.

Arguments

Description

152

EML Syntax Reference

SETTITLELIST Function
Syntax Return
$<listpartname>.SetTitleList( titlelist ) None The list of strings to be displayed in the scrolllist or the popuplist. This is the list actually displayed to the user, although the name list contains the possible values of the scrolllist part or the popuplist part. The settitlelist part function changes the externally displayed items in the scrolllist or the popup list. The setnameandtitlelist part function can be used to simultaneously set both this list and the list of internally used names.

Arguments

Description

EML Syntax Reference

153

154

EML Syntax Reference

EML Syntax Reference

155

156

EML Syntax Reference

EML Syntax Reference

157

158

EML Syntax Reference

EML Syntax Reference

159

160

EML Syntax Reference

EML Syntax Reference

161

162

EML Syntax Reference

EML Syntax Reference

163

164

EML Syntax Reference

EML Syntax Reference

165

166

EML Syntax Reference

EML Syntax Reference

167

168

EML Syntax Reference

EML User Interface Standards


Introduction
This document explains the standards for writing EML scripts that are used by ERDAS, Inc. These standards were written for the following reasons: Consistency in EML Scripts These standards describe the terminology, spelling, punctuation, and use of frameparts that are used in the IMAGINE user interface. Consistency in User Interface These standards are to be used to provide a consistent look and feel across all IMAGINE applications. On-Line Help On-line help is generated and distributed based on the content of EML files.

This chapter contains the following sections: General Guidelines for EML Scripts Punctuation in EML Titles Info Strings Toolbars Help Button Batch Button Components and Frames File Naming Document Frames Modal Dialogs Modeless Dialogs Tool Palettes Menu Dialogs Standard Buttons Standards for Frameparts Icon Formats

EML User Interface Standards EML User Interface Standards

169 169

General Guidelines for EML Scripts

The following are some very important guidelines for all EML programmers. These guidelines should be strictly followed in writing EML scripts. Use relative positioning for frameparts whenever possible. This ensures compatibility with future changes to EML, the C Programmers Toolkit, and supported windowing systems. Never use spaces in LABEL part values to line up things. Use the AT attribute for absolute positioning only when you are unable to use relative positioning. Be consistent when giving the part attribute SIZE. Ensure that none of the parts in that dialog is larger than the frame itself. Mistakes like this produce unpredictable results.

Punctuation in EML Titles

The title is an attribute of all frames and frameparts, and should be used to add descriptive text to the dialog box for each framepart. All of the titles that you define in EML show up in the software and in the On-Line Help. Use special care in writing these titles. Titles are almost always in initial caps such as Text Area.

Ellipsis Ellipses (...) are used in menu options and on buttons whenever that option leads to another dialog box. Colons Colons are used in titles that refer to another nearby element in the dialog box. For example, an edit text field title describes the edit text field that is near the title, and therefore, it should have a colon. Group titles always contain a colon. If the framepart presents information (e.g., number of bands in a file) then the title should contain a colon. Buttons never use colons since the title is within the button itself. Use of Labels A label can be used to add descriptive text, but it should not be used as the title of a frame or a framepart. Use the title attribute instead. This rule is especially important for EMLs from which On-Line Help will be generated. A label is treated as a framepart, and a separate entry is created for a label in the On-Line Help. If that label actually refers to a framepart, then there are two entries in On-Line Help for that framepart, instead of one.

170

EML User Interface Standards

Info Strings

Every part should contain the info attribute. This keyword is followed by a descriptive string which is displayed in the statusbar area of the parent frame. For example:
button cancel { title Cancel; size 6,1.5; info Cancels the current operation and exits this frame.; on mousedown undisplay framename; }

Toolbars

Toolbars are used in Document Frames to provide access to often used functions. A toolbar is created with the following syntax:
toolbar { button b1 { icon open.icon; info Open a New Document; on mousedown open(); } : : }

A toolbar may contain icons, buttons, checkboxes, radiobuttons, single line edittexts, and textnumbers. As of version 9.3, toolbars support resizing of their children. This is done by using the lock statement. See Toolbar Attribute.

Help Button

All dialog boxes need to have a Help button with the exception of instruction boxes or simple question dialogs like Do you want to exit?. In the macro, the description would be similar to this example:
button helpbutton { title Help; size 6,1.5; at 10, 5; info Gives help for this dialog; on mousedown showhelp; }

EML User Interface Standards

171

Batch Button

All frames that launch a job should have a Batch button. Heres an example:
button batchbutton { title Batch; size 6,1.5; at 10,5; on mousedown { startbatchsingle; batchjobname batchjobname; /*default job name*/ send mousedown to ok; } }

The Batch button eliminates the need to turn batch mode on, send a command to the batch queue, and then turn batch mode off. In the example, the OK button is assumed to send the command with all of the parameters specified in the dialog to the executable program. The Batch button turns on batch mode, does a remote button press of the OK button and then turns batch mode off.

Components and Frames

EML code is organized into components and frames. Frames are easy to understand they are the dialog boxes in the software. But what are components? A component is the smallest self-contained unit in the IMAGINE user-interface. Components and groups of components can become modules of the software, which may be distributed separately. For every component there is a subdirectory of On-Line Help files. Context-sensitive On-Line Help uses the component name and frame name to find the subdirectory and file of On-Line Help, respectively. For On-Line Help generation and distribution, components are identified from the names of EML files in $IMAGINE_HOME/scripts. These eml files are parsed, and a list of the components and frames is generated for use in On-Line Help generation. That is why $IMAGINE_HOME/scripts should never be used for test files.

For these reasons, components must be created with care. They should be well-thought-out parts of the overall software package.

File Naming

Each EML file should have the .eml extension and, if it defines a component, it must be named after the component. For example, the EML file that contains the definition:

172

EML User Interface Standards

component mapcomposertools { ... }

should be named mapcomposertools.eml. There can be any number of frame definitions per file. Component and Frame Names On-Line Help subdirectories are named after components and files are named after frames. Therefore, every component name and frame name should follow the system rules for directory and file names.

Document Frames

Document frames have the following characteristics. They are used to display/edit one or more documents. There is a title bar which should always reflect the current window and the document being displayed and edited in the window. There is always a menu bar. The menu bar must have the File and Help menus. The File menu must have Close as the last (or next to the last) item. There is always a tool bar which contains icons to invoke frequently used operations. Scroll bars are present in most document windows, though they are not necessary. There is always a status bar which is used to display status messages and framepart descriptive information. Document Frames are typically resizeable. There are some cases where this is not necessary as in imageinfo.

Modal Dialogs

A Modal Dialog has the following characteristics. It is used to display/query information in a serial fashion. Its use precludes the use of any other dialog in the application until it is dismissed. The frame Title should reflect the function of the dialog.

EML User Interface Standards

173

Generally, it has the OK, Cancel, and Help buttons. These buttons are evenly spaced along the bottom of the dialog. The Help button is always on the right; the OK button is always on the left. When present, the Cancel button is next to the Help button. Any other buttons which may be needed are positioned between the OK and Cancel buttons. The size of the buttons should be 6 wide and 1.5 high. If the text is long, then the button width may be increased to handle it. If the number of buttons exceeds the width of the frame by a small amount, then the width of all the buttons may be reduced evenly so that all of the buttons fit along the bottom of the dialog.

Modeless Dialogs

Modeless dialogs must conform to all of the rules for a modal dialog with the following exceptions: A modeless dialog does NOT preclude interaction with the rest of the application. A modeless dialog has a Close button instead of a Cancel button. When the Close button is pressed, the modeless dialog is removed from the screen without initiating an action. A modeless dialog typically has one or more action buttons along the bottom of the dialog. If there is only one then it should be called Apply. If there are more, then they should be named in accordance with their function.

Tool Palettes

A tool palette has the following features: The icons are arranged as two columns. The upper left icon should be the Select icon. The buttons in the main group act in a radio fashion. That is, only one may be depressed at a time. There is a Keep Tool check box which controls the behavior of the tool palette. When the palette is locked (the Keep Tool button is depressed). Then the selected tool can be used repeatedly without reselection. When the button is not depressed then the tool palette reverts to the Select position when the tool is used. The Help button is labeled with a (question mark) icon to maintain visual consistency in a tool palette.

174

EML User Interface Standards

The very bottom of the tool palette has a Close button which dismisses the palette.

Menu Dialogs

The option buttons should all be 14 units wide and 1.5 units high. Each name should end with an ellipsis (...) since that button displays another dialog. There should be a Close and a Help button at the bottom of the dialog.

Standard Buttons

Every dialog should have three standard buttons. The use of the standard buttons OK, Cancel, Apply, Close and Help depends upon whether a frame is modal or modeless as described above. These buttons should be positioned at the bottom of a dialog box, as explained below it is all right to have other buttons between them. They should be consistently used as follows: OK (note the spelling: uppercase O, uppercase K) Act upon the information entered in the dialog and close it. This should be the leftmost button in the bottom of a modal dialog. Cancel Close the dialog but do NOT act upon the information entered in the dialog. The user has brought up the wrong dialog or has entered information on which he/she does not want to act. This should be the button immediately to the left of the Help button in a modal dialog. Apply Apply the changes as specified, but keep the dialog box open. This should be the leftmost button on the bottom of a modeless dialog. Close Close the dialog but do NOT act upon the information entered in the dialog. This should be the button immediately to the left of the Help button in a modeless dialog. Help Connect to the On-Line Help server and display the help file associated with the dialog. This should be the rightmost button in every dialog.

An OK button should always undisplay the frame before other processing is done. This is expected, and it tells the user that the program is not hung up. When you have a dialog that requires picking a file before selecting OK, disable the OK button on framedisplay and then enable it when a file is chosen.

EML User Interface Standards

175

Push Pins If a frame includes a part named dismiss, then a push pin appears on the window banner (if the application is run under the OpenLook window manager).

Standards for Frameparts


If you have more than one dialog that asks for the same info (like projection name), make sure that you use the same framepart for all instances. Button A button is used to initiate an action. A button may be a rectangle with a title centered in it or an icon. Both forms function the same. The standard height for a regular button is 1.5 character spaces. Width may be adjusted for string length and appearance. Checkbox The checkbox provides a toggle mechanism for on/off, yes/no, true/false types of responses. Avoid using a horizontal layout for checkboxes. The title should not have any punctuation (except as explained under Preference Manager). The title wording should be expressed as an action, such as Clear Display. Edittext The edittext is used to provide a simple text input field. It can also provide the capabilities of a multi-line text editor. By default, it is a read/write field, but it can be set to read-only for informational text by giving it the read-only attribute. However, it is preferable to display read-only text with a label instead of an edittext, since the label does not display a box that might lead the user into thinking it is writable. The standard height for this part is 1.5 character spaces. Horizontal sizing is difficult with this part as the actual output size is about one-half that of buttons or textnumbers, so be prepared for some trial and error. Example
edittext text_box { title Text Area; size 10,1.5; relative position; value Enter text here...; }

176

EML User Interface Standards

Filename The filename framepart provides a tool for interactively selecting a file. The script can control which file names are displayed via the select command. The default path in the eml preference database (default_data_path) should be used in the select command. It should show at least four files at a time, preferably more. Dialog boxes that are used frequently should have taller filename boxes than seldom-used ones. Using Adobe-Helvetica-Bold, this part should not be sized larger than 15 units wide since most file names are not that long. You want to avoid wasted space in this part. Example
filename filepart { title Input file:; size 15, 15; relative position; /* ** Select all the files with .img extension in the ** default data path. */ select getpref (eml default_data_path)+*.img; }

Label The label framepart is used to display information in a frame. If a label needs a title and then information, please do not use two labels, but instead give the label a title with the title attribute. This is much easier when generating On-Line Help, because the title shows up as one framepart instead of two. For example
Layer Name: Layer_1

This label is defined as one framepart, with Layer Name: as the title of the label, and a variable containing the layer name as the text. See Use Of Labels. Meternumber The meternumber provides a quantitative as well as a qualitative means of entering or displaying a numeric value. These mostly serve as progress meters and as slide controls for the Colorwheel and the Contrast tools. See Textnumber below.

EML User Interface Standards

177

Menus Menus can call other menus when the subgrouping makes sense. Menus should never go more than three levels deep. Menu items should be arranged from the most-used item at the top to the least-used items at the bottom unless there is a special ordering suggested by the application (e.g., rectification steps should be sequential.) Popuplist The popup list provides a means of selecting one value from a list of several fixed choices. The minimum width for a popuplist is automatically determined by the length of the longest choice name. Popup lists are used when the number of choices is relatively small and static. Radiobutton The radiobutton provides a means of selecting one value from a set of several fixed choices. Almost always, the radiobutton is enclosed in a group and a title is given for the group as well as for each button. The title should be centered above the group. Avoid using a horizontal layout for radiobuttons. Scrollist The scrollist provides a means of selecting a single value from a long list of choices. Like the filename, the scrollist should show at least four options and preferably more. This part is usually controlled by an application program that can dynamically change the choices. If the number of choices is small and static, use a popuplist instead. Slider The slider provides a means to interactively set one or more values in a range defined by a minimum and a maximum. The minimum value is typically 0.0, and the maximum value is typically 100.0. Values are set by movable indicators, or handles, placed along a scale. Textnumber The textnumber provides a means of entering or displaying a numeric value. Keep textnumber fields as short as is practical. The standard height is 1.5 character spaces and a typical width is 5. Minimum and maximum values should be set depending upon the real values they are reflecting. Titles for these parts use the left attribute with the center modifier and almost always end with a colon. When aligning one under the other, the active Upper Left for the part is at the Upper Left of the box, not at the title, because you generally want the left sides of the boxes to line up; not the titles. Use the below attribute when possible.

178

EML User Interface Standards

Icons All IMAGINE icons are distributed in <IMAGINE_HOME>/icons, and may be viewed and/or edited with an icon editor supplied with the operating system. The IMAGINE interface uses three different kinds of icons: Application Icons Application icons are displayed on the main menu icon panel. The size of these (64 x 48) is based on the aspect ratio of the screen such that they fit in either the vertical or horizontal main menu orientation. These should have descriptive text at the bottom using gill sans font, medium weight, regular style and either a size of 120 or 140. The bottom of the text (not descenders) should start at the fourth pixel from the bottom. These icons are large enough to allow shading for a 3D effect. Tool Icons (ToolBars and ToolPalettes) These are 16 x 16 (or 32 x 32 for large format) and contain no descriptive text. Cursor Icons These are 16 x 16 and also do not contain descriptive text. They are accompanied by a mask file with the same name as the cursor icon plus an underscore and the word mask. For example, the icon linkviewers.icon should have the accompanying mask file called linkviewers_mask.icon. The mask file can be considered as what you would see with the original icon against a reversed background. For cursor icons and their masks you must also place a hotspot which is the active area for the cursor. Iconedit does not have a means for placing a hotspot so you must use bitmap to do this. Here are some guide lines for placing hotspots into cursor icons: Hotspots for arrow pointers should be in the point of the arrow Hotspots for the I-beam pointer should be on the vertical bar of the I-beam about one-third up from the bottom. Hotspots for cross-hairs should be at the spot where the lines intersect. In general, the location of the hotspot should be easy to locate and obvious. Application Icons Tool Icons Cursor Icons

EML User Interface Standards

179

Icon Formats

Icons can be created using xbitmap or iconedit on the Sun. When using iconedit they may be saved as X Bitmap or as Color X Pixmap. When saved as a Color X Pixmap, iconedit uses the XPM format. When creating color icons the use of colors should be limited. For most tool icons the colors should be white, black, and grey. When creating a color icon use two shades of gray, a light one and a slightly darker one. The lighter shade should be used for the background regions of the icon. This value is replaced by the background color of the button. To insure that this lighter grey color is recognizable it must be used to color the upper leftmost pixel in the icon. That is IMAGINE interprets the color of the upperleft most pixel as the background color.

180

EML User Interface Standards

EML User Interface Standards

181

182

EML User Interface Standards

EML Architecture
Introduction
EML was designed to be a distributed tool shared among cooperating applications. It is implemented as a library of functions which are built into applications to give them a common functionality. The most apparent feature of EML is the creation of GUIs from a script file. Each EML application recognizes the EML script syntax and reads EML script files to create its GUI. EML also provides interprocess communications capabilities which serve to tie all EML applications together. EML is built of the following major pieces: Parser Interpreter GUI Manager Message Manager Preference Manager Session Manager On-Line Help System

Parser

The Parser reads EML script files and converts them into an internal form which represents the user interface and the associated procedures. The EML files can be used to define dialogs and to define scripts which control operations. The dialog definitions are handled by the GUI Manager and the procedures are handled by the Interpreter. The complete syntax of the EML script language is given in EML Syntax Reference. When a script is parsed, all of the GUI elements are converted into a tree structured representation in memory. The GUI manager uses these internal representations to generate the user interface. Each of the procedures is pre-compiled into an internal pseudocode form which can be quickly evaluated by the Interpreter. This approach gives a system whose performance is somewhere between that of a pure interpreter and a pure compiler. If a syntax error is detected, the parser generates an error message which indicates the script file name, the line, and the column number where the error was located. It is the responsibility of each application to display this error. When the parser is opening a script file it looks in the list of directories specified by the environment variable ERDAS_SCRIPT_PATH. This specifies a colon-separated list of directory names which are searched for the named file. The default search path is:

EML Architecture EML Architecture

183 183

for UNIX:
.:$HOME/.imagine820:$IMAGINE_HOME/scripts/$ARCH:$IMAGI NE_HOME/scripts

for NT:
<HOMEDRIVE>:\<HOMEDIRECTORY>\.imagine820 <IMAGINE_HOME>\scripts\<ARCHITECTURE> <IMAGINE_HOME>\scripts

Tree Structure Generated by the Parse Process


Application

Component1

Component2

Frame1

Frame1

= procedure = framepart

184

EML Architecture

GUI Manager

The GUI Manager controls the creation and display of dialogs and the interpretation of user input. It is responsible for transparently adapting the EML dialogs to different systems such as Motif or Windows NT. Once the Parser has generated the in-memory representation (tree structure), the GUI manager can be called on to display any of the frames from any of the components. When a frame is displayed, each of the frameparts is first created and positioned within the frame. If a part does not have a position attribute then it is placed to the right of the last framepart created. If the frame itself has a size, then the automatically positioned parts automatically wrap around. If the frame does not have a specified size, then it takes on the size of the smallest bounding box which contains all of the child frameparts. Each of the users input actions are monitored and are translated into the various framepart behaviors which are described in EML Syntax Reference.

Interpreter

The interpreter handles the interpretation and execution of the pseudocode contained in the procedures. Most of the functions and commands in a procedure are built-in commands and functions which are handled by the interpreter. However, some commands and functions are provided by the application itself. Functions provided by the application are called application functions. Commands which are provided by an application are called application commands.

Application Functions Each application can provide its own set of functions to extend the capability of EML. The functions can take any number of arguments and return values just like the built-in functions. Creating an application function is done using the C Toolkit. An application function is only valid in a script which is used within the application that defines the function. This means that a Viewer application function cannot be used in a script which is read by some other application. Application Commands Commands which are not built-in commands are passed to the Session Manager. If the application for which the command is intended is not running then Session Manager attempts to start it. If the application cannot be found then an error message is displayed.

EML Architecture

185

Linked Part Values Each framepart in EML also maintains a dependency list of other frameparts whose value depend on it. The value attribute defines the dependency implicitly with the expression that is given. Any time a framepart is referenced in a value expression, the dependency list of that part is checked to ensure that it contains the name of the referring part (the dependant part). When a part with a dependant is updated the dependant is also updated. This allows a spreadsheet like automatic recalculation to be setup. Refer to Getting and Setting Part Values for more information. Variables Variables may have zero or more values. If a variable has no value it is said to be empty (which can be tested using the function IsEmpty()). Variables which are not empty are either string or number variables (which may be determined with the functions IsString() or IsNumber()). Each variable may actually have multiple values. The individual components may be accessed like an array ($name[index]). For example a variable called WorkSpace may be defined to hold the name of the directory in which processing is to be done. This could be defined and set with the statements:
variable WorkSpace; set WorkSpace = /usr/data/workarea;

A variable may be defined across all EML applications (a global variable) or it may exist only in smaller localized context (a local variable). The extent of a variables existence is called its scope. Global Variables A global variable is available throughout the system and there may be only one global variable with a given name. The value of global variables are available across processes. Local Variables Local variables are defined in components, frames, or message handlers and their values are visible only within those contexts.

Message Manager

EML relies heavily on the use of messages. When the user clicks on a button or selects an item, a message is generated and sent to the framepart to indicate what event has occurred. When a script is parsed the startup message is sent to the script so that it can perform any necessary initializations. Messages can originate from several places. The most common is from the GUI Manager which sends events in response to user actions. The second source of events is from within procedures.

186

EML Architecture

Message Handlers Messages are received and handled by frameparts, frames, and components. The on attribute is used to define a message handler. Every part may have one or more message handlers associated with it. The message handler specifies a procedure which is to be executed when a particular message is received. There are standard messages which are created and delivered by the system in response to user input and other actions, these are detailed in Event Messages. Message Passing Message delivery proceeds in a bottom to top fashion. If a framepart does not have a message handler for a given message, then the message is sent to the parent of the framepart, which is typically a frame. If the frame does not have a handler for the message, then the message is sent to the component. If the component does not have a handler, then the message is discarded unless there is a receiver registered for the message. A receiver is some framepart in the system which has declared that it wishes to receive all undelivered messages of a certain type. A framepart is made a receiver via the receive attribute. .
Message Delivery Path
Undelivered Message Receiver List

Component

Receiver Frame

framepart

framepart

message generated by an event or procedure

Event Messages User input events generate messages which are delivered by the system. An event message is always delivered to some target, typically a frame or a framepart. If the target knows how to deal with the event, it does; otherwise, the event is sent to the parent of the target. If an event is not accepted, then EML checks to see if there are any registered recipients for the event. If there are, the event is delivered to that target; otherwise, the event is simply ignored.

EML Architecture

187

The following table defines all of the Event Messages that are automatically sent by the Message Manager system:

Message
mousedown

Description
This message is delivered when a user presses and releases the mouse on a part. This is typically generated for a button. This message is delivered when a user enters information in a editable EML part. It is also delivered sometimes when the value of a filename part is changed by the program or EML script. This message is delivered when an EML part value is being changed by an application program, the user, or EML script. Sent only to the filename framepart when a valid file name is entered by an application program, the user, or EML script. Sent when the EML script is parsed. Sent to the framepart after it is displayed. Sent when a frame is resized. Sent when a double-click occurs.

input

valuechanged

filenamechoosen

startup framedisplay frameresize doubleclick

Procedure Messages

Messages can also be generated by scripts. In a script, a function call has the form:
name(arg, arg,...)

If the name is not that of a built-in function or an application function then the message name is delivered to the source of the script as a message. A message can also be sent explicitly with the send command to a named framepart . By placing a message handler at the component level one can use the message delivery mechanism to implement user defined functions in EML.

Session Manager

The Session Manager manages all of the processes in the IMAGINE System. It starts, stops, and communicates with all of the processes. All processes are started by Session Manager and they send/receive commands to/from Session Manager and from others via Session Managers communication mechanisms. The Session Manager is also responsible for keeping global variables and preferences up to date throughout the system. Processes are started in one of four ways described below.

Starting Processes

188

EML Architecture

Application Command If an application command (such as viewer) is issued and the corresponding application is not running, then the Session Manager starts the application and sends the command arguments to it. This mechanism starts only one copy of any given application. This is used for applications such as the Viewer which create and maintain multiple document windows and which support a set of application commands. SPAWN Command If an application is started with the spawn command the session manager starts it with the given command line arguments. It does not check to see if there is only one copy running, so this mechanism can be used to run multiple copies of applications which do not support multiple document windows. The spawn command operates on any executable file. JOB Command If an application is started with the job command the Session Manager starts it with the given command line arguments. It also displays a Job Status dialog which indicates the progress of the application. The Job Status dialog also provides a Cancel button which can be used to stop the application. This mechanism is used to start applications which have no user interface such as the Spatial Modeler Language. SYSTEM Command If an application is started with the system command, the Session Manager pauses until the application completes. This should only be used to run system commands which completes very quickly.

The Session Log

The Session Log is where the status, error, and information text generated by all the applications is written. All the messages in this Session Log window are date/time stamped. The Session Log window can be reached from the main icon panel under the Session pulldown menu. All IMAGINE applications write status information to the Session Log. The Log message can be of two types: Verbose Terse

Verbose messages are mostly informational, they indicate the status of the application (for example: the Viewer application sends a message Displaying layer... every time a layer is displayed on the Viewer). This type of message can be suppressed by changing the user eml preference Log Message Level to terse.

EML Architecture

189

Terse messages always appear in the Session Log since they need to be noticed by the user. For example, if a file is modified, the application sends a message File xxx is being modified to the Session Log. Terse messages are generally suitable for most situations. For troubleshooting and debugging, however, verbose messages can prove to be more useful. The Session Log is actually written to a file specified in the user eml preference Log Path. Depending on the user eml preference set for Session Log Printing, the IMAGINE software may print the Session Log when it terminates. Messages can also be logged manually by the user into the Session Log by using the Log Message dialog accessed under Session/Enter Log Message in the IMAGINE icon panel.

The Command History

Command History is very similar to Session Log except that this logs only the EML commands executed by the currently running script. It also acts like an EML command interpreter. The editable area at the bottom of the dialog may be used to type EML script commands to be submitted to the EML interpreter. The Command History window is accessed by clicking Session/Command Window from the IMAGINE icon panel. The IMAGINE System has a built-in batch processor. The batch processor enables the EML interpreter and other IMAGINE applications to queue time consuming jobs to be run at a later time. The batch processor is turned on by the Start Batch Mode option under Session on the IMAGINE icon panel. While the batch processor on, all the jobs run by the IMAGINE System are entered into a batch queue. When the batch processor is turned off, the batch processor prompts the user to provide a name for the jobs, and when to run the job (date/time), etc. The batch processor is turned off by the Stop Batch Mode option. There is also a option under Session called View Batch Job List which enables the user to view/edit/delete/resubmit the currently queued jobs.

The Batch Processor

Preference Manager

The Preference Manager maintains the database of preferences which allow the user to customize the system.

Preference Data Base The IMAGINE System has a built-in preference manager that manages user preferences and provides access to the preferences for the EML system and IMAGINE Application software. Each category in IMAGINE has a preference database file associated with it that contains the default preferences. The preference database files have an extension .pdf and they are located in the <$IMAGINE_HOME>/defaults directory.

190

EML Architecture

At system startup, these database files are read by the preference manager, the defaults in these files are first overridden by the global preferences defaults in the $IMAGINE_HOME/defaults/v8preference file and finally with the user preferences in $HOME/.imaginexxx/v8preference file. (xxx here is the version number, for example, 810 for Ver. 8.1 release). Preference Editor Preference Manager also provides a Preference Editor which allows you to change/save preference defaults at Global (System) level or Local (User) level. This editor is invoked by the menu option Session/Preference Editor in the IMAGINE icon panel.

Preference Database File Grammar

When the Preference Editor is started, a dialog is created from the entries in the selected .pdf file. The frameparts used are a function of the keyword used to describe the preference type. The preference types are:

type
string logical enumerated numeric

keyword
[maxlength] boolean enums min &/or max

framepart
edittext checkbox popuplist textnumber

All preference types, except numeric, require string arguments (enclosed in double quotes). The basic syntax is:
preferencename(title): defaultvalue infostring;

A semicolon delimits the end of each entry in the preference database file. If no keyword is given, defaultvalue is assumed to be of string type. Example
default_data_path(Default Data Directory): $IMAGINE_HOME/examples Default data path for images

Guidelines for Titles and Info Strings Titles should be succinct and free of punctuation (underscores are permitted). Capitalize each key word.

EML Architecture

191

Info strings should also be brief; especially those associated with popuplists. For popuplists make sure that the initial info string is short since the info string for each option is appended to it. For checkboxes, always phrase the info string as a question. Capitalize the beginning of each info string and keep the rest lowercase. Info strings should form complete sentences and be properly punctuated. String Preference Type The keyword maxlength is used to limit the length of a string to a specified number of characters. Syntax
preferencename(title):defaultstring infostring maxlength value;

Example
log_message_format(Log Message time format): dd/mm/yy hh:mm:ss Date/time format for logmessage prefix maxlength 17;

Logical Preference Type The logical preference type is declared with the boolean keyword. It accepts only one of three pairs of options: yes no, true false, or on off. Syntax
preferencename(title):defaultstring infostring boolean affirmed denied;

Example
cellarray_use3d(CellArray 3D Appearance): yes Should Titles and Row Numbers Have a 3D Appearance boolean yes no;

Enumerated Preference Type The enumerated preference type is declared with the enums keyword. It allows any number of options. Each option consists of a pair of quoted strings. The first string is the value of the part; the second string is the info string. Syntax
preferencename(title):defaultstring infostring enums { value infostring : value infostring };

192

EML Architecture

Example
log_print_type(Session Log Printing): query Print Session Log on exit? enums { always Always print query Ask the user whether to print or not never Never print };

Numeric Preference Type The keywords min and max are used to indicate that defaultvalue is a number and not a string. One or both of these keywords are used to limit one or both extremes of the range of numeric values that defaultvalue may assume. Syntax
preferencename(title):defaultvalue infostring min value max value;

Example
default_dblclk_interval(Double Click Interval): 300 Interval in milliseconds min 200 max 1000;

On-Line Help

The On-Line Help system consists of several manuals. Each manual is composed of several files. All help files are distributed in the <IMAGINE_HOME>/help directory. When IMAGINE is started, the context index file (.hhk) is read into a lookup table. When the Help button is selected on a dialog, the component name and the frame name of the requesting dialog are passed to IMAGINE. These strings are catenated and looked up in the context index to locate the help file (.html) that contains the description of that dialog. None of these files should ever be edited or removed.

EML Architecture

193

194

EML Architecture

EML Architecture

195

196

EML Architecture

C Toolkit Interface to EML


Introduction
While EML can be used to modify existing applications and can even be used to create simple form based applications, applications such as the Viewer or Model Maker can only be created by using the C Toolkit. The Toolkit provides a large API for interfacing with and using EML. This section describes the structure of a program which uses EML and describes the types of things which can be done with the EML API. Detailed documentation for the EML API is found in the C Toolkit documentation itself. EML is not unlike any other window environment such as Motif or MSWindows. In fact EML is built on top of those window systems so one can even mix EML with the native window system capabilities, though this is discouraged since it prohibits portability across platforms. What would be the reasons for accessing EML through the Toolkit? Your application needs to do more than can be done with the commands and functions described in the section on syntax. Your application needs access to EML Toolkit objects such as the CellArray, the ColorWheel, or the Canvas. Your application needs access to data structures not available at the EML script level. If your application meets any of these needs then you should consider using the C Toolkit. The overall structure of an EML application is very straightforward. The GUI elements are created, callbacks are added, and then the main event loop is entered. The GUI elements are defined in the EML Script and are created by Parser. Within this introduction you will find: Files Reading the EML Script The Main Event Loop Getting and Setting Part Values Exiting and Cleaning Up

Files

There are a number of header files within EML. They are all of the form eeml?*.h. The most commonly used ones are listed below.

Header File eeml.h eeml_frame.h eeml_cellarray.h

Description Prototype for all core EML functions Prototypes for Frame specific functions Prototypes for the CellArray.

C Toolkit Interface to EML C Toolkit Interface to EML

197 197

Header File eeml_colorwheel.h eeml_dialog.h eeml_canvas.h eeml_scrollist.h

Description Prototypes for the ColorWheel. Prototypes for the standard dialogs package. Prototypes for the drawing package. Prototypes for dealing with scrolling lists.

Reading the EML Script

Every EML application begins by parsing one or more EML files using eeml_Parse or eeml_ParseVa to read the contents of script file and to create the tree containing the GUI elements. These functions return a pointer to a structure called an Eeml_ParseResult. The Eeml_ParseResult contains the items as described in EML Architecture. Example:
typedef struct _AppData { : } AppData; static AppData appdata; static Eui_Root *theRoot; static Eeml_ParseResult *result static Eeml_TranslationTable appfuncs[] = { opendoc, app_OpenDoc, closedoc, app_CloseDoc, }; : : theRoot = eeml_Init(erdinit, table, argc, argv, &err); result = eeml_ParseVa( ELEX_FILE, "table.eml", theRoot->rootPart , &err, EEML_PARSE_OPTION_APP_FUNCTIONS, appfuncs, EEML_PARSE_OPTION_APP_CONTEXT, appdata, NULL);

In this example, the EML script table.eml is parsed and a single pointer to the result is returned. eml_ParseVa has been called with two options, the appfuncs and the appdata. The appfuncs is a translation table which is used to extend the set of functions known to EML and appdata which provides the application functions with user specific data.

198

C Toolkit Interface to EML

Translation Tables and Application Functions An Eeml_TranslationTable is a structure which associates names with function pointers. This is used by the parser to extend the set of known functions. In the example above the name opendoc is associated with the function app_OpenDoc. By placing this pair in the translation table the parser now recognizes expressions of the form opendoc([arg...]). Each of the application functions should have the following prototype:
Estr_StringList * Eeml_ApplicationFunction __(( Eeml_Menu menu,/* Unused */ Emsc_Opaque *context,/* Function Context */ long argc,/* Argument Count */ char **argv,/* Argument List */ Eerr_ErrorReport **err));

When the application function is called, each of the arguments is converted to a string and passed in via the argv. The number of arguments is contained in argc. Additionally the context argument is a pointer to user defined data which is defined as the appdata in the eeml_ParseVa call or with the eeml_FrameContextSet() function. Application Contexts An application context is a pointer to some user defined data. Each Frame in EML has a context associated with it. The initial value of the application context for all frames in a given component can be set as shown above in the call to eeml_ParseVa. The application context can also be set individually for different frames. When a procedure is executed by the interpreter, the context of the containing frame is passed down to any application functions. This allows a connection between the top of an application and all of its application functions without resorting to global variables. Finding and Duplicating Parts The function eeml_FindPart is used to locate a given frame or even a given framepart within an Eeml_ParseResult. Most of the EML API functions expect a part as an argument. The following is an example of finding a part in a result:
Eui_BasePart *frame; frame = eeml_FindPart(result,"tableframe",&err);

C Toolkit Interface to EML

199

For an application such as the Viewer, ImageInfo or any other which creates and maintains multiple document windows, it is necessary to use a frame as template which is duplicated for each new instance of the document window. This is done by using the original frame as template and then duplicating it as needed using the eeml_PartDup function. The following is an example:
newframe = eeml_PartDup(frame, &err);

Typically the new frame is going to be associated with some new data so the eeml_FrameContextSet function is used to create this association. This provides an environment which allows the creation of any number of document frames, each of which tracks its own data.
newdata = emsc_New(1, AppData); newdata->frame = newframe; eeml_FrameContextSet(newframe, newdata);

When the frame is dismissed, the clean-up code for the frame should free the context. Adding Callbacks Each part may have a list of callback functions associated with it. A callback function is a function which is called by EML when a given message is delivered to a part. For example, the application may have a given function called when the mouse is pressed, that is, when the mousedown message has been received. This association is done using the eeml_AddCallback function. The following is an example of adding a callback function to a button.
ok = eeml_FindPart(result,"tableframe:ok",&err); eeml_AddCallback(ok,okCB,(Emsc_Opaque *) ca,"mousedown",&err);

The part ok from frame tableframe is located and the function okCB is associated with the message mousedown. Now, whenever the user clicks on the OK button, the okCB function is called. In addition, the data pointed to by ca is passed to the callback function. The callback function must have the following prototype:
int callbackfunc( Eui_BasePart *part, Emsc_Opaque *data )

200

C Toolkit Interface to EML

Where *part is a pointer to the part from which the function was called; and *data is the user supplied pointer which can be used to pass data into the function. The function must return either 0 or 1. EML allows multiple callbacks to be assigned to each part for any message. When a message is delivered to a part, EML invokes each of the message handlers. By returning a value of 1 it terminates the loop which calls the next function. Custom Parts Two EML capabilities are available as custom parts. These are the CellArray and the ColorWheel. There is no syntax in EML which allows these items to be declared. Instead the EML script must contain a generic part definition which is located and converted to one of the custom parts in the application program. Each part in EML is based on the Eui_BasePart which contains the core information such as size, position, color, etc. The Eui_BasePart also contains an array of pointers to functions which give a part its specific behavior. In the case of the parts defined in EML Syntax Reference, these function pointers are initially set by the EML Parser. For each of the custom parts, there is an Install function that is used to set up these pointers. For example, the function eeui_CellArrayInstall converts a generic framepart into a CellArray. The following is an example of converting a generic into a CellArray:
/* ** Install the cellarray in the generic part and ** set the initial parameters */ eeui_CellArrayInstall( ca ); eeml_SetParameters( ca, &err, "showrowcolumn", rowflag, "rowcount", nrows, "columncount", 2, "rowtitle", "Row", "nextedit", 2, "rowselectflag", select, "column", 0, "columntitle", "Value", "columnwidth", 4, "columntype", "text", "editflag", edit, "selectflag", select, "getcellvalue", getclassvalue, "putcellvalue", putclassvalue, "cellinfo", NULL, "column", 1, "columntitle", "Class Name", "columnwidth", 10,

C Toolkit Interface to EML

201

"columntype", "text", "editflag", edit, "selectflag", select, "getcellvalue", getclassname, "putcellvalue", putclassname, "cellinfo", NULL, NULL );

The eeml_SetParameters function is used to configure the framepart before it is displayed. Refer to the C Programmers Toolkit documentation for specific information about CellArray and ColorWheel parameters and interactions.

The Main Event Loop

Once the parts have all been initialized, the primary or initial frame should be displayed and then the main event loop should be entered. The main event loop checks for and dispatches messages within the system. The following is an example:
eeml_DisplayFrame( tf, &err ); while ( !theRoot->doneFlag ) { n = 0; eeml_GetNextCommand(theRoot, &context, &argc, &argv, &err ); }

Once the primary frame is displayed, then each application should enter a while loop which continues until the doneFlag in theRoot is set to TRUE. This doneFlag is set when the quit command is issued, or it could be set by the users application code itself. The eeml_GetNextCommand function dispatches messages until an application command is found. When an application command is found it is returned as an array of pointers to string in argv and the number of strings is returned in argc. Application Commands An application command is a command in the script of the form:
appname command arg arg ...;

If the <appname> is the same as the currently running application then the command plus the arguments are placed into a command queue for the application. Each command is then removed from the queue and returned to the application via the eeml_GetNextCommand function. It is up to the application to process the commands which it receives. See Application Commands in the EML Syntax Reference.

202

C Toolkit Interface to EML

The description and syntax of all IMAGINE application commands are provided in the IMAGINE Command and Function Syntax help file.

Getting and Setting Part Values

Each EML framepart has a value. Some such as buttons, meternumber, and textnumbers have numeric value. Others such as radiobuttons and edittexts have string values. The functions eeml_NumberPartValueGet and eeml_StringPartValueGet are used to get the current value of any part. The function eeml_NumberPartValueSet and eeml_StringPartValueSet set the current value of the part and update the display so that the visual appearance of the part agrees with its value. When a part value is changed, the message valuechanged is sent to the part. Any callbacks or message handlers attached to the part are invoked at this time. In addition, every part has a dependency list. If there are any other parts whose values depend on the updated part then those parts are also updated. Refer to VALUE Attribute and Linked Part Values for more information.

Exiting and Cleaning Up

When the application is done, the function eeml_SetDoneFlag can be called to shut down EML. When this is done the doneFlag in theRoot is set to true. The parse result should be freed with a call to eeml_ParseResultFree which shuts down all remaining frames and frees all space used by the parse result.

C Toolkit Interface to EML

203

204

C Toolkit Interface to EML

EML Appendixes
Introduction
This chapter consists of tables filled with formatting and configuration information. There is one section containing an example EML file to produce a slider framepart. Number Formatting Number Input Device Configuration Properties Preference Database Example Slider Framepart EML File

Number Formatting

The format string may consist of up to three semi-colon separated fields of formatting information. If only the first field is given then it is used for all numbers. If the first and second are given then the first is used for positive numbers and the second is used for zero and negative numbers. If all three are given then the first is for positive numbers, the second is for negative and the third is for zero. These are the default conditions for each field, however, each field may specify a condition of the form [<te><value>]. Here <te> is one of <,>,=,<>,>=,<= and <value> is any number. A general format looks like:

#,##0;

(#,##0);

First Field (number>0) Second Field (number<0) Third Field (number=0)

Each field consists of a series of format characters from the following table. Format General 0 Description
Print the number using the general number formatting. This is the general place holder for a digit. It is used to indicate the number of decimal places of precision to be displayed if used on the right of a decimal point and the number of leading zeros to be printed to the left of the decimal point.

EML Appendixes EML Appendixes

205 205

Format # ? . , E+ Ee+ e% $,/, ,-,+,(,),: \ ... d dd ddd dddd m mm mmm mmmm yy

Description
This is the same as the 0 with the exception that nothing is printed if the position would contain a leading or a trailing zero. This is the same as the 0 with the exception that it prints a space for leading and trailing zeros. This indicates where the decimal point is to be included. If this occurs between the digit place holders (0,#,?) then it indicates that thousands should be separated by commas. Use scientific notation. E causes a capital E to be used and e causes a lowercase e to be used. E+ and e+ force the sign to be printed. E- and e- only print the sign if it is negative.

This indicates that the number is to be scaled by one hundred and then displayed with a percent sign (%). Include each of these characters as is in the output. Include the following character as is with no interpretation in the output. Include the characters between the quotes as is with no interpretation in the output. Interpret the number as a time and extract the day. Print the day of the month (1-31) without leading zeros. Interpret the number as a time and extract the day. Print the day of the month (01-31) with leading zeros. Interpret the number as a time and extract the day. Print the day of the week as (Sun,Mon,Tue...). Interpret the number as a time and extract the day. Print the day of the week as (Sunday, Monday, Tuesday...) Interpret the number as a time and extract the month. Print the month as a number (1-12) without leading zeros. Interpret the number as a time and extract the month. Print the month as a number (01-12) with leading zeros. Interpret the number as a time and extract the month. Print the month as (Jan,Feb,Mar...). Interpret the number as a time and extract the month. Print the month as (January, February, March, ...) Interpret the number as a time and extract the year. Print the year as a two digit number (00-99) which is the number of years since 1900.

206

EML Appendixes

Format yyyy h

Description
Interpret the number as a time and extract the year. Print the year as a four digit number (1992). Interpret the number as a time or and angle and extract the hour. Print the hour of the day without leading zeros as (0-23) if 24-hour time is used, or as (1-12) if twelve hour time is used. Interpret the number as a time or angle and extract the hour. Print the hour of the day with leading zeros as (00-23) if 24hour time is used, or as (1-12) if twelve hour time is used. Interpret the number as a time or angle and extract the minute. Print the minute as (0-59) without leading zeros. (m is interpreted as minute instead of month if it follows h or hh. Interpret the number as a time or angle and extract the minute. Print the minute as (0-59) with leading zeros (mm is interpreted as minute instead of month if it follows h or hh. Interpret the number as a time or angle and extract the second. Print the second as (0-59) without leading zeros. Interpret the number as a time or angle and extract the second. Print the second as (0-59) with leading zeros. Use 12-hour time and indicate the 12-hour period with A or a for (AM) and P or p for (PM). Use 12-hour time and indicate the 12-hour period with AM or am for (AM) and PM or pm for (PM). Interpret the number as decimal degrees. Extract and print the degrees without leading zeros. This may be followed with (m,mm,s,ss). Interpret the number as decimal degrees. Extract and print the degrees with leading zeros. This may be followed with (m,mm,s,ss). If the number is positive print (N or n) and if the number is negative (south of the equator) print (S or s). When this is used the sign on the degrees is always positive. If the number is positive (east) print (E or e) and if the number is negative (west) print (W or w). When this is used the sign on the degrees is always positive.

hh

mm s ss A/P a/p AM/PM am/pm dg

deg N/S n/s E/W e/w

EML Appendixes

207

Format [Black] [Red] [Green] [Blue] [Cyan] [Magenta] [Yellow] [White] [=value] [>value] [<value] [>=value] [<=value] [<>value]

Description

Indicate the color code to be used for the output text.

Use this field if the number is equal to the given value. Use this field if the number is greater than the given value. Use this field if the number is less than the given value. Use this field if the number is greater than or equal to the given value. Use this field if the number if less than or equal to the given value. Use this field if the number is not equal to the given value.

Numbers which are interpreted as times are assumed to be encoded as the number of seconds since Jan-1-1970 12:00:00 AM GMT.

Number Input

All numeric input areas in EML can accept numeric expressions as well as simple numbers.

Numeric Expression [+-]ddd[.[ddd]][e+[ddd]] [+/-] dg mm ss [+/-] dg:mm:ss dg mm ss [N/S] dg:mm:ss [N/S] dg mm ss [E/W] dg:mm:ss [E/W] pi <exp> + <exp> <exp> - <exp>

Description
A simple number composed of digits, a sign, a decimal point and an exponent. Converts the given degrees (dg), minutes (mm) and seconds (ss) to decimal degrees. Either a sign may be given before dg mm ss or a N/S or E/W may be given after the dg mm ss.

Returns the value of pi (3.141592.....). Returns the sum of two expressions. Returns the difference of two expressions.

208

EML Appendixes

Numeric Expression <exp> * <exp> <exp> / <exp> <exp> ^ <exp> <exp> ** <exp> abs(<exp>) int(<exp>) mod(<exp>,<exp>) min(<exp>,<exp>) max(<exp>,<exp>) sin(<exp>) cos(<exp>) tan(<exp>) asin(<exp>) acos(<exp>) atan(<exp>) ln(<exp>) log(<exp>) sqrt(<exp>) dd(<exp>,<exp>,<exp>)

Description
Returns the product of two expressions. Returns the quotient of two expressions. Returns the first expression raised to the second expression. Returns the absolute value of the argument. Returns the integer portion of the argument. Returns the remainder of the first argument divided by the second. Returns the minimum of the two arguments. Return the maximum of the two arguments. Returns the sine of the single argument. The argument is assumed to be in radians. Returns the cosine of the single argument. The argument is assumed to be in radians. Return the tangent of the single argument. The argument is assumed to be in radians. Returns the arcsine of the argument. The result is in radians. Returns the arccosine of the argument. The result is in radians. Returns the arctangent of the argument. The result is in radians. Returns the natural logarithm of the argument. Returns the common logarithm of the argument. Returns the square root of the argument. Treats the three expressions as degrees minutes and seconds, respectively and converts them to decimal degrees. Multiplies the expression by the conversion factor for the given unitname. For example 3 feet will multiply 3 by the number of feet per meter.

<exp> unitname

EML Appendixes

209

Numeric Expression <exp> unitname unitname <exp> unitname TO unitname CONVERT(<exp>,unitna me, unitname)

Description
Multiplies the expression by the conversion factor needed to convert from the first unitname to the second unit name. For example 3 feet inches will multiply 3 by 12.

In all of the forms above that deal with units, the unit names come from the file <IMAGINE_HOME>/etc/units.dat. This file defines a series of categories (distance, area, weight) and within each category a variety of units are defined. For each category a default unit is defined which has a conversion factor of 1.0. For example the default unit in distance is the meter, all of the other distance units are given in terms of meters. Units and categories may be added to this file. If the environment variable ERDAS_ETC_PATH is defined then the file units.dat will be found using that path. This means that you can put a modified units.dat in the current directory (or your personal directory) instead of modifying the one in <IMAGINE_HOME>/etc.

210

EML Appendixes

Device Configuration Properties

This topic is applicable to UNIX systems only. Under NT, devices are configured using system provided tools with the exception of tape drives. The tables below identify the properties associated with each device within a device class. The combination of deviceclass, devicename, and property forms the key to extract data from the Configuration Database using the getcfg function. The Property Title is the string displayed in the Configuration Editor dialogs.

deviceclass - cdroms

devicename - cdrom
property
model host directory device

Property Title
Model Host Mount point Device file

Default Value
CDROM drive $HOSTNAME /cdrom /dev/sr0

deviceclass - hosts

devicename - host
property
cpucount cdromctl security security_path tapeserver_path

Property Title
Number of Processors CDROMCTL License broker Broker location Tapeserver location 1

Default Value

$IMAGINE_HOME/bin/$A RCH/cdromctl $HOSTNAME $IMAGINE_HOME/bin $IMAGINE_HOME/bin

deviceclass - tapes

devicename - tape
property
model host device

Property Title
Tape Model Tape drive host Tape drive device file

Default Value
1/2 inch mag tape $HOSTNAME /dev/rst0

deviceclass - printers

devicename - calcomp
property
model

Property Title
Printer Model

Default Value
Calcomp 68000

EML Appendixes

211

queuename queuehost device color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel model queuename queuehost device color mediawidth mediaheight unittype densitywidth densityheight dotsunittype

Print Queue Name Print Queue Host Device Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level Printer Model Print Queue Name Model 981 Hostname Dir of 981 Software Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units

cc68000 $HOSTNAME /dev/ihcp0 CMYK 36 0 inch 400 400 inch 13696 0 60 45 15 75 0 false 1 1 Calcomp with Model 981 cc981 $HOSTNAME /usr/local/calcomp CMYK 36 0 inch 400 400 inch

212

EML Appendixes

totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel

Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level

13696 0 60 45 15 75 0 false 1 1

EML Appendixes

213

devicename - canon
property
model queuename queuehost device color postscriptlevel postscriptversion mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight additivecolor mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options PostScript Level PostScript Version Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Use Positive Paper Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Canon CLC PS $HOSTNAME /dev/ihcp0 Black 1 52.3 8.5 11 inch 300 300 inch 2454 3153 true false 1 256

214

EML Appendixes

devicename - hpgl
property
model queuename queuehost device color postscriptlevel mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options Language Level Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Generic HPGL, HPGL/2 hpgl $HOSTNAME /dev/ihcp0 RGB 99 8.5 11 inch 300 300 inch 2424 3156 false 1 256

EML Appendixes

215

devicename - hprtl
property
model queuename queuehost device color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
HP DesignJet 650C hprtl $HOSTNAME /dev/ihcp0 CMY 36 0 inch 300 300 inch 10680 0 60 45 15 75 0 false 1 1

216

EML Appendixes

devicename - iris
property
model queuename queuehost color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight mirror numcopies intenselevel device

Property Title
Printer Model Print Queue Name IRIS Driver Host Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Use a Mirrored Image Number of Copies Color Intensity Level Device

Default Value
Iris 3000 iris $HOSTNAME RGB 24.5 24.5 inch 300 300 inch 7350 7350 false 1 256 /dev/null

EML Appendixes

217

devicename - kodak
property
model queuename queuehost device color density mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options Transparent Density Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Kodak XL7700 xl7700 $HOSTNAME /dev/sip0 RGB Normal 8.5 11 inch 203 203 inch 2048 1536 false 1 256

218

EML Appendixes

devicename - linotronic
property
model queuename queuehost device printerhost color postscriptlevel postscriptversion mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenangle_black additivecolor mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Printer Host Color Options PostScript Level PostScript Version Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Screen Angle Use Positive Paper Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Linotronic 530 lino $HOSTNAME /dev/ihcp0 $HOSTNAME Black 1 51.8 17 0 inch 2540 2540 inch 43180 0 45 true false 1 256

EML Appendixes

219

devicename - postscript
property
model queuename queuehost device color postscriptlevel mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options PostScript Level Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Generic Postscript PS $HOSTNAME /dev/ihcp0 RGB 2 8.5 11 inch 300 300 inch 2424 3156 false 1 256

220

EML Appendixes

devicename - serveware
property
model queuename queuehost plotpath color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel device

Property Title
Printer Model Print Queue Name ServeWare Host

Default Value
Versatec 8900 srvwr $HOSTNAME

ServeWare Plot Directory /usr/plots/imagine-plots Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level Device CMYK 36 0 inch 400 400 inch 13696 0 60 45 15 75 0 false 1 1 /dev/null

EML Appendixes

221

devicename - tekinkjet
property
model queuename queuehost device color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Tektronix 4697 tek $HOSTNAME /dev/ihcp0 CMYK 11 0 inch 207 207 inch 2000 0 60 45 15 75 0 false 1 1

222

EML Appendixes

devicename - versatec
property
model queuename queuehost device color mediawidth mediaheight unittype densitywidth densityheight dotsunittype totalpixelwidth totalpixelheight screenfrequency screenangle_black screenangle_cyan screenangle_magenta screenangle_yellow mirror numcopies intenselevel

Property Title
Printer Model Print Queue Name Print Queue Host Device Color Options Media Width Media Height Media Units Horizontal Dot Density Vertical Dot Density Dot Units Total Horizontal Pixels Total Vertical Pixels Halftone Screen Frequency Black Screen Angle Cyan Screen Angle Magenta Screen Angle Yellow Screen Angle Use a Mirrored Image Number of Copies Color Intensity Level

Default Value
Versatec 8900 vtec $HOSTNAME /dev/lp0 CMYK 36 0 inch 400 400 inch 13696 0 60 45 15 75 0 false 1 1

EML Appendixes

223

Preference Database

All IMAGINE and LPS preferences are stored in Preference Definition Files (PDF) in <IMAGINE_HOME>\defaults. These files are plain text files with a fairly simple structure. Following a commented section, usually containing revision history, is the Title of the preference category. For example: title "User Interface & Session" ; A semicolon seperates each preference specification. For example:
log_print_type("Session Log Printing"): "query" "Print Session Log on exit?" enums { "always" "Always print" "query" "Ask the user whether to print or not" "never" "Never print" };

The first line of the preference specification always contains the code name of the preference, the title string of the preference, and the default value of the preference. From the example above, the name of the preference used by the software (preferencename) is log_print_type, the title displayed in the Preference Editor is Session Log Printing, and the default value is query. The second line is the info string that is displayed in the status field when you hover over the preference value field. It can be combined with other info strings when they are provided as in the case above. The remaining lines mostly deal with the value of the preference. Values may be as simple as a yes/no boolean expressed with a checkbox (checked = yes) or a plain text string. Values may be limited to specifically enumerated choices (as in the example above) or they may be limited by Max and Min specifications. Finally, because many of the preferences are applicable to UNIX only or to PC only, there may be a line that prevents the preference from being displayed on the unapplicable platform (hideon pc; or hideon unix;). The combination of category and preference name forms the key to extracting data from the user preference database using the getpref function.

224

EML Appendixes

Example Slider EML File

This is an example file named SliderTest.eml used to produce the Slider Test Frame shown in Slider Framepart section.
slider gray { title "Gray"; titleoffset 50 noalign; geometry 10, 40, 300, 18; lock top, left, width, height; noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; } slider red { title "Red"; titleoffset 50 noalign; foreground "red"; geometry 10, 70, 300, 18; lock top, left, right,height; noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; } slider green { title "Green"; foreground "green"; titleoffset 50 noalign; geometry 10, 100, 300, 18; lock top, left, right,height; noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; } slider blue { title "Blue"; foreground "blue"; titleoffset 50 noalign; geometry 10, 130, 300, 18; lock top, left, right,height;

EML Appendixes

225

noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; } slider graticule { title "Graticule"; foreground "blue"; titleoffset 50 noalign; geometry 10, 160, 300, 18; lock top, left, right,height; noborder; layout horizontal; min 0; max 100; delta 1; value {10, 50, 90}; } slider graticule { title "Graticule"; foreground "brown"; titleoffset 50 noalign; geometry 10, 190, 300, 30; lock top, left, right,height; noborder; layout horizontal; showcurrentvalue; min 0; max 100; delta 1; value {10, 50, 90}; } slider vertslider1 { title ""; geometry 350, 30, 18, 200; lock top, left, width, height; noborder; layout vertical; showcurrentvalue; min 0; max 100; delta 1; value {10, 30, 90}; } slider vertslider2 {

226

EML Appendixes

title ""; geometry 390, 30, 18, 200; lock top, left, width, height; noborder; layout vertical; min 0; max 100; delta 1; value {10, 30}; } button okay { title "OK"; geometry 10, 250, 75, 25; lock bottom, left, width, height; on mousedown { undisplay SliderTestFrame; quit; } } button test1 { title "Reset"; geometry 90, 250, 75, 25; lock bottom, left, width, height; on mousedown { set gray = { 10, 50, 70}; } } button test2 { title "Copy"; geometry 170, 250, 75, 25; lock bottom, left, width, height; on mousedown { set red = $gray; set green = $gray; set blue = $gray; } } button cancel { title "Cancel"; geometry 250, 250, 75, 25; lock bottom, left, width, height; on mousedown { undisplay SliderTestFrame; quit; }

EML Appendixes

227

} } on startup { display SliderTestFrame; } }

228

EML Appendixes

Indexes
Introduction
This chapter lists all of the keywords and symbols that are recognized by the EML parser. These keywords may not be used as names for user defined elements. The first section (below) is alphabetical, the Index by Category section is divided into the following categories:
Attribute Function Other Keywords Command Modifier Statement Framepart Operator Symbol

Alphabetical Index by Keyword

In this section, all keywords are listed alphabetically. When a keyword has different meanings within different contexts, the keyword is repeated for each of its uses. Table 1: Alphabetical

Name
ABOVE ADDTYPEDEF ALIGN AT ATTACH AUTOEXTEND BACKGROUND BANDLIST BATCHJOBNAME BELOW

Description
Attribute that is used to position one part above another. OBSOLETE in 8.2. Function that adds one or more types from a FileFilter DLL to the list of supported types. Specific to the filename framepart. Attribute that controls the alignment of text within the area defined for the label. Attribute that is used to specify the position for a part. OBSOLETE in 8.2. Attribute that is used to specify the way in which each of the sides of a part attaches to either the frame or other parts. OBSOLETE in 8.2. Function that adds an extension to a filename. Specific to the filename framepart. Attribute that specifies the color to be used as the background for the part. Function that returns the list of names of the layers in the specified file. Command that is used to specify the name for the current batch job. Attribute that is used to position one part below another. OBSOLETE in 8.2.

Indexes Indexes

229 229

Table 1: Alphabetical Name


BOTTOM BOUNDARIESKNOWN BUTTON CDMOUNTUIL CANVASPART CATEGORYTEST CEIL CELLARRAYPART CENTER CENTER CHANGEABLE CHECKBOX CHOOSERBUTTON CLEARTYPEDEFS CLOSE CLOSEACTION COLORBUTTON COLUMN COLUMNALIGNMENT COLUMNDATATYPE COLUMNLINEWIDTH COLUMNSELECT COLUMNWIDTH COMLOG COMMANDWINDOW

Description
Function returns the bottom most coordinate of the named frame or framepart. Function that determines whether the named file has map boundaries. Specific to the filename framepart. Framepart whose main purpose is to initiate an action. Function displays the CDROM Mounting Utility. Framepart that supplies access to onscreen graphics. Function that checks to see under which category a given filename falls. Specific to the filename framepart. Function computes the mathematical ceiling of a floating-point number. Framepart that allows viewing and editing of large (virtual) arrays of rows and columns. Attribute that is used to position a frame. Modifier for positional attributes like LEFT or RIGHT. Attribute that controls whether the user can change the width of a column in a cellarray. Framepart that is used to provide user input of a boolean value. Attribute that indicates that the button will be attatched to a chooser. Function that restores the filename part to a state where it does not recognize any specific file types. Specific to the filename framepart. Command that closes one of the two output log files. Attribute that marks a button or menu as the action to be invoked when the user closes the window. Attribute that indicates that a button is a color button. Attribute that specifies the number of columns to be used when displaying the radio button. Attribute that controls the alignment of text within a column in a cellarray. Attribute that controls the appearance of columndata within a column in a cellarray. Attribute that controls the width of the line appearing to the right of a column in a cellarray. Function that changes which columns are selected in the cellarray. Specific to the cellarray framepart. Attribute that controls the width of a column in a cellarray. Command that renames the session log file. The reserved frame name for the Command History window.

230

Indexes

Table 1: Alphabetical Name


COMPONENT CONFIGURATIONEDITOR COPY COSINE CREATABLE DATATYPE DEFAULTACTION DEFAULTSOURCESET DELETE DELTA DIMENSION DISABLE DISPLAY DO ECHO ERROR EDITABLE EDITTEXT ELSE ELSIF ENABLE EXIT EXP EXPORT FILENAME

Description
The name of a group of one or more frames. Command that invokes the configuration editor. Function that duplicates currently selected rows and/or columns to the clipboard. Specific to the cellarray framepart. Function that computes the mathematical cosine of its argument. Modifier which controls whether creatable file types are included in a file chooser. Function that determines the data type of the image named in the filename part. Specific to the filename framepart. Attribute that marks a button as the default to be selected under Windows. Function that makes a specified part be the default source for all sub-dialogs. Function that removes currently selected columns from the cellarray. Specific to the cellarray framepart. Attribute that sets the value by which the number is incremented. Attribute that is used to specify the size of the part. OBSOLETE in 8.2. Command that disables a framepart so that the user may not interact with it. Command that is used to display a frame if it is not currently displayed. Argument list delimiter for the ON attribute. Command that prints its arguments to the session log. Function that displays an error message. Attribute that controls whether the value of a cell within a column can be changed. Framepart which can be used to implement a single or multi-line text input field. Statement that specifies action to take on failure of IF statement. Statement that specifies a test to make on failure of IF statement. Command that enables a framepart. Statement that is used to exit from a loop. Function that computes the exponentiation of a specified number. Function that allows contents of selected rows and columns to be exported to a file. Specific to the cellarray framepart. Framepart that provides a tool for interactively selecting a file.

Indexes

231

Table 1: Alphabetical Name


FEXIST FEXT FILETYPE FLAG

Description
Function that tests to see if the file named in its argument exists. Function that extracts the extension portion from a filename string. Function that obtains the type of image named by the filename part. Specific to the filename framepart. Function that determines whether or not the named file has map boundaries other than through calibration. Specific to the filename framepart. Function that computes the mathematical floor of a floating-point number. Function that is used to format numbers. Function that extracts the name component of a filename from a string. Modifier of ATTACH attribute that indicates part is attached to the frame. OBSOLETE in 8.2. Attribute in a cellarray column that controls how values in that column are displayed. Attribute that sets the display format to be used if the value of the label is a number. Function that allows changes to the display of the selected columns format. Specific to the cellarray framepart. Attribute that is used to specify the font which will be used for displaying text in the part. Statement that provides looping mechanism allowing the statement to be executed once for each member. Attribute that specifies the color to be used as the foreground for the part. Function that extracts the path component of a filename from a string. A rectangular region which contains one or more GUI elements called frameparts. Function that extracts the root portion from a filename string. Attribute that specifies a filename part shall display the full path of the current file. Attribute that specifies the amount of space to be left between parts when they are positioned automatically. Framepart that is a simple placeholder used by C Toolkit applications to provide a means of plugging parts into a frame. Attribute that specifies the position and size of a framepart within a frame.

FLOOR FMT FNAME FORM FORMAT FORMAT FORMAT FONT FOREACH FOREGROUND FPATH FRAME FROOT FULLPATH GAP GENERIC GEOMETRY

232

Indexes

Table 1: Alphabetical Name


GEOMETRYSET GETAOI GETCATEGORY GETDEVICELIST GETCFG GETENV GETFEATUREFIELDS GETFILELIST GETFILESINPATH GETLISTINDEX GETMAPPANELCOUNT GETPREF GETRECODETABLEFILE GETSCREENNUMBER GETSTRINGHEIGHT GETSTRINGWIDTH GETTAGGEDDATA GETTEXT GLOBAL

Description
Function that sets the position and size of a part in one statement. Function that allows the user to select an Area Of Interest. Function that determines the category of the currently named file. Specific to the filename framepart. Function that is used to get the list of devices available in the system for the named device class. Function that gets information about a configured device from the configuration data base. Function that returns the value of the environment variable specified as the argument. Function that inquires for the names of attributes in a given raster, vector, or annotation. Function that uses a wildcard to search for filenames. Function that searches directories for files that match a wildcard. Framepart function that finds the numeric index of the currently selected item in a popup list. Specific to the popup list framepart. Function that is used to determine the number of panels to produce a given map on a given device. Function that provides an interface to IMAGINE Preference Database. Function that allows the user to create a recode table. Function that returns the number of the screen in which the EML script is running. Function that computes the height of a string in screen pixels. Function that computes the width of a string in screen pixels. Function used to retrieve a tagged value from a tag file. Function used to prompt the user to enter a text string. A named container which may hold one or more values which can be either numbers, characters, or strings of characters. A global variable. Framepart that is used to group other frameparts together for emphasis. Function that supplies the height of a raster image. Specific to the filename framepart. Framepart function that returns the width of the image as the number of columns, if the filename is a raster image, or 0 otherwise. Specific to the filename framepart. Command that creates a FrameMaker MIF macro file which is an outline for the IMAGINE On-Line Help system.

GROUP HEIGHT HEIGHT

HELPOUTLINE

Indexes

233

Table 1: Alphabetical Name


HIDE HORIZONTAL HORIZONTALSCROLLBAR HSCROLL ICON ICONLIST ICONS IF IMPORT INFO INSERTTEXT ISBATCHON ISEMPTY ISLICENSED ISNUMBER ISSTRING JOB LABEL LAYERCOUNT LAYOUT LINE LEFT LEFT

Description
Command that makes a frame or a framepart invisible. Modifier to the LAYOUT attribute. Used to specify that the part is to be laid out in a horizontal direction. Attribute that specifies that the cellarray or canvas is to have a horizontal scroll bar. Attribute that specifies that the edittext is to have a horizontal scroll bar if it is multi-line. Attribute that is used to specify an icon file which may be used instead of a title. Attribute that is used to specify a list of iconfiles which may be used instead of the title. Attribute that specifies the icons to be used for both the armed and unarmed states of a checkbox. Statement that allows control to pass through one of several paths in a script based on the result of one or more logical expressions. Function that allows the contents of a file to be imported into selected rows and columns Specific to the cellarray framepart. Attribute that specifies the string which is to be displayed in the status bar when the cursor is over this part. Command that allows text to be inserted into an edittext framepart. Function that returns a value of TRUE if the system is currently in batch mode. Function that tests to see if the argument is empty. Function that checks to see if there is a license available for the named module. Function that tests to see if the argument is a number. function tests to see if the argument is a string. Command that is used to execute an application as a job. Framepart that is used to place a label in a frame. Function that supplies the number of layers in a raster image. Specific to the filename framepart. OBSOLETE IN 8.3. Attribute that is used to specify whether the part is to be laid out in a vertical or horizontal direction. Framepart that creates a line in a frame which can be used to separate items or call attention to others. Attribute that is used to position one part relative to another. Function returns the left most coordinate of the named frame or a framepart.

234

Indexes

Table 1: Alphabetical Name


LEFTOF LOAD LOCK LOCKSPLIT LOG LOG10 LOGMESSAGE LONGNAME LOOP LOWERCASE LRX LRY MAPCREATE MAPPRINT MAPPRINTDELETE

Description
Attribute that is used to position one part to the left of another part. OBSOLETE in 8.2. Command that loads an EML Macro. Attribute that is used to specify how a change in frame size will be distributed among the frameparts within the frame. Attribute used in a splitpanel to control the behavior of a split when the entire splitpanel is resized. Function that computes the natural logarithm of the specified number. Function that computes the base-10 logarithm of the specified number. Command that places a message in the status log. Function that describes the type of file named by the filename part. Specific to the filename framepart. Statement that is a type of looping control which requires that the user provide a means of exit from the loop with the exit statement. Function that returns a value by converting all of the characters in its argument to lowercase. Function that supplies the lower X coordinate of the bounding box of an image. Specific to the filename framepart. Function that supplies the lower Y coordinate of the bounding box of an image. Specific to the filename framepart. Function displays dialog that allows the description of the basic parameters of a map composition that is to be created. Function displays dialog that allows control of the various options for printing a map composition. Function displays dialog that allows control of various options for printing a map composition, then deleting the composition after printing. Attribute that sets the maximum value which a meter number may assume. Function that returns the number of members in the given set. A collection of buttons, icons, radio buttons, checkboxes, and/or other menus that invoke procedures. Function used to display an informal message. Framepart that provides a means of entering or displaying a numeric value. Attribute that sets the minimum value which a meter number may assume.

MAX MEMBERCOUNT MENU MESSAGE METERNUMBER MIN

Indexes

235

Table 1: Alphabetical Name


MINIMUMSIZE MOD MODAL MODULE MOVE NAMES NBANDS NEWFILE NOBORDER NOCHECK NOGAP NOMAP NORAISEDGRAB

Description
Attribute that indicates the minimum size to which a frame may be resized. Modulus operator. A frame that receives input to the exclusion of all other activity. Obsolete. Replace with COMPONENT. Command that repositions a frame on the screen. Attribute that specifies the list of values which the popup list may assume. Function that supplies the number of layers in a raster image. Specific to the filename framepart. Attribute that indicates that the selected filename must represent a new file. Attribute indicating that the part is to be drawn without a border. Attribute that indicates that no checking on the validity of the filename is to be done. Attribute to all EML parts positional definition. Attribute that makes a frame invisible at display time. Attribute that causes the grab handle in a splitpanel framepart to appear as a three-pixels wide narrow gray band between the two child parts. Attribute that causes a canvaspart to be an offscreen memory canvas. Attribute that is used to define a message handler. Modifier which specifies the options tab for a file chooser. Attribute that specifies the list of values which a radio button may assume. Boolean-or operator. Modifier of ATTACH attribute that indicates part is attached to another part. OBSOLETE in 8.2. Function that allows the contents of a clipboard be inserted into selected rows and columns Specific to the cellarray framepart. Attribute that indicates that the scrolling list will contain pixmaps instead of text strings. Framepart function that returns the height, in map units, of pixels in a raster image. Specific to the filename framepart. Framepart function that returns the width, in map units, of pixels in a raster image. Specific to the filename framepart. Command to send a Sun Audio file to the audio device.

OFFSCREEN ON OPTIONFRAME OPTIONS OR PART PASTE PICTURELIST PIXELHEIGHT PIXELWIDTH PLAY

236

Indexes

Table 1: Alphabetical Name


POPUPLIST POSITION POWER PREFERENCEEDITOR PSEUDOTEMPLATES QUERYFORFILENAME QUIT QUOTE RADIOBUTTON RADIOGROUP RAISEDGRAB RASTERLAYERLIST READONLY RECEIVE REFLOW REFRESHLIST REMOVECHARS REPORT RETURN RESIZE RESIZABLE RIGHT RIGHT

Description
Framepart that provides a means of selecting one value from a list of several fixed choices. Attribute that specifies the location of a part. OBSOLETE in 8.2. Exponentiation operator returns the result of raising the left-hand expression to the value of the right-hand expression. Command that displays the Preference Editor. Modifier which controls whether pseudo-template types are included in a file chooser. Function that allows selection of a file that matches any of the types allowed by the given filename. Specific to the filename framepart. Command that causes the termination of the EML interpreter. Function that adds double quotes () around its argument. Framepart that provides a means of selecting one value from a set of several fixed choices. A menu type which consists of one or more entries each with a radio button displayed to the left of it. Attribute that causes the grab handle between the two child parts in a splitpanel framepart to have a 3-dimensional raised effect. Function that supplies the names of layers in a raster image. Specific to the filename framepart. Attribute that indicates that the framepart is for display purposes only. Attribute that places a part on the receiver list for a particular message. Command that causes the parts in a frame to be repositioned to fit within the boundaries of the frame. OBSOLETE in 8.2. Command that updates the list of files displayed in a filename framepart. Function removes the indicated characters from each of the items in the given list. Function that allows a report file to be formatted based upon the cellarray. Specific to the cellarray framepart. Statement that allows a procedure to return a value. Command that changes the size of a frame. Attribute that makes a frame resizeable. Attribute used to position one part to the right of another. Function that returns the right most coordinate of the named frame or a framepart.

Indexes

237

Table 1: Alphabetical Name


RIGHTOF ROW ROWCOUNT ROWINSERT ROWSELECT ROWSELECTADD ROWSELECTREMOVE ROWSELECTRESELECT ROWTITLE RPCSEND SAVEGLOBALPREF SAVEUSERPREF SCREEN SCREENNUMBER SCROLLLIST SELECT SEND SET SETPREF SELF SEPARATOR

Description
Attribute used to position one part to the right of another. OBSOLETE in 8.2. Attribute that specifies the number of rows to be used when displaying the radio button. Attribute that specifies the number of rows in a cellarray. Function that allows an empty row to be inserted before or after the first selected row in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Attribute that specifies the title of the column in a cellarray to number the rows. Function that uses the RPC mechanism to send a single text message to an rpc application. Function that saves the change made by setpref() to the global preference database file. Function that saves the change made by setpref() to the user preference database file. Modifier that controls the CENTER attribute to place a frame at the center of the screen. Function that returns the number of the screen from which the script was executed. Framepart that provides a means of selecting a single value from a long list of choices. Attribute that is used to specify the initial file filter for the filename list. Command that delivers a message to a destination. Command that is used to assign a value to a variable or to a framepart. Function that provides an interface to the IMAGINE Preference Database. Modifier of ATTACH attribute that indicates part is not attached to anything. OBSOLETE in 8.2. A menu entry which is displayed as a horizontal line.

238

Indexes

Table 1: Alphabetical Name


SETNAMEANDTITLELIST SETNAMELIST SETTITLELIST SHOW SHOWCURRENTVALUE SHOWHELP SHOWROWCOLUMN SHOWVERSION SIN SIZE SLIDER SORT SORTBYFILENAME SOURCE SPAWN SPLITPANEL SPLITSTRING STARTBATCH STARTBATCHSINGLE STATS STATICLIST STATUSBAR STATUSLOG STATUSWINDOW STOPBATCH

Description
Function that changes both the internally and externally used names for the items in a popup list. Specific to the popuplist framepart. Function changes the internally used names for an item in a popuplist. Specific to the popuplist framepart. Function changes the externally used names for an item in a popuplist. Specific to the popuplist framepart. Command that makes a frame or a framepart visible. Attribute that specifies the current value area should be displayed in a slider framepart. Command that displays help from the On-Line Help data base. Attribute that specifies the left-most column of a cellarray should be displayed. Command that displays a frame which gives the current version of IMAGINE. Function that computes the mathematical sine of its argument. Attribute that specifies the size of a part. OBSOLETE in 8.2. Framepart that allows one or more values to be set interactively in a range defined by a minimum and a maximum. Function that returns a sorted version of the list which is given to it. Function that returns a sorted version of the list based upon the file name part of each item. Modifier that controls the CENTER attribute to place a frame at the center of the parent dialog. Command that starts a separate copy of an interactive application. Framepart that manages a set of children as vertical or horizontal tiling. Function that splits the input string into a list. Command that begins multiple job batch mode. Command that begins single job batch mode. Function that causes column statistics to be computed and displayed as another cellarray. Specific to the cellarray framepart. Attribute that specifies the list of choices for a popuplist framepart will always be displayed. Attribute that is used to indicate that the frame should have a status bar. Command that renames the command history file. Keyword that refers to the Session Log frame. Command that terminates the batch job mode.

Indexes

239

Table 1: Alphabetical Name


STRICT SWITCH SYNCJOB SYSTEM SYSTEM TABSHEET TABPOSITION TANGENT TEMPLATEGET TEMPLATESET TEXTNUMBER TEXTSTRING THUMBWHEEL TITLE TITLEFONT TITLEGAP TITLEGET TITLELIST TITLEOFFSET TITLEPLACEMENT TITLESET TO TOOLBAR TOP

Description
Modifier which enforces the value specified by the DELTA attribute. Statement that allows selection of one set of operations from many based on a single expression. Command that executes an application synchronously as a job. Command that indicates that the arguments following it are system commands. Function that invokes a system command and returns the completion status of the command. Framepart that manages a set of children as a stack of cards with index tabs. Statement that specifies where a tab is positioned on a tabsheet. Function that computes the mathematical tangent of its argument. Function that returns the currently used wildcard. Specific to the filename framepart. Function that changes the current template of the filename part. Specific to the filename framepart. Framepart that provides a means of entering or displaying a numeric value. Keyword that allows a name to be associated with a textstring. Framepart that provides a means of interactively changing a value. Attribute that displays a title near the part to identify the purpose of the part. Attribute that specifies the font to be used for the title string. Attribute that specifies the spacing between the part and the title. Framepart function that returns a string which contains the title of a framepart. Attribute that specifies the list of values which are displayed in the popuplist. Attribute that specifies the list of values which are displayed in the popuplist. Attribute that is used to specify the default position for the titles of all parts contained in a frame. Framepart function that sets the title of a part. Clause that indicates a destination for the send command. Attribute that is used to specify the list of frameparts which will be present in the toolbar. Function returns the topmost coordinate of the named frame or framepart.

240

Indexes

Table 1: Alphabetical Name


ULX ULY UNDISPLAY UNITS UNLOAD UPPERCASE VALUE VARIABLE VERIFYSAVE VERTICAL VERTICALSCROLLBAR VIEWBATCHLIST VISIBLE VSCROLL WARNING WHILE WIDTH WIDTH

Description
Function that supplies the upper left X coordinate of the bounding box of an image. Specific to the filename framepart. Function that supplies the upper Y coordinate of the bounding box of an image. Specific to the filename framepart. Command that removes a frame from the display. Framepart function that returns the units of map coordinates used to register a file. Specific to the filename framepart. Command that removes an EML macro from memory. Function that returns a value by converting all of the characters in its argument to uppercase. Attribute that specifies an expression to be used to compute the value of a framepart. A named container which may hold one or more values which can be either numbers, characters, or strings of characters. Function that displays dialog asking if changes should be saved before closing an object. Modifier to the LAYOUT attribute. Used to specify that the part is to be laid out in a vertical direction. Attribute that specifies the cellarray or canvas is to have a vertical scroll bar. Command that displays the Batch Editor. Modifier which controls whether visible file types are included in a file chooser. Attribute that specifies the edittext is to have a vertical scroll bar if it is a multiline text. Function that displays a warning message. Statement that provides a simple loop until a condition is met. Function that returns the width of the named frame or a framepart. Framepart function that returns the width of the image as the number of columns, if the filename is a raster image, or 0 otherwise. Specific to the filename framepart. A modifier to the ON attribute. Function that returns the width of the borders which the window manager places around frames. Function that displays dialog asking a yes or no question. Function that displays dialog asking a yes or no question and the option to cancel the operation to which the question pertains. Function that returns the height of the title areas which the window manager places at the top of frames.

WITH WMBORDERWIDTH YESNO YESNOCANCEL WMTITLEHEIGHT

Indexes

241

Index by Category

In this section, keywords are grouped by category and then presented aphapbetically within each class. Use the table below to jump to a particular category:
Command Modifier Statement Framepart Operator Symbol

Attribute Function Other Keywords

Table 2: Attributes Attribute


ABOVE ALIGN AT ATTACH BACKGROUND BELOW CENTER CHANGEABLE CHOOSERBUTTON CLOSEACTION COLORBUTTON COLUMN COLUMNALIGNMENT COLUMNDATATYPE COLUMNLINEWIDTH COLUMNWIDTH DEFAULTACTION DELTA DIMENSION

Description
Attribute that is used to position one part above another. Attribute that controls the alignment of text within the area defined for the label. Attribute that is used to specify the position for a part. Attribute that is used to specify the way in which each of the sides of a part attaches to either the frame or other parts. Attribute that specifies the color to be used as the background for the part. Attribute that is used to position one part below another. Attribute that is used to position a part. Attribute that controls whether the user can change the width of a column in a cellarray. Attribute that indicates that the button will be attatched to a chooser. Attribute that marks a button or menu as the action to be invoked when the user closes the window. Attribute that indicates that a button is a color button. Attribute that specifies the number of columns to be used when displaying the radio button. Attribute that controls the alignment of text within a column in a cellarray. Attribute that controls the appearance of columndata within a column in a cellarray. Attribute that controls the width of the line appearing to the right of a column in a cellarray. Attribute that controls the width of a column in a cellarray. Attribute that marks a button as the default to be selected under Windows. Attribute that sets the value by which the number is incremented. Attribute that is used to specify the size of the part.

242

Indexes

Table 2: Attributes Attribute


EDITABLE FORMAT FORMAT FONT FOREGROUND FULLPATH GAP GEOMETRY HORIZONTALSCROLLBAR HSCROLL ICON ICONLIST ICONS INFO LAYOUT LOCK LOCKSPLIT LEFT LEFTOF MAX MIN

Description
Attribute that controls whether the value of a cell within a column can be changed. Attribute in a cellarray column that controls how values in that column are displayed. Attribute that sets the display format to be used if the value of the label is a number. Attribute that is used to specify the font which will be used for displaying text in the part. Attribute that specifies the color to be used as the foreground for the part. Attribute that specifies a filename part shall display the full path of the current file. Attribute that specifies the amount of space to be left between parts when they are positioned automatically. Attribute that specifies the position and size of a framepart within a frame. Attribute that specifies that the cellarray or canvas is to have a horizontal scroll bar. Attribute that specifies that the edittext is to have a horizontal scroll bar if it is multi-line. Attribute that is used to specify an icon file which may be used instead of a title. Attribute that is used to specify a list of iconfiles which may be used instead of the title. Attribute that specifies the icons to be used for both the armed and unarmed states of a checkbox. Attribute that specifies the string which is to be displayed in the status bar when the cursor is over this part. Attribute that is used to specify whether the part is to be laid out in a vertical or horizontal direction. Attribute that is used to specify how a change in frame size will be distributed among the frameparts within the frame. Attribute used in a splitpanel to control the behavior of a split when the entire splitpanel is resized. Attribute that is used to position one part relative to another. Attribute that is used to position one part to the left of another part. Attribute that sets the maximum value which a meternumber may assume. Attribute that sets the minimum value which a meternumber may assume.

Indexes

243

Table 2: Attributes Attribute


MINIMUMSIZE NAMES NEWFILE NOBORDER NOCHECK NOGAP NOMAP NORAISEDGRAB

Description
Attribute that indicates the minimum size to which a frame may be resized. Attribute that specifies the list of values which the popuplist may assume. Attribute that indicates that the selected filename must represent a new file. Attribute indicating that the part is to be drawn without a border. Attribute that indicates that no checking on the validity of the filename is to be done. Attribute to all EML parts positional definition Attribute that makes a frame invisible at display time. Attribute that causes the grab handle in a splitpanel framepart to appear as a three-pixels wide narrow gray band between the two child parts. Attribute that causes a canvaspart to be an offscreen memory canvas. Attribute that is used to define a message handler. Attribute that specifies the list of values which a radiobutton may assume. Attribute that indicates that the scrolling list will contain pixmaps instead of text strings. Attribute that specifies the location of a part. Attribute that causes the grab handle between the two child parts in a splitpanel framepart to have a 3-dimensional raised effect. Attribute that indicates that the framepart is for display purposes only. Attribute that places a part on the receiver list for a particular message. Attribute that makes a frame resizeable. Attribute used to position one part to the right of another. Attribute used to position one part to the right of another. Attribute that specifies the number of rows to be used when displaying the radiobutton. Attribute that specifies the number of rows in a cellarray. Attribute that specifies the title of the column in a cellarray to number the rows. Attribute that is used to specify the initial file filter for the filename list.

OFFSCREEN ON OPTIONS PICTURELIST POSITION RAISEDGRAB READONLY RECEIVE RESIZABLE RIGHT RIGHTOF ROW ROWCOUNT ROWTITLE SELECT

244

Indexes

Table 2: Attributes Attribute


SHOWCURRENTVALUE SHOWROWCOLUMN SIZE STATICLIST STATUSBAR TITLE TITLEFONT TITLEGAP TITLEGET TITLELIST TITLEOFFSET TITLEPLACEMENT TOOLBAR VALUE VERTICALSCROLLBAR VSCROLL

Description
Attribute that specifies the current value area should be displayed in a slider framepart. Attribute that specifies the left-most column of a cellarray should be displayed. Attribute that specifies the size of a part. OBSOLETE in 8.2. Attribute that specifies the list of choices for a popuplist framepart will always be displayed. Attribute that is used to indicate that the frame should have a status bar. Attribute that displays a title near the part to identify the purpose of the part. Attribute that specifies the font to be used for the title string. Attribute that specifies the spacing between the part and the title. This function returns a string which contains the title of a framepart. Attribute that specifies the list of values which are displayed in the popuplist. Attribute that specifies the list of values which are displayed in the popuplist. Attribute that is used to specify the default position for the titles of all parts contained in a frame. Attribute that is used to specify the list of frameparts which will be present in the toolbar. Attribute that specifies an expression to be used to compute the value of a framepart. Attribute that specifies the cellarray or canvas is to have a vertical scroll bar. Attribute that specifies the edittext is to have a vertical scroll bar if it is a multiline text.

Table 3: Commands Command


BATCHJOBNAME CLOSE COMLOG CONFIGURATIONEDITOR DISABLE

Description
Command that is used to specify the name for the current batch job. Command that closes one of the two output log files. Command that renames the session log file. Command that invokes the configuration editor. Command that disables a framepart so that the user may not interact with it.

Indexes

245

Table 3: Commands Command


DISPLAY ECHO ENABLE HELPOUTLINE HIDE INSERTTEXT JOB LOAD LOGMESSAGE MOVE PLAY PREFERENCEEDITOR QUIT REFLOW REFRESHLIST RESIZE SEND SET SHOW SHOWHELP SHOWVERSION SPAWN STARTBATCH STARTBATCHSINGLE STATUSLOG STOPBATCH SYNCJOB SYSTEM

Description
Command that is used to display a frame if it is not currently displayed. Command that prints its arguments to the session log. Command that enables a framepart. Command that creates a FrameMaker MIF macro file which is an outline for the IMAGINE On-Line Help system. Command that makes a frame or a framepart invisible. Command that allows text to be inserted into an edittext framepart. Command that is used to execute an application as a job. Command that loads an EML Macro. Command that places a message in the status log. Command that repositions a frame on the screen. Command to send a Sun Audio file to the audio device. Command that displays the Preference Editor. Command that causes the termination of the EML interpreter. Command that causes the parts in a frame to be repositioned to fit within the boundaries of the frame. Command that updates the list of files displayed in a filename framepart. Command that changes the size of a frame. Command that delivers a message to a destination. Command that is used to assign a value to a variable or to a framepart. Command that makes a frame or a framepart visible. Command that displays help from the On-Line Help data base. Command that displays a frame which gives the current version of IMAGINE. Command that starts a separate copy of an interactive application. Command that begins multiple job batch mode. Command that begins single job batch mode. Command that renames the command history file. Command that terminates the batch job mode. Command that executes an application synchronously as a job. Command that indicates that the arguments following it are system commands.

246

Indexes

Table 3: Commands Command


UNDISPLAY UNLOAD VIEWBATCHLIST

Description
Command that removes a frame from the display. Command that removes an EML macro from memory. Command that displays the Batch Editor.

Table 4: Frameparts Framepart


BUTTON CANVASPART CELLARRAYPART CHECKBOX EDITTEXT FILENAME GENERIC GROUP HEIGHT LABEL LINE METERNUMBER POPUPLIST RADIOBUTTON SCROLLLIST SLIDER SPLITPANEL

Description
Framepart whose main purpose is to initiate an action. Framepart that supplies access to onscreen graphics. Framepart that allows viewing and editing of large (virtual) arrays of rows and columns. Framepart that is used to provide user input of a boolean value. Framepart which can be used to implement a single or multi-line text input field. Framepart that provides a tool for interactively selecting a file. Framepart that is a simple placeholder used by C Toolkit applications to provide a means of plugging parts into a frame. Framepart that is used to group other frameparts together for emphasis. Function that supplies the height of a raster image. Specific to the filename framepart. Framepart that is used to place a label in a frame. Framepart that creates a line in a frame which can be used to separate items or call attention to others. Framepart that provides a means of entering or displaying a numeric value. Framepart that provides a means of selecting one value from a list of several fixed choices. Framepart that provides a means of selecting one value from a set of several fixed choices. Framepart that provides a means of selecting a single value from a long list of choices. Framepart that allows one or more values to be set interactively in a range defined by a minimum and a maximum. Framepart that manages a set of children as vertical or horizontal tiling.

Indexes

247

Table 4: Frameparts Framepart


TABSHEET TEXTNUMBER THUMBWHEEL

Description
Framepart that manages a set of children as a stack of cards with index tabs. Framepart that provides a means of entering or displaying a numeric value. Framepart that provides a means of interactively changing a value.

Table 5: Functions Function


ADDTYPEDEF AUTOEXTEND BANDLIST BOTTOM BOUNDARIESKNOWN CATEGORYTEST CDMOUNTUIL CEIL CLEARTYPEDEFS COLUMNSELECT COPY COSINE DATATYPE DEFAULTSOURCESET DELETE ERROR

Description
Function that adds one or more types from a FileFilter DLL to the list of supported types. Specific to the filename framepart. Function that adds an extension to a filename. Specific to the filename framepart. Function that returns the list of names of the layers in the specified file. Function returns the bottom most coordinate of the named frame or framepart. Function that determines whether the named file has map boundaries. Specific to the filename framepart. Function that checks to see under which category a given filename falls. Specific to the filename framepart. Function displays the CDROM Mounting Utility. Function computes the mathematical ceiling of a floating-point number. Function that restores the filename part to a state where it does not recognize any specific file types. Specific to the filename framepart. Function that changes which columns are selected in the cellarray. Specific to the cellarray framepart. Function that duplicates currently selected rows and/or columns to the clipboard. Specific to the cellarray framepart. Function that computes the mathematical cosine of its argument. Function that determines the data type of the image named in the filename part. Specific to the filename framepart. Function that makes a specified part be the default source for all sub-dialogs. Function that removes currently selected columns from the cellarray. Specific to the cellarray framepart. Function that displays an error message.

248

Indexes

Table 5: Functions Function


EXP EXPORT FEXIST FEXT FILETYPE FLAG

Description
Function that computes the exponentiation of a specified number. Function that allows contents of selected rows and columns to be exported to a file. Specific to the cellarray framepart. Function that tests to see if the file named in its argument exists. Function that extracts the extension portion from a filename string. Function that obtains the type of image named by the filename part. Specific to the filename framepart. Function that determines whether or not the named file has map boundaries other than through calibration. Specific to the filename framepart. Function that computes the mathematical floor of a floating-point number. Function that is used to format numbers. Function that extracts the name component of a filename from a string. Function that allows changes to the display of the selected columns format. Specific to the cellarray framepart. Function that extracts the path component of a filename from a string. Function that extracts the root portion from a filename string. Function that sets the position and size of a part in one statement. Function that allows the user to select an Area Of Interest. Function that determines the category of the currently named file. Specific to the filename framepart. Function that gets information about a configured device from the configuration data base. Function that is used to get the list of devices available in the system for the named device class. Function that returns the value of the environment variable specified as the argument. Function that inquires for the names of attributes in a given raster, vector, or annotation. Function that uses a wildcard to search for filenames. Function that searches directories for files that match a wildcard. Framepart function that finds the numeric index of the currently selected item in a popuplist. Specific to the popuplist framepart. Function that is used to determine the number of panels to produce a given map on a given device.

FLOOR FMT FNAME FORMAT FPATH FROOT GEOMETRYSET GETAOI GETCATEGORY GETCFG GETDEVICELIST GETENV GETFEATUREFIELDS GETFILELIST GETFILESINPATH GETLISTINDEX GETMAPPANELCOUNT

Indexes

249

Table 5: Functions Function


GETPREF GETRECODETABLEFILE GETSCREENNUMBER GETSTRINGHEIGHT GETSTRINGWIDTH GETTAGGEDDATA GETTEXT HEIGHT

Description
Function that provides an interface to IMAGINE Preference Database. Function that allows the user to create a recode table. Function that returns the number of the screen in which the EML script is running. Function that computes the height of a string. Function that computes the width of a string in screen pixels. Function used to retrieve a tagged value from a tag file. Function used to prompt the user to enter a text string. Function that returns the height of the named frame or framepart. The result is in pixel units, the same system used by the geometry attribute. Framepart function that returns the height of a raster image as the number of rows, or 0 if the filename does not specify a raster image. Specific to the filename framepart. Function that allows the contents of a file to be imported into selected rows and columns Specific to the cellarray framepart. Function that returns a value of TRUE if the system is currently in batch mode. Function that tests to see if the argument is empty. Function that checks to see if there is a license available for the named module. Function that tests to see if the argument is a number. Function tests to see if the argument is a string. Function that supplies the number of layers in a raster image. Specific to the filename framepart. OBSOLETE IN 8.3. Function returns the left most coordinate of the named frame or a framepart. Function that computes the natural logarithm of the specified number. Function that computes the base-10 logarithm of the specified number. Function that describes the type of file named by the filename part. Specific to the filename framepart. Function that returns a value by converting all of the characters in its argument to lowercase. Function that supplies the lower right X coordinate of the bounding box of an image. Specific to the filename framepart.

HEIGHT

IMPORT ISBATCHON ISEMPTY ISLICENSED ISNUMBER ISSTRING LAYERCOUNT LEFT LOG LOG10 LONGNAME LOWERCASE LRX

250

Indexes

Table 5: Functions Function


LRY MAPCREATE MAPPRINT MAPPRINTDELETE

Description
Function that supplies the lower right Y coordinate of the bounding box of an image. Specific to the filename framepart. Function displays dialog that allows the description of the basic parameters of a map composition that is to be created. Function displays dialog that allows control of the various options for printing a map composition. Function displays dialog that allows control of various options for printing a map composition, then deleting the composition after printing. Function that returns the number of members in the given set. Function used to display an informal message. Function that supplies the number of layers in a raster image. Specific to the filename framepart. Function that allows the contents of a clipboard be inserted into selected rows and columns Specific to the cellarray framepart. Framepart function that returns the height, in map units, of pixels in a raster image. Specific to the filename framepart. Framepart function that returns the width, in map units, of pixels in a raster image. Specific to the filename framepart. Function that allows selection of a file that matches any of the types allowed by the given filename. Specific to the filename framepart. Function that adds double quotes () around its argument. Function that supplies the names of layers in a raster image. Specific to the filename framepart. Function removes the indicated characters from each of the items in the given list. Function that allows a report file to be formatted based upon the cellarray. Specific to the cellarray framepart. Function that returns the right most coordinate of the named frame or a framepart. Function that allows an empty row to be inserted before or after the first selected row in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart. Function that changes which rows are currently selected in the cellarray. Specific to the cellarray framepart.

MEMBERCOUNT MESSAGE NBANDS PASTE PIXELHEIGHT PIXELWIDTH QUERYFORFILENAME QUOTE RASTERLAYERLIST REMOVECHARS REPORT RIGHT ROWINSERT ROWSELECT ROWSELECTADD ROWSELECTREMOVE ROWSELECTRESELECT

Indexes

251

Table 5: Functions Function


RPCSEND SAVEGLOBALPREF SAVEUSERPREF SCREENNUMBER SETNAMEANDTITLELIST SETNAMELIST SETPREF SETTITLELIST SIN SORT SORTBYFILENAME SPLITSTRING STATS SYSTEM TANGENT TEMPLATEGET TEMPLATESET TITLEGET TITLESET TOP ULX ULY

Description
Function that uses the RPC mechanism to send a single text message to an rpc application. Function that saves the change made by setpref() to the global preference database file. Function that saves the change made by setpref() to the user preference database file. Function that returns the number of the screen from which the script was executed. Function that changes both the internally and externally used names for the items in a popuplist. Specific to the popuplist framepart. Function changes the internally used names for an item in a popuplist. Specific to the popuplist framepart. Function that provides an interface to the IMAGINE Preference Database. Function changes the externally used names for an item in a popuplist. Specific to the popuplist framepart. Function that computes the mathematical sine of its argument. Function that returns a sorted version of the list which is given to it. Function that returns a sorted version of the list based upon the file name part of each item. Function that splits the input string into a list. Function that causes column statistics to be computed and displayed as another cellarray. Specific to the cellarray framepart. Function that invokes a system command and returns the completion status of the command. Function that computes the mathematical tangent of its argument. Function that returns the currently used wildcard. Specific to the filename framepart. Function that changes the current template of the filename part. Specific to the filename framepart. Framepart function that returns a string which contains the title of a framepart. Framepart function that sets the title of a part. Function returns the topmost coordinate of the named frame or framepart. Function that supplies the upper left X coordinate of the bounding box of an image. Specific to the filename framepart. Function that supplies the upper Y coordinate of the bounding box of an image. Specific to the filename framepart.

252

Indexes

Table 5: Functions Function


UNITS UPPERCASE VERIFYSAVE WARNING WIDTH

Description
Framepart function that returns the units of map coordinates used to register a file. Specific to the filename framepart. Function that returns a value by converting all of the characters in its argument to uppercase. Function that displays dialog asking if changes should be saved before closing an object. Function that displays a warning message. Function that returns the width of the named frame or framepart. The result is in pixel units, the same system used by the geometry attribute. Framepart function that returns the width of a raster image as the number of columns, or 0 if the filename does not specify a raster image. Specific to the filename framepart. Function that returns the width of the borders which the window manager places around frames. Function that returns the height of the title areas which the window manager places at the top of frames. Function that displays dialog asking a yes or no question. Function that displays dialog asking a yes or no question and the option to cancel the operation to which the question pertains.

WIDTH

WMBORDERWIDTH WMTITLEHEIGHT YESNO YESNOCANCEL

Table 6: Modifiers Modifier


CENTER CREATABLE FORM HORIZONTAL OPTIONFRAME PART PSEUDOTEMPLATES SCREEN

Description
Modifier for positional attributes like ABOVE. Modifier which controls whether creatable file types are included in a file chooser. Modifier of ATTACH attribute that indicates part is attached to the frame. OBSOLETE in 8.2. Modifier to the LAYOUT attribute. Used to specify that the part is to be laid out in a horizontal direction. Modifier which specifies the options tab for a file chooser. Modifier of ATTACH attribute that indicates part is attached to another part. OBSOLETE in 8.2. Modifier which controls whether pseudo-template types are included in a file chooser. Modifier that controls the CENTER attribute to place a frame at the center of the screen.

Indexes

253

Table 6: Modifiers Modifier


SELF SOURCE STRICT VERTICAL VISIBLE WITH

Description
Modifier of ATTACH attribute that indicates part is not attached to anything. OBSOLETE in 8.2. Modifier that controls the CENTER attribute to place a frame at the center of the parent dialog. Modifier which enforces the value specified by the DELTA attribute. Modifier to the LAYOUT attribute. Used to specify that the part is to be laid out in a vertical direction. Modifier which controls whether visible file types are included in a file chooser. A modifier to the ON attribute.

Table 7: Miscellaneous Other Keywords


COMMANDWINDOW COMPONENT DO FRAME GLOBAL

Description
The reserved frame name for the Command History window. The name of a group of one or more frames. Argument list delimiter for the ON attribute. A rectangular region which contains one or more GUI elements called frameparts. The dialog box. A named container which may hold one or more values which can be either numbers, characters, or strings of characters. A global variable. A collection of buttons, icons, radio button, checkboxes, and/or other menus that invoke procedures. A frame that receives input to the exclusion of all other activity. A menu type which consists of one or more entries each with a radiobutton displayed to the left of it. A menu entry which is displayed as a horizontal line. Keyword that refers to the Session Log frame. Keyword that allows a name to be associated with a textstring. Clause that indicates a destination for the send command. A named container which may hold one or more values which can be either numbers, characters, or strings of characters.

MENU MODAL RADIOGROUP SEPARATOR STATUSWINDOW TEXTSTRING TO VARIABLE

254

Indexes

Table 8: Operators Operator


See Also Symbol operators MOD OR POWER Modulus operator. Boolean-or operator. Exponentiation operator returns the result of raising the left-hand expression to the value of the right-hand expression.

Description

Table 9: Statements Statement


ELSE ELSIF EXIT FOREACH IF LOOP RETURN SWITCH TABPOSITION WHILE

Description
Statement that specifies action to take on failure of IF statement. Statement that specifies a test to make on failure of IF statement. Statement that is used to exit from a loop. Statement that provides looping mechanism allowing the statement to be executed once for each member. Statement that allows control to pass through one of several paths in a script based on the result of one or more logical expressions. Statement that is a type of looping control which requires that the user provide a means of exit from the loop with the exit statement. Statement that allows a procedure to return a value. Statement that allows selection of one set of operations from many based on a single expression. Statement that specifies where a tab is positioned on a tabsheet. Statement that provides a simple loop until a condition is met.

Table 10: Symbols Symbol


+ [ ... ] && // / == ^ Addition operator. Array operator. Boolean and operator. Concatenation operator. Division operator. Equals operator. Exponentiation operator.

Description

Indexes

255

Table 10: Symbols Symbol


> >= . != < <= { ... } & | * $ Greater-than operator. Greater-than-or-equal operator. Part Message operator. Inequality operator. Less-than operator. Less-than-or-equal operator. List Construction operator. Logical-and operator. Logical-or operator. Multiplication operator. Negation operator. Subtraction operator. Value-of operator.

Description

256

Indexes

You might also like