SL-GMS Draw User’s Guidesldownloads.sl.com/docs/c++dev/6.2x/pdffiles/draw/draw.pdf · 2006. 5....
Transcript of SL-GMS Draw User’s Guidesldownloads.sl.com/docs/c++dev/6.2x/pdffiles/draw/draw.pdf · 2006. 5....
SL-GMS®DrawUser’s Guide
SL Corporation®
OBJECT-ORIENTED
GRAPHICAL MODELING SYSTEM
Version 6.2a- 26 May 2006
Part Number DRAW-360526
The information in this document is subject to change without notice and shouldnot be construed as a commitment by the Sherrill-Lubinski Corporation. TheSherrill-Lubinski Corporation assumes no responsibility for any errors that mayappear in this document.
The software described in this document is furnished under a license and may beused or copied only in accordance with the terms of such license.
This software is based in part on the work of the Independent JPEG Group.
SL-GMS Draw User’s GuideCopyright © 1987-2006 by Sherrill-Lubinski CorporationAll rights reserved.This manual is for use only in connection with the described software and may notbe used for any commercial purpose or copied, distributed, sold, displayed,modified, published, or posted in whole or in part without the prior writtenpermission of Sherrill-Lubinski Corporation.
SL-GMS, SL Corporation, the SL Logo, and all Sherrill-Lubinski product namesreferenced in this manual are trademarks or registered trademarks of theSherrill-Lubinski Corporation; any unauthorized use of these marks is strictlyprohibited. All trademarks and registered trademarks referenced in this documentare property of their respective companies.
SL-GMS (6.2x) 26 May 2006Configuration: C62a1_360526
Copyright (c) 1987-2006 Sherrill-Lubinski Corporation. All Rights Reserved.
LIMITATIONS ON USE
Use, duplication, or disclosure by the U.S. Government is subject to restrictions asset forth in the Technical Data - Commercial Items clause at DFARS252.227-7015, the Rights in Data - General clause at FAR 52.227-14, and anyother applicable provisions of the DFARS, FAR, or the NASA FAR supplement.
Sherrill-Lubinski Corporation240 Tamal Vista Blvd.
Corte Madera, CA 94925
TECHNICAL SUPPORTPhone 800.548.6881 (inside U.S.)
415.927.8400Fax 415.927.8401E-mail [email protected]
5/26/06 v6.2x
Table of Contents
1. OverviewDynamics .................................................................................... 1-2Editing Functions ........................................................................ 1-3Editor Layout .............................................................................. 1-4Dialog Windows .......................................................................... 1-17Palettes ........................................................................................ 1-18Localization of output .................................................................. 1-19Organization of the Manual ......................................................... 1-19
2. ToolsCreate Tools ................................................................................ 2-1Select Mode Tool ......................................................................... 2-9Select Point Tool ......................................................................... 2-11Change Tools ............................................................................... 2-12View Tools .................................................................................. 2-13View Preset Tool.......................................................................... 2-16Keyboard Equivalents .................................................................. 2-17
3. Setting Object PropertiesGraphic Properties ....................................................................... 3-2Attaching a Name to Objects ....................................................... 3-23Attaching a String to Pass to an Application (UserData) .............. 3-24Attaching an Integer to Pass to an Application (UserWord) .......... 3-25Setting Model Properties ............................................................. 3-26
4. DynamicsDynamic Descriptions.................................................................. 4-2Attaching Dynamic Descriptions to Objects ................................. 4-5Renaming Variables ..................................................................... 4-9Previewing the Dynamic Behavior of Objects .............................. 4-12
5. MenusFile Menu .................................................................................... 5-3Edit Pull-Down Menu .................................................................. 5-13View Menu .................................................................................. 5-21Model Pull-Down Menu............................................................... 5-23Object Pull-Down Menu .............................................................. 5-24Dynamics Pull-Down Menu ......................................................... 5-35Options Pull-Down Menu ............................................................ 5-36
SL-GMS Draw User’s Guide iVersion 6.2a- 26 May 2006
Palettes Pull-Down Menu............................................................. 5-44Point Pull-Down Menu ................................................................ 5-49Help Pull-Down Menu ................................................................. 5-52
6. Building ModelsInvoking the SL-GMSDraw Editor ............................................... 6-1Command-line options ................................................................. 6-1Setting up the SL-GMSDraw Editor ............................................. 6-2Laying Out a Model ..................................................................... 6-9Building the Model ...................................................................... 6-10Optimizing Loading and Displaying a Model ............................... 6-49Testing a Model ........................................................................... 6-52
Appendix A — Using Active X Controls
Index
SL-GMS Draw User’s Guide iiVersion 6.2a- 26 May 2006
List of Figures
Number Title Page
Figure 1-1: Dynamic Model example ............................................................. 1-2
Figure 1-2: Editor Layout (Motif) ................................................................... 1-4
Figure 1-3: Editor Layout (Windows) ............................................................. 1-5
Figure 1-4: Examples of pull-down and hierarchical menus ........................... 1-7
Figure 1-5: Point Selection Control and Loop Control icons (Motif) ................ 1-8
Figure 1-6: Point Selection Control and Loop Control icons (Windows).......... 1-8
Figure 1-7: Undo and Redo Tools ................................................................. 1-9
Figure 1-8: Object Creation Tools ................................................................. 1-10
Figure 1-9: Change Tools ............................................................................. 1-11
Figure 1-10: Selection Tools ........................................................................... 1-11
Figure 1-11: View Tools .................................................................................. 1-12
Figure 1-12: View Preset Tool ......................................................................... 1-12
Figure 1-13: "Default Graphic Properties" tabs (part 1) ................................... 1-14
Figure 1-14: "Default Graphic Properties" tabs (part 2) ................................... 1-15
Figure 1-15: "Status" window (Motif) ............................................................... 1-16
Figure 1-16: Text entry dialog window............................................................. 1-17
Figure 1-17: A standard Palette (Motif) ........................................................... 1-18
Figure 1-18: A standard Palette (Windows) ..................................................... 1-19
Figure 3-19: "Default Graphic Properties" tabs (part 1) ................................... 3-2
Figure 3-20: "Default Graphic Properties" tabs (part 2) ................................... 3-3
Figure 3-21: "Fill" graphic properties .............................................................. 3-5
Figure 3-22: Fill directions .............................................................................. 3-6
Figure 3-23: Gradient Fill Properties ............................................................... 3-8
Figure 3-24: "Edge" graphic properties ........................................................... 3-9
Figure 3-25: "Text" Default Graphic Properties window (Windows) .................. 3-14
Figure 3-26: "Text" Default Graphic Properties window (Motif)......................... 3-14
Figure 3-27: Fifteen different positions available for aligning text..................... 3-15
Figure 3-28: Example text alignments in a Text Rectangle .............................. 3-16
Figure 3-29: "TRect" Default Graphic Properties window (Windows) ............... 3-19
Figure 3-30: "Marker" Default Graphic Properties window (Motif) .................... 3-21
Figure 3-31: "Marker" Default Graphic Properties window (Windows) .............. 3-21
Figure 3-32: "Object Name" window ............................................................... 3-23
SL-GMS Draw User’s Guide iiiVersion 6.2a- 26 May 2006
Figure 3-33: "Object Userdata" window........................................................... 3-24
Figure 3-34: "Object Userword" window .......................................................... 3-25
Figure 3-35: "Model Properties" window ......................................................... 3-26
Figure 3-36: "Holes" in meter face .................................................................. 3-27
Figure 3-37: Background color set to the same color as meter "face" .............. 3-28
Figure 3-38: "Model Userdata" window ........................................................... 3-28
Figure 3-39: "Model Userword" window .......................................................... 3-29
Figure 3-40: "Model Dynamic Properties" window ........................................... 3-29
Figure 3-41: "Model Flags" window................................................................. 3-30
Figure 4-1: DynProp containing two dynamic descriptions............................. 4-2
Figure 4-2: Dynamic description with unconditional display dynamics ........... 4-2
Figure 4-3: Dynamic description with conditional display dynamics ............... 4-3
Figure 4-4: DynProp with input and conditional display dynamics .................. 4-4
Figure 4-5: A DynProp in the "Object Dynamic Properties" window ............... 4-6
Figure 4-6: A DynProp indented after pressing the "Apply" button ................. 4-7
Figure 4-7: A DynProp typed incorrectly with an error on line 3 ..................... 4-8
Figure 4-8: A dialog box displaying the location of an error ........................... 4-8
Figure 4-9: Renaming the "bg_color" variable in a Model Instance ................ 4-10
Figure 4-10: "Edit Data File" window............................................................... 4-12
Figure 4-11: "Preview Options" window........................................................... 4-13
Figure 5-1: SL-GMSDraw Menu Bar.............................................................. 5-1
Figure 5-2: SL-GMSDraw menu structure ..................................................... 5-2
Figure 5-3: File menu structure..................................................................... 5-3
Figure 5-4: Available Images window ............................................................ 5-6
Figure 5-5: Export Bitmap File window.......................................................... 5-7
Figure 5-6: Export JPEG File window ........................................................... 5-8
Figure 5-7: Export Java window .................................................................... 5-9
Figure 5-8: "Open .m1 File" window (Motif) ................................................... 5-10
Figure 5-9: "Print Dialog" window ................................................................. 5-11
Figure 5-10: Edit menu structure .................................................................... 5-15
Figure 5-11: "Select by Properties " window ................................................... 5-19
Figure 5-12: "View Options" window ............................................................... 5-22
Figure 5-13: Model Pull-Down Menu ............................................................... 5-23
Figure 5-14: Object menu structure ................................................................ 5-24
Figure 5-15: "Object Information" window ....................................................... 5-29
SL-GMS Draw User’s Guide ivVersion 6.2a- 26 May 2006
Figure 5-16: "Object Name" window ............................................................... 5-29
Figure 5-17: "Object Userdata" window........................................................... 5-30
Figure 5-18: "Object Userword" window .......................................................... 5-30
Figure 5-19: "Object Flags" window ................................................................ 5-31
Figure 5-20: "Move" window ........................................................................... 5-33
Figure 5-21: "Scale" window ........................................................................... 5-33
Figure 5-22: "Rotate" window ......................................................................... 5-34
Figure 5-23: Options menu structure .............................................................. 5-36
Figure 5-24: "Grid Options" window ................................................................ 5-38
Figure 5-25: "Snap and Point Modes" window ................................................. 5-40
Figure 5-26: "User Preferences" window......................................................... 5-41
Figure 5-27: "Available Palettes" window ........................................................ 5-45
Figure 5-28: Six Palettes available in SL-GMS ................................................ 5-46
Figure 5-29: "Enter Point" window .................................................................. 5-51
Figure 5-30: The "About SL-GMSDRAW" window ........................................... 5-52
Figure 6-1: "User Preferences" window......................................................... 6-2
Figure 6-2: Setting grid parameters with the "Grid Options" window .............. 6-3
Figure 6-3: "View Options" window ............................................................... 6-3
Figure 6-4: "Text" view on Windows (top) and Motif (bottom) ......................... 6-5
Figure 6-5: Color indexes in the "Default Graphic Properties" window ........... 6-8
Figure 6-6: "Print Dialog" window ................................................................. 6-9
Figure 6-7: Setting background object properties .......................................... 6-11
Figure 6-8: A sample DynProp ...................................................................... 6-12
Figure 6-9: A DynProp in the "Object Dynamic Properties" window ............... 6-13
Figure 6-10: "Available Submodels" window.................................................... 6-15
Figure 6-11: "c1_txtflds" Palette ..................................................................... 6-17
Figure 6-12: Instancing the Text Display Box Control Object ........................... 6-18
Figure 6-13: "Available Submodels" window.................................................... 6-21
Figure 6-14: Selecting the Option Menu Control.............................................. 6-23
Figure 6-15: "c1_txtflds" Palette ..................................................................... 6-27
Figure 6-16: "c1_scales" Palette ..................................................................... 6-30
Figure 6-17: "c1_buttons" Palette ................................................................... 6-32
Figure 6-18: Containers Palette ...................................................................... 6-34
Figure 6-19: Buttons Palette ........................................................................... 6-35
Figure 6-20: "Object Renamed Variables" window........................................... 6-36
SL-GMS Draw User’s Guide vVersion 6.2a- 26 May 2006
Figure 6-21: A dialog box example.................................................................. 6-38
Figure 6-22: "Model Properties" window ......................................................... 6-40
Figure 6-23: The Model width and height changed to 40 and 30...................... 6-41
Figure 6-24: Model Edit Mode (New Window) selected ................................... 6-42
Figure 6-25: A dialog box example.................................................................. 6-43
Figure 6-26: Selecting a Text Display Box Control Object ................................ 6-44
Figure 6-27: Select button to send "value" as an integer ................................. 6-47
Figure 6-28: "Edit Data File " window.............................................................. 6-52
Figure 6-29: "Preview Options" window........................................................... 6-53
Figure A-1: “Insert Active X Control” option selected ..................................... A-1
Figure A-2: “Insert Active X Control” dialog ................................................... A-2
SL-GMS Draw User’s Guide viVersion 6.2a- 26 May 2006
Version 6.2a- 26 May 2006
Sherrill−Lubinski
Overview
The SL-GMSDraw graphical editor is the primary tool used to create inter-active graphical screens with colorful dynamic components. When youbegin a new Model, you can draw any screen object, attach dynamicbehavior to the object, and preview the behavior without leaving the graph-ical editor. After you have verified and tested the Model within SL-GMS-Draw, you can then save the Model to disk and easily integrate it into auser-developed application, either as the primary interface screen or as aSubModel.
There are two different environments for which SL-GMSDraw is available:
• Unix/Motif
• 32-bit Windows1
SL-GMSDraw is functionally identical in both environments. This manualillustrates primarily the Windows environment.
This chapter presents an overview of the key points of SL-GMSDraw:
• Easy dynamics specification
• User-friendly editing functionality
• Comprehensive editor layout
• Dialog windows used for user input
• Palettes of buttons, text boxes, and scales that can be selectedand placed into a Model
• Internationalization/localization of menus and output
The organization of this manual is described at the end of the chapter.
1. "32-bit Windows" refers to a platform with a 32-bit architecture running Microsoft Windows NT or Windows 95.
SL-GMS Draw User’s Guide 1-1
Dynamics
SL-GMSDraw provides a comprehensive and powerful set of tools thatallows you to control the dynamic updating of screens in response tochanging data. Dynamics specification is accomplished entirely from with-in the SL-GMSDraw editor through the SL-GMS dynamics scripting lan-guage. You may either edit the dynamics scripting language directly or usea GUI-driven interface.
As a developer, you may be required to write minimal code in order totranslate the user application variables into a form recognized by thedynamic translator engine, and thereby allow the mapping between thevariables defined in the Models and the application variables. Fundamentaldynamic behaviors, such as change of color and motion, are accessibledirectly through the editor. You will also need to write code when you devel-op Models using more sophisticated dynamic behavior.
Figure 1-1: shows a representative dynamic Model.
Figure 1-1: Dynamic Model example
SL-GMS Draw User’s Guide 1-2Version 6.2a- 26 May 2006
Editing Functions
You will find that your development time is significantly reduced over typicaldynamic graphics editors, in which constructing screens (Models) that dis-play application data is extremely time intensive. With SL-GMSDraw, yourtime is more productive. Layout, object creation, animation, and notationare all combined in a single editing session.
SL-GMSDraw provides:
• tool panels to create and change objects
• menus organized according to functionality
• easy-to-use dialog windows
• printing capabilities
• import capabilities for foreign file formats, including ".xwd"(Motif), ".bmp" (32-bit Windows), and “.jpg”.
• zoom and pan capabilities
• "drag-and-drop" drawing operations for moving, scaling, rotating,and duplicating objects, and point handling
• capability to select a list of objects and modify a graphicalproperty on the entire list with a single key-click
• capability to select a list of objects and move forward andbackward through the list during editing operations
• multiple "undo" and "redo" operations with the type of eachoperation identified
• line-by-line error checking of dynamics scripts
• 32-bit Windows- and Motif-compliant copy, cut, and pasteoperations via a clipboard
SL-GMS Draw User’s Guide 1-3Version 6.2a- 26 May 2006
Editor Layout
Figure 1-2: Editor Layout (Motif)
Menus, Control Icons, and Undo/Redo Tools
�
Graphical Properties
�
(page 3-2)
(page 7)
Status Information
(page 16)
�
ActiveWorking
View
(page 16)
(page 2-1)
�
���
(page 2-13)
���
ObjectTools
ViewTools
**+
SL-GMS Draw User’s Guide 1-4Version 6.2a- 26 May 2006
Figure 1-3: Editor Layout (Windows)
Menus, Control Icons, and Undo/Redo Tools�(page 7)
Tool Panels�(page 2-1)
Status bar
(page 16)Active Working View
(page 16)
Graphical
(page 3-2)
���Properties
��
SL-GMS Draw User’s Guide 1-5Version 6.2a- 26 May 2006
Figure 1-2: and Figure 1-3: show the layout of the SL-GMSDraw editor.There are five different parts.
• Main Menu bar — contains pull-down menus, control icons, andthe tools used to undo/redo editing functions
• Tool Panels — contain tools used to create, change, viewobjects, and to preset views
• Default Graphic Properties window — controls the propertiesof objects, such as color and edge style
• Active Working View — contains the current Model beingedited
• Status window (Motif) and Status bar (Windows) — displaysstatus of editing operations
The layout of the SL-GMSDraw user interface varies slightly between theMotif and Windows versions. However, the editor provides the same toolsand functionality in both environments.
SL-GMS Draw User’s Guide 1-6Version 6.2a- 26 May 2006
� Menus, control icons, and undo/redo toolsFigure 1-4: shows examples of the pull-down, cascading menus ofSL-GMSDraw. For example, to modify properties on an object, click themouse on Object and within the resulting pull-down menu, click on Proper-ties. Choices for Object properties pop up in the Properties submenu.
Figure 1-4: Examples of pull-down and hierarchical menus
File Object
Palettes
Dynamics
SL-GMS Draw User’s Guide 1-7Version 6.2a- 26 May 2006
Figure 1-5: Point Selection Control and Loop Control icons (Motif)
Figure 1-6: Point Selection Control and Loop Control icons (Windows)
The Point Selection Control icons provide different modes to pick Pointswhile building objects. Snap Mode allows you to place the next Pointpicked at either the nearest grid intersection (Snap to Grid), the nearest
Snap Mode Point Mode
Loop ControlPoint Selection Control Select by
Extent
Loop Control
Select by Extent
Point Mode
Point Selection Control
Snap Mode
SL-GMS Draw User’s Guide 1-8Version 6.2a- 26 May 2006
predefined Point of the closest object (Snap to Gravity), or anywhere in theModel (Snap Mode Off).
Point Mode controls the Reference Point used to move, rotate, scale, ormirror objects. There are three modes available: Point Mode, Center Mode,and Reference Mode. Point Mode (the default) means that selected objectsare moved, rotated, or otherwise transformed relative to the predefinedPoint on an object nearest to the Point selected. Center Mode uses anobject’s center. The Reference Mode uses the Reference Point of anobject.
Use Loop Control to move forward and backward through a list of selectedobjects and to perform different operations, such as assigning dynamicbehavior to selected objects.
When the Select by Extent icon is activated, you can click a specified pointin the Model and drag the mouse to create a Selection Extent. The SelectionExtent appears as a rectangle and all items within that rectangle becomeselected. Typically, you can create a Selection Extent by clicking the SelectTool in an empty space in the edit window, and then dragging across theobjects to be selected. The Select by Extent icon is useful when there is noempty space to click in to begin the typical operation. See the sectionSelect Mode Tool on page 2-9 for more information about object selection.
Figure 1-7: Undo and Redo Tools
Motif
Windows
SL-GMS Draw User’s Guide 1-9Version 6.2a- 26 May 2006
The Undo and Redo tools allow you to erase or recreate the last editingchange you made such as creating, moving or deleting an object, or chang-ing a property within an object.
�ToolsThe panel of tools provided with the SL-GMSDraw editor allows you to cre-ate, change, view objects, and to preset views. Use of these Tools isdescribed in Chapter 2 — Tools.
Create Tools
Figure 1-8: Object Creation Tools
The icons are representative of the objects they create, asdefined in Figure 1-8:.
Spline
Polyline
Filled Polygon
Filled Closed Spline
Filled Circle
Filled Rectangle
Text Rectangle
Line
Wedge
Polygon
Closed Spline
Circle
Rectangle
Text
Three Point SectorSector
Marker
SL-GMS Draw User’s Guide 1-10Version 6.2a- 26 May 2006
Change Tools
Figure 1-9: Change Tools
Use the Duplicate Tool, illustrated in Figure 1-9:, to duplicate anobject.
Selection Tools
Figure 1-10: Selection Tools
Use the Select Mode Tool, illustrated in Figure 1-10:, to selectany object in the Active Working View by placing the cursorover the object and clicking the left mouse button. Each time youselect an object, it is added to the Select List.
Use the Select Point Tool, illustrated in Figure 1-10:, to moveand delete Points and to identify a specific Point in an object.
Duplicate
Select Mode Select Point
SL-GMS Draw User’s Guide 1-11Version 6.2a- 26 May 2006
View Tools
Figure 1-11: View Tools
The View Tools in Figure 1-11: are used to visually move andresize (pan and zoom) the graphics displayed in the ActiveWorking View window of SL-GMSDraw. They do notpermanently affect the objects displayed.
View Preset Tool
Figure 1-12: View Preset Tool
The view preset tool presents the same functionality as the set views foundin the View Options dialog. The view preset tool allows you to save up to 5views.
Point Pan
Zoom Out Once
Grabber
Zoom In Once
Zoom Out Continuous
Reset View
Zoom In Continuous
Zoom Rect
SL-GMS Draw User’s Guide 1-12Version 6.2a- 26 May 2006
�� Graphical PropertiesYou can easily set graphical properties for a single object or agroup of objects by pointing and clicking in the Default GraphicProperties window. Figure 1-13: on page 14 and Figure 1-14:on page 15, illustrate the five different menus, Fill, Edge, Text,TRect, and Marker, accessible from this window. To shiftbetween menus, click on any one of the tabs. (In Motif, the tabsappear as buttons on the left side of the window.)
SL-GMS Draw User’s Guide 1-13Version 6.2a- 26 May 2006
Figure 1-13: "Default Graphic Properties" tabs (part 1)
Fill Properties
Text Properties
Edge Properties
SL-GMS Draw User’s Guide 1-14Version 6.2a- 26 May 2006
Figure 1-14: "Default Graphic Properties" tabs (part 2)
Text Rectangle Properties
Marker Properties
SL-GMS Draw User’s Guide 1-15Version 6.2a- 26 May 2006
� Active Working ViewThe Models you are currently creating or modifying are displayed in theActive Working View window.
� Status InformationInformation concerning the current operation is displayed in the status bar.For example, if you are currently using the Line Tool, a prompt appearsthat reminds you to enter the starting and ending Points of the Line. In theMotif environment, the status information is displayed in the Status win-dow, as shown in Figure 1-15:.
Figure 1-15: "Status" window (Motif)
In the 32-bit Windows environment, the status information is displayed inthe Status bar at the bottom of the main SL-GMSDraw window.
SL-GMS Draw User’s Guide 1-16Version 6.2a- 26 May 2006
Dialog Windows
SL-GMSDraw makes extensive use of dialog boxes, which are displayed ifkeyboard input is required. Many of these dialog boxes are native to theactive operating system.
For example, to attach a name to a button, simply enter the name you wishto use and select Apply to activate your choice. Most dialog boxes acceptstandard text editor inputs, such as cursor-controlled cut, copy, and pasteoperations.
Figure 1-16: illustrates a dialog window used by SL-GMSDraw to handletext entry.
Figure 1-16: Text entry dialog window
Note that in all cases, clicking Apply applies changes without closing theWindow. Click Close to close the window without applying the changes. Ifyou make changes and forget to click Apply before clicking Close, aprompt appears reminding you that the changes will be lost if you continue.Clicking Reset redisplays the initial information you selected before anychanges were made.
startbutton
SL-GMS Draw User’s Guide 1-17Version 6.2a- 26 May 2006
Palettes
To better organize and present frequently used SubModels, SL-GMSDrawfeatures Palettes. Palettes provide the ability to re-use Models, making themeasy to access and incorporate into Models under development. Any Modelcreated with SL-GMSDraw can be instanced as a SubModel, saved on aPalette, and used in the construction of a more complex Model. Theinstancing of a SubModel on a Palette makes it easy to apply global chang-es to objects which have been embedded in many screens.
Included as Palettes with SL-GMSDraw are push buttons, radio buttons,text label boxes, text edit boxes, slider scales, and more. Figure 1-17:shows a Motif-style Palette. Figure 1-18: on page 19 shows the equivalentWindows-style Palette.
Figure 1-17: A standard Palette (Motif)
SL-GMS Draw User’s Guide 1-18Version 6.2a- 26 May 2006
Figure 1-18: A standard Palette (Windows)
Localization of output
Messages and other output from SL-GMSDraw is internationalized. Theinternationalization of messages and other output is described in Localiza-tion of output on page 6-7.
Organization of the Manual
Chapter 2 — Tools describes the Create, Change, Point, and View Toolspanels. These tools allow you to create objects, modify existing objects,manipulate the Points that comprise an object, and manipulate how theobjects are viewed during an editing session.
Chapter 3 — Setting Object Properties describes the window tools thatmodify object properties.
Chapter 4 — Dynamics describes how to attach dynamic behavior toobjects in a Model.
SL-GMS Draw User’s Guide 1-19Version 6.2a- 26 May 2006
Chapter 5 — Menus describes the pull-down menus and their various sub-menus. The options available within each menu allow you to load and saveModels, edit objects and change their properties, attach dynamic behaviorto objects, zoom and pan, and access Palettes of objects that you canselect and include in the Model being edited.
Chapter 6 — Building Models describes how to use SL-GMSDraw to createand test Models, create dialog boxes, create radio button groups, anddesign and implement Models for increased performance.
SL-GMS Draw User’s Guide 1-20Version 6.2a- 26 May 2006
2
Version 6.2a- 26 M
Tools
This chapter describes the options available with the SL-GMSDraw ToolPanels. The Tools Panels contain:
• Create Tools to create objects
• Change Tools to change an existing object
• Point Tools to manipulate individual Points in an object
• View Tools for zooming and panning
• View Preset Tool for setting up to 5 views
Create Tools
The Create Tools panel displays all the primitive graphicalobjects (i.e., Lines, Polygons, Circles, and the like) that can becreated and added to Models developed with SL-GMSDraw.
When you select a tool, the icon is highlighted and remainshighlighted and pushed-in until you select another tool, ordouble-click the right mouse button. When you select a tool, youcan draw any number of objects that meet the selectedparameters until you de-select the tool. You can also set apreference that automatically disables the tool once a singleobject is created. Click the Options Pull-Down menu and selectUser Preferences to display the User Preferences window.Next, select Create Single Objects. With this preferenceselected, the editor returns to selection mode as soon asthe points needed to create the object are picked.
When you select a tool, you must then establish a series ofPoints that define the object in the Active Working View (referto page 1-16). Click the left mouse button to select Points tocreate any shape. The status bar displays prompts for eachremaining action needed to complete the object. To terminatethe activity, select another tool or click the right mouse button.
SL-GMS Draw User’s Guide 2-1ay 2006
Tools
It is not necessary to pick the same Point as the starting andending Point to create "Closed" objects. Once you haveidentified the Points, simply click the right mouse button orselect another tool. Selecting another tool signals SL-GMSDrawto automatically connect the starting and ending Points to closethe object.
Subsequent sections in this chapter provide more detail aboutcreating different types of objects.
LinesBy comparison with a simple Line, a Polyline is defined by more than twopoints — a starting Point, ending Point, and additional Points between thetwo. The Points are connected by SL-GMSDraw with straight lines.
Line Polyline
SplinesPoints are connected by a Polyline as they are selected. On completion,the Polyline you created is redrawn as a Spline, and the curved lines aresmoothed. When you create a Closed Spline or Filled Closed Spline,SL-GMSDraw connects the end Points of the Polyline and converts them toa Closed Spline.
Spline Closed Spline Filled Closed Spline
SL-GMS Draw User’s Guide 2-2Version 6.2a- 26 May 2006
Tools
PolygonsPolygons (Closed Polylines) may appear as triangles, trapezoids, rectan-gles, or any shape composed of straight edges. When creating a Rectangleor Filled Rectangle, you need only define the two Points that define one ofthe diagonals. SL-GMSDraw automatically completes these simple rectan-gles.
Filled Filled
Polygon Polygon Rectangle Rectangle
CirclesTo identify the location and size of a Circle, select a center Point and aPoint on the outer edge of the circle.
Circle Filled Circle
SL-GMS Draw User’s Guide 2-3Version 6.2a- 26 May 2006
Tools
Sectors and WedgesThree Point Sectors and Sectors are curved Lines taken from the edge of aCircle. Three Point Sectors, Sectors, and Pies are always drawn counter-clockwise. The Points must be picked in the order (a, b, and c) illustrated inthe corresponding diagrams. For Sectors and Pies, SL-GMSDraw arrangesthe final Point you picked so that it has the same radius as that of the firstPoint picked on the curved edge. Three Point Sectors, Sectors, and Piesmay be filled.
Three Point Sector: SL-GMSDraw creates the Sector which best fits thethree Points picked.
Sector
b
c
a
SL-GMS Draw User’s Guide 2-4Version 6.2a- 26 May 2006
Tools
Wedge: The curved edges of a Wedge are always drawncounterclockwise.
If a final Point is picked that is clockwise from the second Point, SL-GMS-Draw creates a Circle shape with a single piece missing (as shown below)rather than a small Wedge.
SL-GMS Draw User’s Guide 2-5Version 6.2a- 26 May 2006
Tools
MarkersMarkers are small characters used to indicate positions of single Points.
Markers are created by picking Points in the Active Working View. AllMarkers created until either another Tool is selected, or the right mousebutton is clicked, are treated as a single object (i.e., individual characterscan not be selected). The Undo Tool "unpicks" all Markers created sincethe Marker tool was clicked.
The style of Marker created is set in the Default Graphic Properties win-dow, as described in Marker Style on page 3-21.
TextText is any printable character entered from the keyboard. A Text object iscreated by picking a Point to position the Text and then entering charactersfrom the keyboard. By default, the Text entered is centered left-to-rightaround this Point. The alignment of the Text and the direction of the Textthat is written may both be changed by clicking Text in the Default Graph-ic Properties window. Refer to Text font, size, alignment, direction, and col-or on page 3-14.
Text Rectangles are Rectangles (either filled or unfilled) with Text writtenon top of them. It is faster to erase and redraw Text Rectangles than it is toerase and redraw ordinary Text. Text Rectangles are used to create Textobjects that will be changed by an application. Changing Text requires thatthe old Text be erased by redrawing the Text in the erase color — a rela-tively slow operation for most graphical workstations. Text in Text Rectan-gles is deleted by erasing the Rectangle — a much faster operation.
Text may be constrained to fit within the boundaries of the Text Rectangle.Refer to Text Rectangle constraint on page 3-19.
SL-GMS Draw User’s Guide 2-6Version 6.2a- 26 May 2006
Tools
Text Text Rectangle
When you wish to enter multiple lines of Text, use the <RETURN> key tobegin each new line. When you are finished, click the right mouse button orselect another tool to terminate the procedure.1
Thus, to enter
key in:
This is five<RETURN>
lines of text,<RETURN>
<RETURN>
with a blank<RETURN>
third line.<right mouse button>
Text entry is done in-place. Text replacement and editing are accomplishedusing the Replace Text button (Replace button in Motif) in the Text tab ofthe Default Graphic Properties window, described in the section Text font,size, alignment, direction, and color on page 3-14.
NOTE: SL-GMSDraw does not prevent Text from appearing outside of aText Rectangle when text constraint is set to its default mode.The section Text Rectangle constraint on page 3-19, describes
1. The <ESCAPE> key can also be used to terminate the procedure on Motif systems.
This is fivelines of text,
with a blankthird line.
SL-GMS Draw User’s Guide 2-7Version 6.2a- 26 May 2006
Tools
how to control the behavior of text when it overflows the bounds ofa Text Rectangle object.
Changing Graphical PropertiesWhether you are creating Text or Text Rectangles, the propertiesused to define the Text are the same. Text properties, such ascolor and font, are described in Text font, size, alignment,direction, and color on page 3-14. The procedure to change edgestyle and width, edge color, and fill color properties of the TextRectangle is described in Edge color, style, and width on page3-9 and in Fill color, style, and direction on page 3-5. Theprocedure to change the text constraint within Text Rectangleobjects is described in Text Rectangle constraint on page 3-19.
The properties of the most recently created Text object can bechanged until a Point for positioning the next Text object hasbeen selected. You can also select multiple objects and changeany or all properties for that group at one time.
SL-GMS Draw User’s Guide 2-8Version 6.2a- 26 May 2006
Tools
Select Mode Tool
Select Mode is the default mode of SL-GMSDraw. TheSelect Mode Tool is active unless another tool is currently inuse. Select Mode allows you to select any object in theActive Working View by placing the cursor over the objectand clicking the left mouse button. As each object isselected, it is added to a list called the Select List. Thenumber of items on the Select List is displayed in the Statusarea (refer to page 1-16). To view the items that arecontained on the Select List, click the Object Pull-DownMenu and select Select List to display the Select Listwindow.
Additional objects can be added to the Select List by the following meth-ods:
• by clicking on the first object, then selecting additional objectswhile holding down the <SHIFT> key.
• by clicking the Edit Pull-Down Menu and choosing Select. Asubmenu is displayed that allows you to choose among severaldifferent selection criteria. The different selection options aredescribed in "Select" Submenu Options on page 5-17.
• by clicking in empty space and dragging the mouse to create aSelection Extent. The Selection Extent appears as a dashedrectangle and all items within that rectangle are selected.
NOTE: The Select By Extent icon in the Main Menu can be used whenthere is no empty space in which to place the cursor. Refer topage 1-8 for additional information.
Control Handles are displayed on the corners of selected objects and onboth the corners and edge mid-points of the Selection Extent.
To deselect any items that appear on the Select List you can either:
• click in empty space to deselect all previously selected items (allitems on the Select List) or
• click on any item to deselect all previously selected objects andselect the item clicked on.
SL-GMS Draw User’s Guide 2-9Version 6.2a- 26 May 2006
Tools
The Control Handles are useful for scaling (making larger or smaller) androtating objects.
Objects are scaled by simply clicking on a Control Handle of the selectionextent of a selected object and dragging the mouse. Dragging a cornerscales the object proportionally (by the same rescale percent for bothaxes); dragging an edge scales the object non-proportionally (either in thehorizontal or vertical direction).
NOTE: When an object is rotated, mirrored, scaled, or moved, aTransformation object is added to that object. A Transformationobject contains information used to display the object in its newposition. When SL-GMS displays an object using aTransformation object, it takes longer than if the object did notinclude a Transformation object. To improve performance, thetransformations can be applied to the object’s Points by using theApply Transform option of the Object Pull-Down Menu. Forefficiency, it is suggested that the Apply Transform option beused on all objects in a Model.
Objects are rotated by holding down the <CONTROL> key, clicking on aControl Handle, and dragging the mouse. The object is rotated in the direc-tion in which the mouse is moved.
By default, objects rotate around their centers. The Point around which anobject is rotated is called its Reference Point. The Reference Point of anobject is changed by using the Set Reference Point option of the PointPull-Down Menu or the Point Mode icons on the Main Menu bar (see page1-8).
Select Mode is also useful for moving an object. Moving an object is mosteasily accomplished by simply selecting an object and dragging it to thedesired location.
SL-GMS Draw User’s Guide 2-10Version 6.2a- 26 May 2006
Tools
Select Point Tool
The Select Point Tool moves and deletes Points andprovides the means to identify a specific Point on the object.
Click the Select Point Tool, then select an object: the Pointsdefining the selected object become visible. Click the desiredPoint to highlight and select it.
NOTE: Only one object at a time may be selected.
Move the selected Point by dragging the Point to another location in theActive Working View. Click the right mouse button to complete the moveoperation. Points on Text cannot be moved.
Delete the selected Point by pressing the <DELETE> key or by selectingDelete from the Edit Pull-Down Menu. Points on Text, Pie, Sector,Three-Point Sector, Rectangle, Marker, and Text Rectangle objects cannotbe deleted.
SL-GMS Draw User’s Guide 2-11Version 6.2a- 26 May 2006
Tools
Change Tools
DuplicateThe Duplicate Tool is used to duplicate objects. When you select objects,SL-GMSDraw outlines your selection with an echo rectangle. The fouranchor points of the echo rectangle are displayed as the mouse pointer ismoved to the location in which the copy is to be placed. The mouse pointeris shown at the location of the Reference Point. The Reference Point canbe changed by clicking the Point Pull-Down Menu and selecting Set Refer-ence Point.
The copy can be aligned with the original object by clicking the EditPull-Down Menu and selecting Align (refer to Edit Pull-Down Menu on page5-13 for the different types of alignment). In addition, the placement of acopy (in relation to the original object) can be restrained horizontally or ver-tically by holding down the <SHIFT> key.
The procedure used to modify object properties is described in SettingObject Properties on page 3-1.
NOTE: Objects can also be duplicated by holding down the<CONTROL> key and selecting the object, then dragging theecho rectangle to a new position in the Model.
SL-GMS Draw User’s Guide 2-12Version 6.2a- 26 May 2006
Tools
View Tools
View Tools provide a way to visually pan and zoom theobjects displayed in the Active Working View. They do notpermanently affect the objects displayed. To exit any of theView Modes, either select another Tool or click the rightmouse button. To reset the View after any of the panning orzooming operations, perform one of the following actions:
click the Reset View Tool, as described in Resetting the Viewon page 2-15
click the View Pull-Down Menu and select Reset
Panning around a ViewThe Grabber Tool is used to pan the View by clicking on the View and then"dragging" it to a new position.
The Pan Tool pans the current View to a Point picked in the Active Work-ing View and continues to do so as long as the mouse button remainsdepressed. A frame is displayed to "simulate" the View area.
Grabber Pan
Zooming into a ViewZooming in scales the View "up" to a larger View by a pre-defined percent-age. A smaller area of the Model is covered and, therefore, the individualobjects in the Active Working View appear larger.
The maximum percentage that the object or group of objects can bezoomed into is 100 by default (i.e., the final size of the object will be 100%larger than the original). Each time a new zoom in occurs, the zoomfactor2
is decreased until it reaches the zoom limit. The default value of the zoom
2. The zoomfactor equals the (old X or Y dimension)/(new X or Y dimension).
SL-GMS Draw User’s Guide 2-13Version 6.2a- 26 May 2006
Tools
limit is 0.01. The value of the zoom limit can be changed by clicking theView Pull-Down Menu, selecting View Options, and modifying the ZoomLimit value in the View Options window.
The Zoom In Once Tool zooms in on the entire View by a pre-defined per-centage. The pre-defined percentage can be changed by clicking the ViewPull-Down Menu, selecting View Options, modifying the Zoom Percentvalue, and clicking Apply in the View Options window.
The Zoom In Continuous Tool zooms in on the entire View, centered on aPoint picked in the Model, and continues zooming in until the mouse buttonis released.
The Zoom Rect Tool provides the ability to zoom objects in a region of theModel; the region is selected by clicking on two corners of a rectangularregion.
Zoom In Once Zoom in Continuous Zoom Rect
SL-GMS Draw User’s Guide 2-14Version 6.2a- 26 May 2006
Tools
Zooming out of a ViewZooming out is the opposite of zooming in. The View is scaled "down" to asmaller View by a pre-defined percentage. A larger area of the Modelbecomes visible and, therefore, the individual objects in the Active Work-ing View appear smaller.
The maximum percentage that the objects in the View can be zoomed outis 62.5 by default (i.e., the final size of the object will be 62.5% smaller thanthe original). Each time a new zoom out occurs, the zoomfactor isincreased until it reaches the zoom limit. The default value of the zoom lim-it is 0.01. The value of the zoom limit can be changed by clicking the ViewPull-Down Menu, selecting View Options, and modifying the Zoom Limitvalue in the View Options window.
The Zoom Out Once Tool zooms out of the View by a pre-defined percent-age. The pre-defined percentage can be changed by clicking the ViewPull-Down Menu, selecting View Options, modifying the Zoom Percentvalue, and clicking the Apply button in the View Options window.
The Zoom Out Continuous Tool zooms out of the View, centered on aPoint picked in the Model, and continues zooming out until the mouse but-ton is released.
Zoom-Out Once Zoom-Out Continuous
Resetting the ViewThe Reset View Tool resets the Active Working View to its original,un-zoomed state.
Reset View
SL-GMS Draw User’s Guide 2-15Version 6.2a- 26 May 2006
Tools
View Preset Tool
The View Preset Panel is used to save and recall up to five zoom and pansettings. This tool has the same functionality as the set views found in theView Options dialog, which is activated by clicking the View menu, andselecting View Options.
The current zoom and pan settings for the Active Working View are savedby clicking the Set button, and then clicking a preset button (1 - 5). When aview preset button has a saved zoom and pan setting associated with it, thebutton’s background color will change.
SL-GMS Draw User’s Guide 2-16Version 6.2a- 26 May 2006
Tools
Keyboard Equivalents
Model creation tools have, to this point, been described in terms of select-ing tool buttons, clicking on objects, and entering text. However, SL-GMS-Draw provides keyboard combinations that speed up many Model-buildingactivities. Sometimes referred to as "quick keys" or "power-user keys," theshortcut key combinations consist of simultaneous use of Tool Buttons andModifier keys: <ALT>, <CONTROL>, <SHIFT>, <TAB>, and certain num-bers.
SL-GMSDraw Quick Keys
Function Performed Tool used + Modifier keys
Temporarily invokes the Select Mode Tool
Any <ALT>
Copies an object (Select) <CONTROL>
Constrains modification,horizontally, vertically, proportionally
Any <SHIFT>
Incremental move in arrow direction of current object selected
Any <ARROW>
Makes next object on the Select List the focus object
Any <TAB>
SL-GMS Draw User’s Guide 2-17Version 6.2a- 26 May 2006
Tools
Left mouse button operations (Windows only)Double-clicking the left mouse button on a Control or SubModel Instancedisplays the Object Renamed Variables window. Double-clicking the leftmouse button on any other type of object displays the Object Informationwindow.
Right mouse button context menus (Windows only)Clicking the right mouse button also provides access to a menu of com-monly-used operations depending on what object or objects are selected.The menu selections include the display of the Model Properties, ViewOptions, Edit Dynamics, Object Information, Graphic Properties, andObject Renamed Variables windows.
In addition, the menu provides functions such as cut, copy, paste, delete,Group and Ungroup. If multiple objects are selected, the option to loop for-ward and backward thru the Select List is provided.
Select Point provides the capability of moving or deleting a Point in anobject. The Select Point mode is described in Select Point Tool on page2-11.
Available Operations
Selected Object Available Operations
No object DoneSelect PointModel PropertiesView Options
SL-GMS Draw User’s Guide 2-18Version 6.2a- 26 May 2006
Tools
Single Object DoneCutCopyPasteDeleteSelect PointEdit DynamicsObject InformationGraphic Properties
Multiple Objects DoneCutCopyPasteDeleteSelect PointEdit DynamicsGroupLoop ForwardLoop BackwardObject InformationGraphic Properties
Group DoneCutCopyPasteDeleteSelect PointUngroupObject InformationGraphic Properties
Available Operations
Selected Object Available Operations
SL-GMS Draw User’s Guide 2-19Version 6.2a- 26 May 2006
Tools
ModInst DoneCutCopyPasteDeleteSelect PointRenamed VariablesObject Information
Available Operations
Selected Object Available Operations
SL-GMS Draw User’s Guide 2-20Version 6.2a- 26 May 2006
3
Version 6.2a- 26 M
Setting Object Properties
This chapter explains how to modify object properties. It describes how toset the following types of properties for an object:
• Graphic
• Fill color, style, and direction
• Edge color, style, and width
• Text font, size, alignment, direction, and color
• Text constraint for Text Rectangles
• Marker style, and color
• Attach a name to an object
• Attach a string to pass to an application (UserData)
• Attach an integer to pass to an application (UserWord)
The Model itself is also an object and UserData, dynamics, Background,and other properties can be set for it.
SL-GMS Draw User’s Guide 3-1ay 2006
Setting Object Properties
Graphic Properties
Figure 3-19: "Default Graphic Properties" tabs (part 1)
Fill Properties
Text Properties
Edge Properties
SL-GMS Draw User’s Guide 3-2Version 6.2a- 26 May 2006
Setting Object Properties
Figure 3-20: "Default Graphic Properties" tabs (part 2)
The five tabs (Fill, Edge, Text, TRect, and Marker) of the Default GraphicProperties dialog box, shown in Figure 3-19: on page 3-2 and Figure 3-20:on page 3-3, change the graphic properties of selected objects. (SelectProperties from the Object Pull-Down Menu and then select Graphic inthe Properties submenu to access this dialog box.) Only the properties forthe selected tab are visible. To shift between the five different tabs, clickone of the tabs labeled Fill, Edge, Text, TRect, or Marker. (On Motif plat-
Text Rectangle Properties
Marker Properties
SL-GMS Draw User’s Guide 3-3Version 6.2a- 26 May 2006
Setting Object Properties
forms, the tabs are represented by buttons, along the left side of the dialogbox, that perform the same function as the tabs.)
Additionally, you can select the font type you wish to apply to any text youhave added to the object. The Default Graphic Properties dialog providesHershey and Raster type text choices. In addition, the Windows versionallows you to select one of several different TrueType text styles.
The color panel to the right side of each dialog box (patterned, in the caseof monochrome workstations) contains buttons that set the color of fill,edge, text, or Marker (depending upon which view is being displayed).When one of these buttons is clicked, the fill, edge, or text color of anyselected object is changed to the color indicated on the button.
By default, the color panel displays 32 colors. If more colors are defined inthe “colordef.dat” file, the user can scroll to select a color. See the sectionSetting Color Definitions on page 6-8 for more information about definingcolors.
SL-GMS Draw User’s Guide 3-4Version 6.2a- 26 May 2006
Setting Object Properties
Fill color, style, and direction
Figure 3-21: "Fill" graphic properties
The Fill graphic properties tab, shown in Figure 3-21:, has the followingactive regions:
• Direction
• Fill percent
• Interior
• Gradient dialog
• Fill and Unfill
• Pattern
• Color
Direction ColorPatternFill percent Fill and UnfillInterior Gradient dialog
SL-GMS Draw User’s Guide 3-5Version 6.2a- 26 May 2006
Setting Object Properties
Fill DirectionThe fill direction buttons change the direction from which the fillproceeds. Click the radio button corresponding to theappropriate direction. Four fill directions are available, asillustrated in Figure 3-22:.
Figure 3-22: Fill directions
The fill directions and percent of fill are used in dynamics wherethe direction of fill and percent of fill are determined by datavalues.
Fill PercentThe Fill Percent button (Fill % in Motif ) sets the fill percent (thefraction of the selected polygon1 that is filled), beginning at oneof the four sides. A dialog window prompts for the fill percent.
Fill InteriorThe fill interior buttons specify whether the fill interior (finter)color pattern for the selected object is hollow, solid, opaque, ortransparent:
• Hollow — the object is logically filled but no fill patternappears on the screen (finter = 0).
NOTE: When the Hollow button is selected, changing colors on filledobjects apparently has no effect because they are hollow (similarto being unfilled). However, one advantage is that an object with
1. This includes Polygons, Closed Splines, Rectangles, Pies, Sectors, Three Point Sectors, Circles, and Text Rectangles.
from bottom to top
from top to bottom
from right to left
from left to right
SL-GMS Draw User’s Guide 3-6Version 6.2a- 26 May 2006
Setting Object Properties
hollow interior fill can be selected by clicking its interior, whereasan object that is unfilled can be selected only by clicking on itsedge.
• Solid — the object is filled with an unpatterned color (finter= 1).
• Opaque — the object is filled with the patterned opaquecolor (finter = 2).
• Transparent — the object is filled with the patternedtransparent color, that is, objects logically behind can beseen through the transparent object (finter = 3).
• Gradient — a filled object is shaded from the start color tothe end color (finter = 4).
An object behind an object with finter 2 will not show through,whereas an object behind an object with finter 3 will showthrough. Further information about the fstyle and fintercommands is provided in the chapter SL-GML Reference in theSL-GMS Quick Reference.
Gradient DialogThe Gradient Dialog button allows the gradient fill attribute tobe set on a filled object. A Gradient Fill Properties dialog windowprompts for the gradient style, configuration, start color, and upto 4 color intervals, as shown in Figure 3-23:.
NOTE: On pseudocolor machines, the gradient is filled according to thecolordef.dat indices. For example, if the gradient start color isindex 4 and the end color is index 8 the gradient will consist ofcolors 4, 5, 6, 7, and 8. The gradient may appear as stripes. Todisplay the best gradient quality, set up the color table with asmooth color gradient in the indices between the start and endcolors. The 256 color mode on Windows NT acts the same aspseudocolor.
SL-GMS Draw User’s Guide 3-7Version 6.2a- 26 May 2006
Setting Object Properties
Figure 3-23: Gradient Fill Properties
FillThe Fill button fills selected objects. Select one or more objects,then click the Fill button. Next, modify the Fill properties byclicking the color, style, interior, direction, and percentagecontrols, as described in this section.
UnfillThe Unfill button resets selected objects to their unfilled state.
Fill PatternThe boxes in the fill style panel are buttons which set the fillpattern or style (fstyle). There are eleven pre-defined patterns.Custom fill styles can be defined using fstyle entries in aplatform-independent gmsprefs.dat file, which is read bySL-GMS during runtime initialization.
The fill pattern panel is enabled only when the fill interior is setto Opaque or Transparent.
Fill ColorSets fill color, as described on page 3-4.
SL-GMS Draw User’s Guide 3-8Version 6.2a- 26 May 2006
Setting Object Properties
Edge color, style, and width
Figure 3-24: "Edge" graphic properties
The Edge graphic properties tab has the following active regions:
• Edge Style (estyle)
• User-entry of style other than defaults [Motif only; not yetimplemented in Windows]
• Edge Width (ewidth)
• Buttons to create either Closed or Open Polygons
• User-entry of width other than defaults
• Color
Edge StyleSet the edge style property of a selected object by clicking thedesired style in the Edge Style selector. In the Windows version,spin buttons (up-down arrow buttons) can also be used to selectthe edge style (the integer corresponding to the desired edge
Style Width Close/Open Polygons Color
SL-GMS Draw User’s Guide 3-9Version 6.2a- 26 May 2006
Setting Object Properties
style can also be entered directly in the text entry box to the leftof the spin buttons).
The edge style of an object can be set to 0 (none) if that object isalso filled. Not drawing the edge increases performance in thedrawing of filled objects by eliminating the step required to drawthe outline of the object.
Edge Style Other (Motif only)Click the Style button in the Edge Style selector to specify a linestyle that is not included in the Style selector, as described inSL-GMS Edge and Line styles on page 3-10. Enter an integerstyle value in the Edge Style dialog box and click the Applybutton.
SL-GMS Edge and Line stylesSL-GMSDraw allows selection of five different edge and linestyles (estyle) via the Style selector. They are, from top tobottom in Figure 3-24: on page 3-9: estyle 0, 1, 2, 3, and 4.When you select any of the edge or line style buttons, that styleis applied to the selected object.
However, SL-GMS supports 27 different Edge (line) styles. InMotif only, clicking the Style button beneath the edge Styleselector allows specification of line styles other than thoseprovided by the selector. (Specification of other edge styles isnot supported in the Windows version of SL-GMSDraw.)
SL-GMS Draw User’s Guide 3-10Version 6.2a- 26 May 2006
Setting Object Properties
The SL-GMS Line style numbers have the following meanings:
For example:
In summary, the valid Line styles for the estyle command are as follows:
Line Style Number Description
Single digit N Basic Line style with the appearance shown
1N Line style N with each cycle shortened by a factor of 2
2N Line style N with each cycle lengthened by a factor of 2
CommandLine
Appearance
estyle 2 . . . . . . . . . . . . .
estyle 12 ..........................
estyle 22 . . . . . . .
Valid Line Styles for the SL-GML "estyle" Command
Style Numbers Description Approximate
Appearance
1 11 21 solid _________________
2 12 22 dot, dot2, dotx2 . . . . . . . . . . . . . . . . . .
3 13 23 dashed, dashed2, dashedx2 __ __ __ __ __ __ __
SL-GMS Draw User’s Guide 3-11Version 6.2a- 26 May 2006
Setting Object Properties
Because of the half and twice relationships, some redundancy existsamong some of the Line styles. For example, Line styles 3 and 28 have vir-tually identical appearances.
Edge WidthSet the edge width property of a selected object by clicking thedesired width in the Width selector. In the Windows version, spinbuttons (up-down arrow buttons) can also be used to select theedge width (the integer corresponding to the desired edge widthcan also be entered directly in the text entry box to the left of thespin buttons).
Open and Close PolygonThe Close Polygon button closes the two ends of a polyline tocreate a polygon. The Open Polygon button disconnects thetwo ends of a polygon to create a polyline.
Edge Width OtherIn Motif versions, click the Width button in the Edge Widthselector to specify a line width that is not included in the Widthselector. Enter an integer width value in the Edge Width dialog
4 14 24 dashdot, dashdot2, dashdot2x __ . __ . __ . __ . __ .
5 15 25 border, border2, borderx2 __ __ . __ __ . __ __
6 16 26 center, center2, centerx2 ____ _ ____ _ __ _
7 17 27 divide, divide2, dividex2 __ . . __ . .__. . __ . .
8 18 28 hidden, hidden2, hiddenx2 _ _ _ _ _ _ _ _ _ _ _
9 19 29 phantom, phantom2, phantomx2 ____ _ _ ____ _ _ __
Valid Line Styles for the SL-GML "estyle" Command
Style Numbers Description Approximate
Appearance
SL-GMS Draw User’s Guide 3-12Version 6.2a- 26 May 2006
Setting Object Properties
box and click Apply. The Width selector provides lines withwidths ranging from 1 to 5, hence a value of 6 or more must beused.
In the Windows version, spin buttons (up-down arrow buttons)are used to select an edge width greater than five (the integercorresponding to the desired edge width can also be entereddirectly in the text entry box to the left of the spin buttons)
Edge ColorSet edge color, as described on page 3-4.
SL-GMS Draw User’s Guide 3-13Version 6.2a- 26 May 2006
Setting Object Properties
Text font, size, alignment, direction, and color
Figure 3-25: "Text" Default Graphic Properties window (Windows)
Figure 3-26: "Text" Default Graphic Properties window (Motif)
As shown in Figure 3-25: and Figure 3-26:, the text graphic properties win-dows contains the following active regions:
• Text Alignment Panel
• Font Type Selector
• Text Direction
• Font Size
Alignment TrueType Font StyleText Direction
Font Name
Color Replace Text Selector
Font Size Font Type
Scaling
Font Type Selector
Font Name
Font Size
Replace Text SelectorColor SelectorAlignment
Text Direction
SL-GMS Draw User’s Guide 3-14Version 6.2a- 26 May 2006
Setting Object Properties
• TrueType Styles (Windows only)
• Font Name
• Replace Text
• Color
Text Alignment PanelSet text alignment using the Text Alignment Panel. The panelprovides 15 different positions for text alignment, as representedby the circles at each of the intersections in Figure 3-27:. In theWindows version, each position is represented by a radio button.In the Motif version, text is aligned by clicking one of the 15"diamond" markers (each marker corresponds to one of thepositions in the text alignment grid shown in Figure 3-27:.)
Text alignment is defined as the offset of Text relative to thePoint chosen for positioning the Text object. The vertical buttonsin the panel represent the left edge, center, and right edge of theText extent. The horizontal buttons show the bottom of the Textextent, the base of the Text, the middle of the extent, the top ofcapital letters, and the top of the Text extent. Set the alignmentby selecting the appropriate button.
Figure 3-27: Fifteen different positions available for aligning text
SL-GMS Draw User’s Guide 3-15Version 6.2a- 26 May 2006
Setting Object Properties
Figure 3-28: illustrates the alignment positions controlled withthe Text Alignment Panel. Four copies of a Text Rectangle areshown, with each copy having its text string aligned with differentalignment settings.
Figure 3-28: Example text alignments in a Text Rectangle
It is advisable to use half-center alignment — the defaultalignment — whenever Text Rectangles are created. Usinghalf-center alignment positions Text precisely in the center of theRectangle.
Font Type SelectorThe Font Type can be either Hershey or Raster.2 When"Hershey" is selected, only the names of the Hershey Fonts are
2. In the Windows version, the font type can be either Hershey or TrueType, or one of the thirteen SL-GMS default fonts, but the available font names for all font types are displayed in the "Font Name" scrollbox at all times.
SL-GMS Draw User’s Guide 3-16Version 6.2a- 26 May 2006
Setting Object Properties
displayed in the "Font Name" scroll box. When "Raster" isselected, only the names of the available Raster fonts aredisplayed in the "Font Name" scroll box.
Text DirectionText Direction has two settings: left-to-right and top-to-bottom,indicated by arrows. When the down arrow is selected, all Textobjects currently on the Select List, and all new Text objects willdisplay vertically. When the horizontal arrow is selected, all Textobjects currently on the Select List, and all new Text objects willdisplay horizontally.
Font SizeSet the height of text by clicking the font Size button in Motif,then entering a value in the dialog box prompt. In Windows, thefont size setting can either be directly typed into the Height textentry box, or the spin buttons (up/down arrows) can be used toincrementally increase or decrease the font size.3 Height isspecified in World Coordinates.4
The Size button dialog box in Motif, and the Default GraphicProperties window in Windows also contain a check box labeledAdjust for scaling. If this box is checked, the text heightattribute of each object on the Select List will be set to the givenvalue adjusted for a scaling matrix that may be attached to theobject. For example, suppose a Text Rectangle object werescaled by a factor of 2, and the value "3" is entered for the sizeof the text. The text height attribute of the object would be set to1.5.
TrueType Styles (Windows only)If the Font Type is a TrueType font, a style other than the defaultcan be selected by clicking one of the style buttons in theTrueType Styles section. Four additional styles are available:
3. The value of the font height entered by the user is limited to the height of the Model.
4. World Coordinates are double precision.
SL-GMS Draw User’s Guide 3-17Version 6.2a- 26 May 2006
Setting Object Properties
bold, italic, underlined, and strike-through. The style buttonstoggle the font style. For instance, if the default style isdisplayed, clicking the "bold" button will display the "Bold" style.Clicking the "bold" button again will display the default style.
Font Name On Motif systems, if Font Type is set to "Hershey," only thenames of the Hershey Fonts are displayed in the "Font Name"scroll box. When "Raster" is selected, only the names of theRaster fonts are displayed in the "Font Name" scroll box. Selectthe font by clicking the appropriate entry in the "Font Name"scrollbox.
On Windows systems, the available font names for Hershey,TrueType, and the thirteen SL-GMS pre-defined fonts aredisplayed at all times in the "Font Name" scrollbox. Hersheyfonts are designated with "Hs" preceding the name of the font.TrueType fonts are designated with "TT".
The available fonts are defined in the file "fontdef.dat." Adiscussion of setting font definitions is provided in the sectionSetting text font definitions on page 6-4. The SL-GMS® QuickReference provides additional information about font definitionsand availability.
Replace TextTo replace a text string, click the Replace Text button (Replacebutton in Motif). The Object Text dialog window displays thecurrent Text string attached to the object. The Text string can beadded to, modified, or deleted.
Another manner in which to replace text is to click the ObjectPull-Down Menu and select Properties, then select Text todisplay the Object Text dialog window.
Text ColorSets text color, as described on page 3-4.
SL-GMS Draw User’s Guide 3-18Version 6.2a- 26 May 2006
Setting Object Properties
Text Rectangle constraint
Figure 3-29: "TRect" Default Graphic Properties window (Windows)
A text constraint attribute is available for Text Rectangle objects. Thisattribute controls how text behaves when it overflows the bounds of a TextRectangle object.
All constraint modes use an edge width of 1 to determine the boundary ofthe Text Rectangle. None of the constraint modes use edge width to makethe text rectangle boundary smaller for fitting or clipping the text.
There are three settings available for text constraint, with None being thedefault:
• None (value = 0)
• Clip (value = 1)
• Fit Width (value = 2)
Setting text constraint equal to None allows a Text Rectangle object’s textto display outside (overflow) the text rectangle boundary. This is the defaultsetting.
The Clip setting will cause a Text Rectangle object’s text to be clipped tothe text rectangle boundary.
The Fit Width setting is used to constrain the text in a Text Rectangleobject to fit within the boundary of the text rectangle. This is accomplishedby changing the position of the individual characters in the text. The char-
SL-GMS Draw User’s Guide 3-19Version 6.2a- 26 May 2006
Setting Object Properties
acters may overlay each other to stay inside the boundary. If the width of asingle character overflows the boundary, the characters will overlay eachother and the text will overflow the text rectangle (it will not be clipped).This mode does not modify font size, just character positioning.
The Fit Width setting is only supported for precision 0 fonts (TrueTypefonts), and only on Windows platforms. The Fit Width setting is only forhorizontal text and width is determined by the width of the Text Rectanglewithout any transformations applied (e.g., scaling, rotating).
Windows only: If you are going to rotate a Text Rectangle, and you wantthe precision 0 (TrueType font) text to fit within the rotated rectangle, setthe text constraint to Fit Width. In addition, enable the rotation of Precision0 (TrueType fonts)
Precision 0 fonts rotation is enabled in an application by callinggmsTPrec0RotFlag( )5 or by sending the "tprec0_rot_flag" message to theStandardTopState.6 Precision 0 fonts rotation is enabled in SL-GMSDrawby sending the "tprec0_rot_flag to the StandardTopState in the ".gms-drawrc" file7 as shown below:
gmsdraw_standard_top_state tprec0_rot_flag 1
The text constraint can be set by selecting either None, Clip, or Fit Width.In the Windows version, the numeric value can also be entered using thespin-control box.
All Text Rectangle objects created after the text constraint is set will usethis mode unless another setting is selected.
5. Refer to the SL-GMS® Function Reference.6. Refer to the SL-GMS® State Class Library Reference.7. Refer to the section Saving the Editor Set-up.
SL-GMS Draw User’s Guide 3-20Version 6.2a- 26 May 2006
Setting Object Properties
Marker Style
Figure 3-30: "Marker" Default Graphic Properties window (Motif)
Figure 3-31: "Marker" Default Graphic Properties window (Windows)
The Marker graphic properties tab has the following active regions:
• Marker Style (mstyle)
• Color
Style Color
Style Color
SL-GMS Draw User’s Guide 3-21Version 6.2a- 26 May 2006
Setting Object Properties
Marker StyleSet the style property of a selected Marker by clicking thedesired style in the Marker Style selector. In the Windowsversion, spin buttons (up-down arrow buttons) can also be usedto select the Marker style (the integer corresponding to thedesired Marker style can also be entered directly in the text entrybox to the left of the spin buttons).
Marker ColorSets Marker color, as described on page 3-4.
SL-GMS Draw User’s Guide 3-22Version 6.2a- 26 May 2006
Setting Object Properties
Attaching a Name to Objects
Attaching a name to an object:
• allows objects to be selected by name (e.g., for selection ofinvisible or undetectable objects)
• allows objects to be found by an application program
Names may be any collection of alpha-numeric characters and must beginwith a letter. The SL-GMS reserved words, listed in the chapter SL-GMSReserved Words in the SL-GMS Quick Reference, cannot be used asnames.
To attach a name to a selected object, click the Object Pull-Down Menuand select Properties, then select Name. The Object Name window is dis-played. Enter the name of the object, then click Apply.
Figure 3-32: "Object Name" window
The maximum length of an object name is 40 characters. A name can beadded to only one object at a time. If multiple objects are on the Select List,use the Loop Control icons in the Main Menu bar (refer to page 1-8) tomove among the objects in the Select List.
SL-GMS Draw User’s Guide 3-23Version 6.2a- 26 May 2006
Setting Object Properties
Attaching a String to Pass to an Application (UserData)
UserData is an arbitrary string used by an application program in any waydesired. UserData must be fewer than 256 characters in length and it mustbe a C string.8
To add UserData to a selected object, click the Object Pull-Down Menuand select Properties, then select Userdata. The Object Userdata win-dow is displayed. Enter the string, then click Apply.
Figure 3-33: "Object Userdata" window
UserData can be added to only one object at a time. If multiple objects areon the Select List, use the Loop Control icons in the Main Menu bar (referto page 1-8) to move among the objects in the Select List.
8. Application programs can attach UserData up to 16,384 characters through the gmsUserData( ) function; the SL-GMSDraw interface limits the entry to 256 characters. The limits within SL-GMSDraw will probably be increased when line editing of UserData becomes available on all supported platforms.
SL-GMS Draw User’s Guide 3-24Version 6.2a- 26 May 2006
Setting Object Properties
Attaching an Integer to Pass to an Application (UserWord)
UserWord is an integer used by an application program in any way desired.
To add UserWord to a selected object, click the Object Pull-Down Menuand select Properties, then select Userword. The Object Userword win-dow is displayed. Enter the integer, then click Apply.
Figure 3-34: "Object Userword" window
A UserWord can be added to only one object at a time. If multiple objectsare on the Select List, use the Loop Control icons in the Main Menu bar(refer to page 1-8) to move among the objects in the Select List.
SL-GMS Draw User’s Guide 3-25Version 6.2a- 26 May 2006
Setting Object Properties
Setting Model Properties
A Model is another type of object and several different properties can beset for it.
To set Model properties, click the Model Pull-Down Menu and select Prop-erties. The Model Properties window is displayed.
Figure 3-35: "Model Properties" window
When a blank Model is created using the the New with Background optionof the File Pull-Down Menu, SL-GMSDraw automatically creates anon-detectable Filled Rectangle as the background object in the back-ground color. The size of the background object is set by changing thedefault values (72 units wide and 54 units high) in the Model Propertieswindow.
NOTE: The size of the Model is set to the size of the background object.
A blank Model can also be created using the New option of the FilePull-Down Menu. The first object created in the Model (typically a FilledRectangle) is considered the background object. When the first object iscreated in the Model, the Background Detectable and BackgroundObject Dimensions and Origin areas in the Model Properties window
SL-GMS Draw User’s Guide 3-26Version 6.2a- 26 May 2006
Setting Object Properties
are enabled. The size of the background object can be changed by modify-ing the width and height values in the Model Properties window.
By default, the lower left corner of the WC-window is defined as the Point0,0. To change the default, modify the text entry box designating the lowerleft corner of the dotted-line graphic.
The color of the background object is set by entering an integer in theBackground Color entry box that corresponds to one of the color boxes inthe Default Graphic Properties window.
In addition, setting Background Detectable to OFF (i.e.,unchecked), willcause the background object in the current Model to become undetectable.Setting Background Detectable to ON (i.e., checked) allows the back-ground object to be selected and modified.
If the Erase in Background Color is set to OFF (i.e., unchecked), theModel erases objects using color index 0 (white). However, if objects arebeing erased and redrawn on top of an object whose color is other than col-or 0, "holes" are left as the dynamic objects are changed. An example isthe meter shown in Figure 3-36:. Each time the needle moves it is erased incolor 0 (white), and “holes” are left in the “face” of the meter marking theprevious positions of the needle. When the needle moves to 50, a whiteline appears at 0 because the needle erased in white on the grey back-ground.
Figure 3-36: "Holes" in meter face
If the Erase in Background Color is set to ON (i.e., checked), the Modelerases objects in the fill color of the background object, if the object is
SL-GMS Draw User’s Guide 3-27Version 6.2a- 26 May 2006
Setting Object Properties
filled. The color used by the Model to erase objects is called the back-ground color. If the first object is not filled, the background color is set tocolor index 0.
To correct the "holes" in the previous "meter" example, the first object in theModel would be a Filled Rectangle whose color is the same as the "face" ofthe meter. With Erase in Background Color set to ON, the needle erasesin the color of the meter "face" as shown in Figure 3-37:.
Figure 3-37: Background color set to the same color as meter "face"
The background color is used as the erase color for all objects in the Modelexcept for parts within a SubModel Instance which has its own backgroundcolor.
A UserData string can be added to the Model by clicking the UserData but-ton in the Model Properties window. The Model Userdata window is dis-played, as shown in Figure 3-38:. Enter the UserData string and click theApply button.
Figure 3-38: "Model Userdata" window
SL-GMS Draw User’s Guide 3-28Version 6.2a- 26 May 2006
Setting Object Properties
A UserWord can also be added to the Model by clicking the UserWord but-ton in the Model Properties window. The Model Userword window is dis-played, as shown in Figure 3-39:. Enter the UserWord and click the Applybutton.
.
Figure 3-39: "Model Userword" window
Dynamics can be added to the Model by clicking the Dynamics button inthe Model Properties window. The Model Dynamic Properties window isdisplayed, as shown in Figure 3-40:.
Figure 3-40: "Model Dynamic Properties" window
SL-GMS Draw User’s Guide 3-29Version 6.2a- 26 May 2006
Setting Object Properties
The dynamic scripting language (described in the section AttachingDynamics to an Object on page 6-12) is used to add dynamics to the Model.Type the dynamic script into the Model Dynamic Properties window andclick the Apply button.
Selecting the Flags button in the Model Properties window displays theModel Flags window, as shown in Figure 3-41: on page 3-30.
Figure 3-41: "Model Flags" window
Flags can be set on the Model unconditionally.
"Model Flags" Options
Flag Description
Erase Flags
noerase Causes the update pass to omit erasure of any of the Model’s parts before redrawing the Model.
batcherase Causes all objects in a Model to be erased first and the entire Model to be redrawn.
Point Flags
SL-GMS Draw User’s Guide 3-30Version 6.2a- 26 May 2006
Setting Object Properties
Selecting the Apply button will apply the settings in the Model Propertieswindow to the current Model.
Selecting the Apply as Default button will apply the background color, andon/off settings to all subsequent Models built within the current editing ses-sion. The background object dimensions are also applied to all subsequentModels built using the New with Background option of the File Pull-DownMenu within the current editing session.
When you exit SL-GMSDraw, the settings in the Model Properties windowrevert to SL-GMSDraw default values.
NOTE: To use the new Model property settings as defaults for futureediting sessions, the settings must be saved to a resource file.The section Saving the Editor Set-up on page 6-4 provides moreinformation.
pts relative Forces the Points of a Polyline or Polygon (filled ones also) to be transformed relative to the first Point of the object; useful for objects distorted while animated and moved around the screen due to pixel rounding.
pts symmetric Forces an object’s Points to be transformed relative to each other; useful for objects distorted while animated and moved around the screen due to pixel rounding.
General Flags
dynarray Marks a Model so it passes the index of each part down as the traversal index to be used in Array Dynamics.
doublebuffer Enables software double buffering.
"Model Flags" Options(continued)
Flag Description
SL-GMS Draw User’s Guide 3-31Version 6.2a- 26 May 2006
4
Version 6.2a- 26 M
Dynamics
This chapter explains how to attach dynamic behavior to objects in a Mod-el. This dynamic behavior is accomplished through actions which specifychanges to be applied to objects in response to changes in application vari-ables. Any object, or individual object elements, may be driven separatelyby as many different variables as required.
This chapter explains:
• dynamic descriptions — the SL-GMS text that defines thedynamic behavior of objects
• tools used to attach dynamic descriptions to objects
• renaming variables in a Model Instance
• setting Control Object properties
• showing variables contained in objects
• previewing the dynamic behavior of a Model
SL-GMS Draw User’s Guide 4-1ay 2006
Dynamics
Dynamic Descriptions
A dynamic description is text in a syntax recognized by SL-GMS that spec-ifies a change in the appearance of an object in response to a change in anapplication variable, or an action that is taken in response to input eventsfor the object. A DynProp (Dynamic Property) comprises all of the dynamicdescriptions attached to an object.
Figure 4-1: DynProp containing two dynamic descriptions
In Figure 4-2:, the dynamic description is unconditional. It specifies,"Whenever the variable stat changes, the object is filled with the colorindexed by the value of stat."
Figure 4-2: Dynamic description with unconditional display dynamics
fcolor is an action keyword. A complete table of all valid dynamic actionkeywords is provided in the Dynamics Reference chapter in the SL-GMSQuick Reference.
stat is a Variable Reference. A Variable Reference can be identical to avariable in a programming language such as Ada, FORTRAN, Pascal, or C.A Variable Reference can also be an expression — a more complex entity
* fcolor stat
tankvol1
= (tankmin1+1) : (tankmax1-1)
fpercent 0:100
fcolor 2
description
descriptionDynProp
dynamic
dynamic
* fcolor stat
SL-GMS Draw User’s Guide 4-2Version 6.2a- 26 May 2006
Dynamics
involving formulas, function calls, data structures, files, and other data.Expressions can include any number of references to variables or calls toapplication-specific functions and standard arithmetic and logical opera-tors. Expressions are parsed for conventional notations.
Actions in unconditional dynamic descriptions are executed whenever anyVariable Reference in an object’s DynProp changes. Compare this to theconditional dynamic description in Figure 4-3:. It specifies, "When the vari-able tankvol1 is within the indicated range, the object becomes per-cent-filled according to where in the range the variable falls, and the fillcolor is set to the color indexed by 2."
Figure 4-3: Dynamic description with conditional display dynamics
fpercent and fcolor are action keywords that change the fill percent and fillcolor attributes of the object. tankvol1, tankmin, and tankmax are VariableReferences. tankmin+1 and tankmax-1 are expressions.
Actions in conditional dynamic descriptions are executed only when thetesting of any logical expression results in TRUE after reading the value ofa Variable Reference. When an asterisk (*) is used in a conditional dynamicdescription, the object is updated whenever the variable, or any variable inthe arguments in the action(s), changes.
NOTE: Unconditional dynamic descriptions must be specified before anyconditional dynamic descriptions in an object’s DynProp. Refer tothe Dynamics chapter in the SL-GMS Reference for furtherinformation.
Figure 4-2: on page 4-2 and Figure 4-3: show examples of unconditionaland conditional display dynamics. However, dynamic changes to objectscan also occur as a result of an input event, referred to as input dynamics.
tankvol1= (tankmin + 1) : (tankmax - 1)
fpercent 0:100fcolor 2
SL-GMS Draw User’s Guide 4-3Version 6.2a- 26 May 2006
Dynamics
Input dynamics can manipulate either SL-GMS internal or application pro-gram variable(s) and they are preceded by the pound sign (#). An objectcan have both unconditional and conditional display dynamics, in additionto input dynamics, in its attached DynProp.
Figure 4-4: DynProp with input and conditional display dynamics
The dynamic description shown in Figure 4-4: specifies, "Whenever aninput event occurs, call the function gms_flash( ); and whenever the vari-able tanklevel changes, set the fill color to the color specified by the vari-able noalarm."
NOTE: The input dynamic description shown above uses the call actionkeyword to call a function. Other types of action keywords canalso be included in an input dynamic. gms_flash( ) is a functioncall supplied in the SL-GMS GISMO Action Functions in theSL-GMS Quick Reference. User-defined functions may also beused.
Further information about DynProps, actions, variable references, and con-ditional, unconditional, and input dynamics are provided in the Dynamicschapter in the SL-GMS Reference.
dynamic description
conditionaltanklevel= *
fcolor noalarm
#call gms_flash( ) dynamic
descriptionDynProp
input
SL-GMS Draw User’s Guide 4-4Version 6.2a- 26 May 2006
Dynamics
Attaching Dynamic Descriptions to Objects
Objects can be given dynamic descriptions that cause them to rotate,move, change scale, change Text strings, change Line style and color, andbecome visible or invisible. The proper syntax for dynamic descriptions isdescribed in the Dynamics chapter of the SL-GMS Reference.
Editing DynamicsDynamic descriptions are normally attached to objects by using the ObjectDynamic Properties option of the Dynamics Pull-Down Menu. The ObjectDynamic Properties option displays the Object Dynamic Properties window.
The Object Dynamic Properties window instances a simple text editor usedto create or modify the object’s dynamic description. No changes are actu-ally made to the object’s dynamics until the Apply button is clicked.
Only one object at a time may have a DynProp edited in the Object DynamicProperties window. If multiple objects are on the Select List, use the LoopControl buttons in the Main Menu bar (refer to page 1-8) to select the nextobject on the Select List.
Click inside the Object Dynamic Properties window to begin editing. Anexample of a DynProp typed into the Object Dynamic Properties window isshown in Figure 4-5:.
SL-GMS Draw User’s Guide 4-5Version 6.2a- 26 May 2006
Dynamics
Figure 4-5: A DynProp in the "Object Dynamic Properties" window
Press the <RETURN> key at the end of a line to move the cursor to thenext line to be typed. To insert a line, click at the end of the previous lineand press the <RETURN> key. To modify a line, click the line, backspaceover the characters you wish to change, and enter the correct information.You can place the cursor anywhere on the line and edit from that point. Todelete a line, either click on the line until the entire line is highlighted andpress the <RETURN> key or click on the line and use the <BACKSPACE>key to delete all the characters in the line.
When you have entered the format of the dynamic descriptions correctly,the DynProp automatically indents the line when you click the Apply button.This indentation, illustrated in Figure 4-6:, clarifies the grouping of thedynamic descriptions and the actions and variable tests within a particulardynamic description. The indentation has no effect on the execution of thedynamic description.
SL-GMS Draw User’s Guide 4-6Version 6.2a- 26 May 2006
Dynamics
Figure 4-6: A DynProp indented after pressing the "Apply" button
Hold, Release, and Clear The Hold button holds the contents of the entire Object DynamicProperties window in a hold buffer. The contents in the holdbuffer are held until quitting SL-GMSDraw or until changed byclicking the Hold button again. Leaving the Object DynamicProperties window does not affect the hold buffer, nor doeschanging between Models affect it.
The Release button replaces the current contents of the ObjectDynamic Properties window with the contents of the hold buffer.
The Clear button clears the contents of the hold buffer.
Error checkingFigure 4-7: illustrates a DynProp that contains an error. Line 3reads "tankvol 1" instead of "tankvol1." SL-GMSDraw detects
SL-GMS Draw User’s Guide 4-7Version 6.2a- 26 May 2006
Dynamics
"tankvol 1" as an error because it is not a valid dynamic action.When the Apply button is clicked, a dialog box, as shown inFigure 4-8:, will display indicating the line in which the erroroccurs. Click the OK button to acknowledge the error. Correct allerrors and click the Apply button again. The DynProp will thenappear indented, as illustrated in Figure 4-6: on page 4-7.
Figure 4-7: A DynProp typed incorrectly with an error on line 3
Figure 4-8: A dialog box displaying the location of an error
SL-GMS Draw User’s Guide 4-8Version 6.2a- 26 May 2006
Dynamics
Renaming Variables
SL-GMS allows you to reuse Models and control objects through instanc-ing. Model Instances, also called Instances or SubModels, retain thedynamic properties of the original Model. The various Instances are differ-entiated from the original by renaming variables — the driving variables arerenamed to different variable names. For example, when you develop apanel of gauges used to represent the same process variable coming frommany different sites, a gauge Model is created with dynamic specificationsdriven by the variable volts. The panel Model would then be created with acollection of gauge Model Instances. The volts variable is renamed foreach instance. For example, volts1, volts2, and so on.
Rename Vars ToolUse the Rename Vars tool to rename the variables of a SubModel that havebeen instanced into a Model. To use the Rename Vars tool, select anobject, click on the Dynamics Pull-Down Menu, and select Object RenamedVariables. The Object Renamed Variables window, shown in Figure 4-9:, isdisplayed.
NOTE: If a SubModel has no DynProps attached to it, or if the selectedobject is not a Model Instance, the Object Renamed Variableswindow will be empty, since the object does not have anyvariables that need to be renamed.
SL-GMS Draw User’s Guide 4-9Version 6.2a- 26 May 2006
Dynamics
Figure 4-9: Renaming the "bg_color" variable in a Model Instance
Double-click on a value to highlight and rename it. Once the value is edit-ed, either double-click on another value or hit the <ENTER> key.
Click the Apply button to apply the renamed variables to the object. TheApply button will be enabled after a change, when another cell is clicked,or when hitting the <ENTER> key.
Only one Model Instance at a time may have its variables renamed. If mul-tiple Model Instances are on the Select List, use the Loop Control buttonsin the Main Menu bar (refer to page 1-8) to select the next object on theSelect List.
SL-GMS Draw User’s Guide 4-10Version 6.2a- 26 May 2006
Dynamics
Hold, Release, and Clear The Hold button holds the contents of the entire Object RenamedProperties window in a hold buffer. The contents in the holdbuffer are held until quitting SL-GMSDraw or until changed byclicking the Hold button again. Leaving the Object RenamedVariables window does not affect the hold buffer, nor doeschanging between Models affect it.
The Release button replaces the current contents of the ObjectRenamed Variables window with the contents of the hold buffer.
The Clear button clears the Renamed Variable strings of all thevariables in the Object Renamed Variables window.
Error checkingWhen you click the Apply button, SL-GMSDraw will determine whether ornot the renaming is valid. If it is not, a dialog box is displayed indicating theline in which the error occurs. Click the OK button to acknowledge the error,then correct the error and click the Apply button again.
SL-GMS Draw User’s Guide 4-11Version 6.2a- 26 May 2006
Dynamics
Previewing the Dynamic Behavior of Objects
A Model must be saved if it has been edited, before the dynamics can beexercised. In addition, while it is being previewed, the Model cannot beedited or saved. After previewing, the Model is automatically reloaded sothat any changes made by the dynamic updating are discarded.
Selecting the Preview Options option of the Dynamics Pull-Down Menuexercises the DynProps in the current Model using data contained in a datafile. The data file has the name of the current Model, with the suffix ".dat."
To create or edit a ".dat" file during a session, the Edit Data File windowmust be invoked. This is done by clicking the Dynamics Pull-Down Menuand selecting the Edit Data File option. Text can then be entered in this win-dow which will create or modify a ".dat" file. If a data file already exists forthis Model, that data file is automatically displayed in the Edit Data File win-dow. Clicking the Save File button writes the file to disk. Clicking the OpenFile button displays a dialog window which allows entry of the name of adata file.
Figure 4-10: "Edit Data File" window
Further information about the format and use of “.dat” files is provided inthe Dynamics chapter of the SL-GMS Reference and in the Dynamics Refer-ence chapter of the SL-GMS Quick Reference.
SL-GMS Draw User’s Guide 4-12Version 6.2a- 26 May 2006
Dynamics
When the Preview Options option is selected, the Preview Options windowis displayed, as shown in Figure 4-11:.
Figure 4-11: "Preview Options" window
The Preview Options window controls the Timer Period (the number of milli-seconds between each update). Click the Start button to load the "<model-name.dat" file1 and begin previewing the Model. Clicking the Stop buttonterminates the preview. Clicking the Pause button suspends dynamic updat-ing without leaving Preview Mode but the Model cannot be edited or saved.
NOTE: If another Model is opened while a Model is being previewed, thenewly-opened Model will begin previewing automatically.
1. If a "<modelname>.dat" file does not exist, a warning message will display and previewing will not occur.
SL-GMS Draw User’s Guide 4-13Version 6.2a- 26 May 2006
5
Version 6.2a- 26 M
Menus
This chapter describes the menus that appear on the Main Menu bar. Whenitems on this menu bar are selected, additional pull-down menus will dis-play.
.
Figure 5-1: SL-GMSDraw Menu Bar
Figure 5-1: illustrates the Main Menu bar with the following tool categories:
• File — Load, store, print, and other tools that provide access toModel files
• Edit — Cut, paste, and other tools used to make changes toobjects
• View — Zoom, pan, and set screen size
• Model — Set Model properties
• Object — Group, visibility, and other object properties
• Dynamics — Create and edit object dynamics
• Options — Invoke tool panels, Control Window, Status Window,and other drawing tools
• Palettes — Select a SubModel object from a pre-definedcollection
• Point — Access and control Points on objects
• Help — Information about the use of SL-GMSDraw
SL-GMS Draw User’s Guide 5-1ay 2006
Menus
Figure 5-2: SL-GMSDraw menu structure
SL-GMS Draw User’s Guide 5-2Version 6.2a- 26 May 2006
Menus
File Menu
The File Pull-Down Menu provides the standard application file functionsfor Model files, such as opening and closing, saving, printing, and exitingthe SL-GMSDraw application. The options are described in the table "File"Pull-Down Menu Options on page 5-4.
Figure 5-3: File menu structure
File Pull-Down Menu
Export submenu
Import submenu
Print submenu(Windows only)
SL-GMS Draw User’s Guide 5-3Version 6.2a- 26 May 2006
Menus
Import and ExportThe Import and Export submenus, shown in Figure 5-3: on page 5-3, pro-vide the import and export of images (.xwd on Motif, .bmp on Windows,.jpeg, .jpg, and .jpe) and export of text models (.g).
"File" Pull-Down Menu Options
Option Description
New Displays an empty Model window with options clear, and without a background rectangle.
New with Background
Displays an empty Model window with options clear, and a background rectangle.
Open .m1 File Loads and displays a Model from disk.
Close Stops editing the current Model. If the Model has not been saved since the last change, prompts to save first.
Change Directory Brings up the Change Directory window, which allows you to change directories for the Save As, Import, and Export options.
Merge... Adds the parts of another Model to the current Model. The name of the current Model remains the same. The merged Model still exists as a Model file and a copy of its parts becomes a part of the current Model.
Save Writes the current Model to disk.
Save As... Prompts you to name the current Model and then saves it to disk under that name; the file extension is ".m1". Full path names may be used.
Import Prompts for files to be imported into the current Model. SL-GMSDraw can import images files (.xwd on Motif, .bmp on Windows, .jpeg, .jpg, and .jpe). If two files exist with the same name but different extensions, the file with the extension ".bmp" or ".xwd" is opened before the ".jpeg,” “.jpg,” or “.jpe." The Available Images dialog of the Image submenu displays a directory tree listing all image files in the current directory and directories in the SL-GMS library paths.
SL-GMS Draw User’s Guide 5-4Version 6.2a- 26 May 2006
Menus
For compatibility with all supported platforms, file names should not exceedfourteen characters (including extensions). Model names should be ten (orfewer) characters to allow for valid extensions of ".g," ".m1," ".ps," ".m2,"".xwd," ".bmp," “.jpg,” and ".dat." The characters in the Model name can bealphabetic, numeric, or underscore {A through Z, a through z, 0 through 9,_ }. Model names cannot contain dashes, blanks, <ESCAPE>, or othernon-printing characters.
Export Prompts for the name of a file to be created. The current Model is written into this file. SL-GMSDraw can export text models (.g) and images (.xwd on Motif, .bmp on Windows, .jpeg, .jpg, and .jpe). The JPEG Image option of the Export submenu invokes a browser dialog that allows selection of the output file and folder. The option also provides a slider for setting JPEG quality.
View GML File Prompts for the name of a ".g" file to be viewed. Invokes the Open .g File window displaying the ".g" file.
Print(Windows)
Invokes the Print submenu to print part or all of the current Model. The PostScript option of the Print submenu invokes the SL-GMS Print Dialog window to generate a PostScript file.
Print(Motif)
Invokes the SL-GMS Print Dialog window to generate a PostScript file.
Exit Stops editing the current Model and terminates execution of SL-GMSDraw. If the Model has not been saved since the last change, prompts to save first.
"File" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-5Version 6.2a- 26 May 2006
Menus
Import ImageSelecting the Image... option, of the Import submenu, displays theAvailable Images window as shown in Figure 5-4:. The AvailableImages dialog displays a tree listing image files in the current directoryand directories in the SL-GMS Library path. To preview an image, clickon the image file name and the image will display to the right of thedirectory tree.
Figure 5-4: Available Images window
SL-GMS Draw User’s Guide 5-6Version 6.2a- 26 May 2006
Menus
Bitmap ExportSelecting the Bitmap Image... option, of the Export submenu, displaysthe Export Bitmap File window as shown in Figure 5-5:. The Unixversion of this window produces a “.xwd” file while the Windows versionproduces a “.bmp” file.
Figure 5-5: Export Bitmap File window
GML ExportSelecting the GML Script... option, of the Export submenu,automatically generates the appropriate file name and writes the file todisk. A confirmation dialog appears once the operation is complete.
SL-GMS Draw User’s Guide 5-7Version 6.2a- 26 May 2006
Menus
JPEG ExportSelecting the JPEG Image... option, of the Export submenu, displaysthe Export JPEG File window as shown in Figure 5-6:.
Figure 5-6: Export JPEG File window
SL-GMS Draw User’s Guide 5-8Version 6.2a- 26 May 2006
Menus
Java ExportSelecting the export Java option displays the GUI interface for theSL-GMS Code Generator for Java utility. This option is available onlywith SL-GMS J/Developer or J/Network.
Figure 5-7: Export Java window
SL-GMS Draw User’s Guide 5-9Version 6.2a- 26 May 2006
Menus
File OperationsThe Open .m1 File, Merge, Save, and Save As options, when invoked, dis-play the standard Explorer Browse window on Windows systems.
On Motif systems, the Save As option and the Save option (if the Model isbeing saved for the first time) display a dialog window in which the name ofthe file is entered. The Change Directory option can be used first, ifrequired. The Open .m1 File and Merge options invoke the Open .m1 Filewindow, shown in Figure 5-8: on page 5-10. This window lists the subdirec-tories within the current directory, any parallel directories, and the parentdirectory. You can select any directory by clicking it. The full file path canalso be typed in from the keyboard, but it must not contain dashes, blanks,<ESCAPE>, or other non-printing characters.
Figure 5-8: "Open .m1 File" window (Motif)
Models are saved as files with the suffix ".m1" which makes these fileseasy to distinguish from other files. Model files are binary files, that is, theycannot be read or edited without using a special program such as SL-GMS-
SL-GMS Draw User’s Guide 5-10Version 6.2a- 26 May 2006
Menus
Draw. An ".m1" file can contain a maximum of 2,147,483,647 (231 - 1)objects.
Print and PostscriptThe Print option in Motif, and the PostScript option of the Print submenu inWindows systems, display the SL-GMS Print Dialog window, shown in Fig-ure 5-9: on page 5-11. This is a custom dialog that provides options notfound on the standard Print dialog furnished by the operating system.1
Figure 5-9: "Print Dialog" window
The following table describes the elements of the Print Dialog window.
1. The Print option in Windows systems displays the standard Print dialog furnished by the operating system.
"Print Dialog" Window Buttons and Fields
Option Description
Printer Name Specifies the printer to receive the PostScript output file.
Add Border Creates a thin black border around the PostScript output.
SL-GMS Draw User’s Guide 5-11Version 6.2a- 26 May 2006
Menus
Add Init Graphics Puts "initgraphics" in the PostScript file.
Color Lines Prints any colored lines of width less than 1 in color. Otherwise, colored lines of width less than 1 are changed to black.
Print Grid Prints the grid in the Active Working View.
Print Background Prints the Model’s background object, if any.
Print HiLite Prints the selection highlight box that appears around an object(s) currently selected, if any.
Output Orientation Valid values:
Copies Specifies the number of copies of PostScript output to send to the printer.
Scale % Sets the scaling factor for the PostScript output.Valid values = 0 to 100
Rotate Sets the rotation factor for the PostScript output.Valid values = 0.0 to 360.0 (+) or ( - ) degrees.
Move X Sets the X offset factor for the PostScript output.Image is "displaced" by the amount specified in the X direction.
Move Y Sets the Y offset factor for the PostScript output.Image is "displaced" by the amount specified in the Y direction.
Print to disk Sends output to a file instead of the printer.
Print Prints the file.
Cancel Cancels the print function.
"Print Dialog" Window Buttons and Fields(continued)
Option Description
Portrait Landscape
SL-GMS Draw User’s Guide 5-12Version 6.2a- 26 May 2006
Menus
Edit Pull-Down Menu
The Edit Pull-Down Menu, shown in Figure 5-10: on page 5-15, providesthe tools with which to select objects, copy or cut them from a Model to aclipboard, paste them from the clipboard into a Model, or permanentlydelete objects. These edit operations can be applied to a collection ofselected objects, called the Select List.
"Edit" Pull-Down Menu Options
Option Description
Undo "Undoes" the previous Model editing function. Sets the Undo stack size, as described in User Preferences window on page 5-41.
Redo "Redoes" the previous Model editing function.
Cut Cuts objects in the current Select List.
Copy Copies objects in the current Select List.
Paste Pastes objects from the clipboard into the Model.
To Scratch Palette Displays the "_SCRATCH_" Palette window. The Scratch Palette is then loaded with duplicates of the objects on the Select List, replacing any objects previously in the Palette. The duplicates are placed in the Palette at the lower left corner, in the same relative position as the objects are in the Active Working View. Objects can be copied from the "_SCRATCH_" Palette window into a Model.
Delete Deletes objects in the current Select List.
Mirror Rotates and moves objects in the current Select List so that they appear as a mirror image. The objects are mirrored in the direction selected in the Mirror submenu.
Align Changes the alignment between a set of objects in the current Select List. The objects are aligned according to the selection in the Align submenu.
Order Controls the order of objects in the current Model’s part List. The order of objects affects how objects are displayed. Refer to page 5-16 for more information.
SL-GMS Draw User’s Guide 5-13Version 6.2a- 26 May 2006
Menus
Scale Relative Scales (resizes) objects in the current Select List to the dimensions of the focus object (the first object added to the Select List) in the horizontal direction only, the vertical direction only, or equally in both directions.
Select Handles the Select List: adds objects to the Select List in the order in which they were clicked and provides alternate methods for selecting objects. Options in this submenu are used when objects are changed or deleted in SL-GMSDraw. Refer to page 5-17 for more information.
Insert Active X Control(Windows only)
Creates an Active X Control from a list of Active X Controls on the system. Refer to Inserting Active X Controls on page A-1 for more information.
"Edit" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-14Version 6.2a- 26 May 2006
Menus
Figure 5-10: Edit menu structure
Align submenu
Order submenu
Edit Pull-Down
Scale Relative submenu
Select submenu
Mirror submenu
Menu
SL-GMS Draw User’s Guide 5-15Version 6.2a- 26 May 2006
Menus
OrderThe Order submenu controls the order of objects in the current Model’s partList. The order of objects affects how objects are displayed. Objects areadded to the Model’s part List in the order created. The first object in aModel’s part List is displayed first and the last object is displayed last. Notethat objects displayed later may overwrite those displayed earlier if theirboundaries overlap. The Order submenu presents several methods forchanging the order of objects in the Model’s part List.
"Order" Submenu Options
Option Description
Front of All Moves the objects on the Select List in front of all other objects in the Model (i.e., the objects are moved to the end of the Model’s part List).
Back of All Moves the objects on the Select List in back of all other objects in the Model (i.e., the objects are moved to the beginning of the Model’s part List).
By Selection Reorders objects in the Model’s part List based upon their order on the Select List. The first object on the Select List remains in its original position in the Model’s part List, followed by the remaining objects in the Select List. Select the objects in the desired order, then click By Selection.
To view the order of objects on the Select List, click the Object Pull-Down Menu and select Select List. A list of the objects on the Select List is displayed in the Select List window. Highlighting an object listed in the Select List window highlights the object in the Active Working View.
SL-GMS Draw User’s Guide 5-16Version 6.2a- 26 May 2006
Menus
Scale RelativeThe Scale Relative submenu controls how objects are scaled relative toeach other. The first object added to the Select List is the "focus" object. Allother objects on the Select List are scaled relative to the dimensions of the"focus" object.
SelectThe Select submenu handles the Select List. Options in this submenu areused when objects are changed or deleted in SL-GMSDraw. One way toadd objects to the Select List is by clicking them. As long as the objects aredetectable, they are added to the Select List in the order in which they areclicked. This menu provides alternative methods for selecting objects.
"Scale Relative" Submenu Options
Option Description
Horizontal Scales objects on the Select List to have the same horizontal dimension as the "focus" object.
Vertical Scales objects on the Select List to have the same vertical dimension as the "focus" object.
Same Scales objects on the Select List to have the same horizontal and vertical dimensions as the "focus" object.
"Select" Submenu Options
Option Description
All Selects all objects in the current Model.
Invert Deselects objects on the Select List and selects all objects that were not on the Select List.
SL-GMS Draw User’s Guide 5-17Version 6.2a- 26 May 2006
Menus
By Name Selects objects by name from the current Model. Enter the name of the desired object when prompted; wild card characters are accepted. All objects with that name are selected. Selecting a part of a SubModel by name is not permitted.
To assign a name to an object, click the Object Pull-Down Menu, select Properties, then select Name. In an application program, call the gmsObjNameStr( ) function.
by Properties Selects objects using one or more properties. Displays the Select by Properties dialog window. Refer to page 5-19.
"Select" Submenu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-18Version 6.2a- 26 May 2006
Menus
Clicking the Edit Pull-Down Menu, selecting Select and then selecting byProperties (By Property in Motif), displays the Select by Properties window,shown in Figure 5-11:.
Figure 5-11: "Select by Properties " window
Objects are added to the Select List by first selecting an object (i.e., the"focus" object). Then, use the Select by Properties window to designate theproperties of the "focus" object to be used to select additional objects.Objects are also added to the Select List without first selecting an object.All objects having dynamic properties, renamed variables, a Userword, or aUserData string attached to them can be selected by clicking the appropri-ate box in the Select by Properties window. In addition, the name attachedto an object can be used for selection. Wildcard characters can be used inthe entry of the name.
When the Add to List of Selected Objects is selected, then all the objectsthat match the parameters set in the Set by Properties window are append-
SL-GMS Draw User’s Guide 5-19Version 6.2a- 26 May 2006
Menus
ed to the existing Select List. However, if the Add to List of Selected Objectsis disabled then the existing Select List is cleared and all of the objects thatmatch the parameters set in the Set by Properties window are added (i.e.,the newly-selected objects replace the old Select List).
SL-GMS Draw User’s Guide 5-20Version 6.2a- 26 May 2006
Menus
View Menu
The View Menu controls aspects of the Active Working View.
The Status Window option (Motif only) displays the Status window. Refer topage 1-16 for a description of the Status window.
The Raise option (Motif only) brings the window of the Active Working Viewto the front of all other windows.
The Refresh option redraws the Active Working View.
The Reset option resets the Active Working View to the same View andparameter values as displayed when the Model was first opened.
The View Options option invokes the View Options window, as shown in Fig-ure 5-12:.
Windows menu
Motif menu
SL-GMS Draw User’s Guide 5-21Version 6.2a- 26 May 2006
Menus
Figure 5-12: "View Options" window
The View Options window controls the following View features:
• Set View coordinate values2— these World Coordinate settingsallow specific x,y coordinate values to be set for the zoom/panoperation.
• Set Pan Percent
• Set Boundary Percent
• Set Zoom limit
• Set Zoom percent
• Display the Zoom factor
• Save up to five preset Views
Zoom and Pan operations make temporary adjustments to SL-GMSDraw’sWC-window dimensions.
The Apply button makes the current zoom or pan settings the default for theremainder of the SL-GMSDraw session.
The Reset button undoes the collected View operations and returns the Viewto its initial appearance.
The Close button closes the View Options window.
2. By default, the dimensions of the opposing corners of SL-GMSDraw’s Active Working View are (0, 0) and (72, 54).
SL-GMS Draw User’s Guide 5-22Version 6.2a- 26 May 2006
Menus
Model Pull-Down Menu
The Model Pull-Down Menu, shown in Figure 5-13:, allows the user to mod-ify attributes of the Model.
Figure 5-13: Model Pull-Down Menu
The following table summarizes the Model Pull-Down Menu options.
"Model" Pull-Down Menu Options
Option Description
Userdata Attaches a UserData string to a Model. Displays the Model Userdata dialog window. Refer to page 3-28.
Userword Attaches a Userword to a Model. Displays the Model Userword dialog window. Refer to page 3-29.
Flags Allows various flags to be set on the Model unconditionally. Refer to page 3-30.
Dynamics Attaches a dynamic description to the Model. Refer to page 3-29.
Properties Assigns properties to a Model. Displays the Model Properties window. Refer to Setting Model Properties on page 3-26.
SL-GMS Draw User’s Guide 5-23Version 6.2a- 26 May 2006
Menus
Object Pull-Down Menu
The Object Pull-Down Menu, shown in Figure 5-14:, operates on selectedobjects or invokes dialogs that operate on selected objects. The ObjectPull-Down Menu provides the tools with which to create or destroy Groups.A Group is a collection of objects. Any object that is part of a Model canalso be part of a Group. Members of a Group act as one object. For exam-ple, an entire Group can move, change color, disappear, or be filled. AGroup can be constructed with only one part.
The three Group types — Group, Fill Group, and Complex Fill Group — fillwith different behaviors because their boundaries are treated differently todenote interior and exterior when crossed with a horizontal ray. (See page5-27 for more information.) Any Graphical Primitive can be used as parts ina Group, Fill Group, or Complex Fill Group. Once a Group has been creat-ed, clicking the Fill button, located in the "Fill" view of the Default GraphicProperties window, will fill it.
Figure 5-14: Object menu structure
Object Pull-Down Menu
Properties submenu
Fill Group submenu
SL-GMS Draw User’s Guide 5-24Version 6.2a- 26 May 2006
Menus
The following table summarizes the Object Pull-Down Menu options.
"Object" Pull-Down Menu Options
Option Description
Group Creates a Group object. Select the desired objects, then click Group. The number of objects on the Select List changes to "1", indicating that the selected objects have become a single Group object.
UnGroup Ungroups objects in a Group. Select the Group object, then click UnGroup. The number of objects on the Select List changes from "1" (the selected Group) to as many objects as comprised the Group.
Special Ungroup Saves the properties of a single Group and ungroups the Group. A single Group is placed on the Select List and then the Special Ungroup option is selected. The selected Group is ungrouped and its parts are put on the Select List. Any properties saved by a previous Special Ungroup are lost. After the individual parts of the group have been edited, the Special Regroup option is selected. The properties saved are: Name, UserData, DynProp, Transformation matrix, Reference Point, UserWord, object_Flags, Visibility, and Detectability.
Special Regroup Regroups the parts and restores the properties previously saved by the Special Ungroup option to a single Group.
Fill Group Displays a submenu containing Fill Group and Complex Fill Group options. Refer to Figure 5-14: on page 5-24 and the description on page 5-27 for further information.
Properties Displays a submenu including Graphic, Name, Userdata, Userword, Flags, Information, and Text options. Refer to Figure 5-14: on page 5-24. For a detailed explanation, see page 5-28 to page 5-30.
Visibility On Makes objects on the Select List visible.
Visibility Off Makes objects on the Select List invisible. Invisible objects are also undetectable.
SL-GMS Draw User’s Guide 5-25Version 6.2a- 26 May 2006
Menus
Detect On Makes objects on the Select List detectable.
Detect Off Makes objects on the Select List undetectable. Undetectable objects offer two benefits. First, SL-GMS does not compute the extent of such objects, which improves display performance for the Model. Second, undetectable objects are more difficult to select, offering some security against modification to the Model designer. Although undetectable objects cannot be selected by clicking, these objects can be selected by options in the Select submenu of the Edit Pull-Down Menu, such as Name, or by dragging an extent rectangle around the object.
Apply Transform Applies a transformation to objects on the Select List. A transformation is Move, Rotate, Scale, Mirror, or any combination of these operations. Transformations create a special object called a transformation matrix, which displays the transformed object in its new size or orientation. When a transformation is applied, the Points used to orient the object when it is displayed are changed and the transformation matrix is removed. Removing the transformation matrix is desirable because it speeds up the display of objects and reduces the memory required to store them.
Apply Transform has no effect on some types of objects.1 SL-GMSDraw automatically determines whether the transformation can be applied to an object’s Points.
Remove Transform
Removes a transformation from objects on the Select List. When a transformation is removed, the object is erased and redrawn in its original location unless a transformation with Apply Transform is applied.
Move Displays the Move window, which allows the user to enter values for moving an object(s) in an absolute (move to Point) or relative (move by amount) form. Refer to page 5-33.
"Object" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-26Version 6.2a- 26 May 2006
Menus
Selecting the Fill Group option, shown in Figure 5-14: on page 5-24, will dis-play the Fill Group submenu. The submenu provides two additional Grouptypes, as described in the following table.
Scale Displays the Scale window, which allows the user to enter values for scaling an object(s) in both the x and y directions. Objects can also be scaled proportionally. Refer to page 5-33.
Rotate Displays the Rotate window, which allows the user to rotate the object(s) to a desired angle. Refer to page 5-34.
Select List Displays a list of the objects on the Select List in the Select List window. Each object is listed in the following form:memory address : class of object <object name>
Highlighting an object listed in the Select List window highlights the object in the Active Working View.
1. For example, if a Rectangle is rotated and Apply Transform is selected, the transformation is not applied to the Rectangle’s Points. Rectangles are defined by two opposing corners, and applying the transformation to these Points would result in a different Rectangle, not a rotated Rectangle. Similarly, if a Circle is unevenly scaled to create an Ellipse, the transformation cannot be applied. A Circle is defined by its center and a Point on its edge, and applying the transformation would result in a different Circle, not an Ellipse-shaped Circle.
"Fill Group" Submenu Options
Option Description
Fill Group Similar to Group except that SL-GMSDraw connects the selected open objects with an invisible edge so that they can be filled as one object.
Complex Fill Group Similar to Group except that SL-GMSDraw creates a Group object which can be filled with respect to multiple boundaries (such as "islands" or "holes").
"Object" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-27Version 6.2a- 26 May 2006
Menus
Selecting the Properties option, shown in Figure 5-14: on page 5-24, dis-plays the Properties submenu. The Properties submenu provides options todisplay properties, as described in the following table.
Selecting the Graphic option of the Properties submenu displays one of theviews of the Default Graphic Properties window, described in the sectionGraphic Properties on page 3-2.
Selecting the Information option of the Properties submenu displays a win-dow that provides information about the selected object. The informationincludes the class, name, position, and extent of the object. It also displaysthe values of various attributes associated with the object. Figure 5-15: onpage 5-29 illustrates the information that is displayed when selecting, forexample, a Text Rectangle and then selecting the Information option of theProperties submenu.
"Properties" Submenu Options
Option Description
Graphic Displays the Default Graphic Properties window.
Name Displays the Object Name dialog window.
Userdata Displays the Object Userdata dialog window.
Userword Displays the Object Userword dialog window.
Flags Allows various flags to be set on an object unconditionally.
Information Displays the Object Information window, which identifies the class, name, userdata, position, extent, and DynProp associated with an object. It also displays the values for the fill, text, and edge attributes.
Text Displays the Object Text dialog window.
SL-GMS Draw User’s Guide 5-28Version 6.2a- 26 May 2006
Menus
Figure 5-15: "Object Information" window
Name Property DialogThe section Attaching a Name to Objects on page 3-23 provides a completedescription of using the Object Name window and the purpose of assigningnames to objects.
Figure 5-16: "Object Name" window
startbutton
SL-GMS Draw User’s Guide 5-29Version 6.2a- 26 May 2006
Menus
UserData Property DialogThe section Attaching a String to Pass to an Application (UserData) on page3-24 provides a complete description of using the Object Userdata windowand the purpose of assigning strings to objects.
Figure 5-17: "Object Userdata" window
UserWord Property DialogThe section Attaching an Integer to Pass to an Application (UserWord) onpage 3-25 provides a complete description of using the Object Userwordwindow and the purpose of assigning integers to objects.
Figure 5-18: "Object Userword" window
Selecting the Flags option of the Properties submenu displays the ObjectFlags window, as shown in Figure 5-19: on page 5-31. Flags can be set onan object unconditionally.
start pump test
SL-GMS Draw User’s Guide 5-30Version 6.2a- 26 May 2006
Menus
Figure 5-19: "Object Flags" window
"Object Flags" Options
Flag Description
Erase Flags
noerase Causes the update pass to omit erasure of any of the object’s parts before redrawing the object.
batcherase Causes all objects in a List to be erased first and the entire List to be redrawn.
Point Flags
pts relative Forces the Points of a Polyline or Polygon (filled ones also) to be transformed relative to the first Point of the object; useful for objects distorted while animated and moved around the screen due to pixel rounding.
pts symmetric Forces an object’s Points to be transformed relative to each other; useful for objects distorted while animated and moved around the screen due to pixel rounding.
General Flags
dynarray Marks a Group, Model, or Instance so it passes the index of each part down as the traversal index to be used in Array Dynamics.
doublebuffer Enables software double buffering.
SL-GMS Draw User’s Guide 5-31Version 6.2a- 26 May 2006
Menus
The pts symmetric flag is more effective than the pts relative flag for allevi-ating distortion due to pixel rounding errors. The pts relative flag is mosteffective for complex, non-symmetrical objects.
Apply accepts the changes.
repair only set on a Group; when the flag is set, if any of the individual elements of the group are redrawn, then the entire Group is redrawn
"Object Flags" Options
Flag Description
SL-GMS Draw User’s Guide 5-32Version 6.2a- 26 May 2006
Menus
Scaling, moving, and rotating an objectClicking the Object Pull-Down Menu and selecting Move displays the Movewindow, as shown in Figure 5-20:.
Figure 5-20: "Move" window
The object(s) is moved by entering a double value in either the "Horizontal"or "Vertical" text-entry box, or in both boxes. To move the object to a specif-ic Point in the Active Working View, select Move to point, enter the horizon-tal and vertical coordinate of the Point, and click Apply.
To move the object by a specified amount in either the horizontal, vertical,or both directions select Move by amount. Clicking Apply moves theobject(s) by the amount entered in the "Horizontal" and "Vertical" text-entryboxes.
Clicking the Object Pull-Down Menu and selecting Scale displays the Scalewindow, as shown in Figure 5-21:.
Figure 5-21: "Scale" window
SL-GMS Draw User’s Guide 5-33Version 6.2a- 26 May 2006
Menus
An object is scaled by entering a value into the "Horizontal" and "Vertical"text-entry boxes. An object is scaled proportionally (i.e., by the sameamount in both the horizontal and vertical directions) by selecting ScaleProportionally. When an object is being scaled proportionally, only the "Hor-izontal" value needs to be entered.
Clicking the Object Pull-Down Menu and selecting Rotate displays theRotate window, as shown in Figure 5-22:.
Figure 5-22: "Rotate" window
An object(s) is rotated by either moving the scale bar or by entering a dou-ble value. A negative value rotates the object clockwise. To rotate theobject counterclockwise, select Rotate Counterclockwise.
NOTE: When a positive value is entered, Rotate Counterclockwise isautomatically enabled.
SL-GMS Draw User’s Guide 5-34Version 6.2a- 26 May 2006
Menus
Dynamics Pull-Down Menu
The Dynamics Pull-Down Menu is used to enter, edit, list, rename vari-ables, and test the dynamic descriptions of objects. A detailed descriptionof each of these tasks is provided in the following table. The first twooptions listed in the table work with one object at a time. If multiple objectsare on the Select List, use the Loop Control icons in the Main Menu bar(refer to page 1-8) to move among the objects on the Select List.
"Dynamics" Pull-Down Menu Options
Option Description
Object Dynamic Properties
Displays the Object Dynamic Properties window which contains a text edit box in which to create and change dynamic descriptions for an object. Edit the dynamics of the currently selected object, then click Apply in the Object Dynamic Properties window. Refer to Editing Dynamics on page 4-5 for more information.
Object Renamed Variables
Displays the Object Renamed Variables window to rename variables associated with the Instances of SubModels on the Select List. As each variable of the currently selected object is edited, click Apply in the Object Renamed Variables window. Refer to Rename Vars Tool on page 4-9 for more information.
Preview Options Displays the Preview Options window to preview the dynamic descriptions of objects in the current Model. Refer to Previewing the Dynamic Behavior of Objects on page 4-12 for more information.
Edit Data File Displays the Edit Data File window to edit the ".dat" file that exercises the DynProps in a Model using the Preview Options option. Refer to Previewing the Dynamic Behavior of Objects on page 4-12 for more information.
SL-GMS Draw User’s Guide 5-35Version 6.2a- 26 May 2006
Menus
Options Pull-Down Menu
The Options Pull-Down Menu provides the means to set SL-GMSDrawinterface preferences, as well as (re)display all the initial drawing tools win-dows that are displayed automatically when SL-GMSDraw is first invoked.
Figure 5-23: Options menu structure
Selecting the Tools option displays the submenu shown in Figure 5-23:.
"Options" Pull-Down Menu Options
Option Description
Tools Displays the Tools submenu which contains options for invoking windows. More information about Create Tools, View Tools, and Change Tools panels is provided in Chapter 2 — Tools.
Grid Options ... Displays the Grid Options window containing options used to create a grid. Drawn before the Model is created, the grid, like graph paper, aids in the designing of a Model. Refer to Grid Options on page 5-38.
Snap and Point Modes
Displays the Snap and Point Modes window which contains buttons for selecting the snap and point modes. Refer to Snap and Point Modes dialog on page 5-39 for more information.
Tools submenu
Options Pull-Down Menu
(Windows)
Tools submenu(Motif)
SL-GMS Draw User’s Guide 5-36Version 6.2a- 26 May 2006
Menus
User Preferences ...
Displays the User Preferences window used to set preferences for various items which change the nature of the Model and its display. Refer to User Preferences window on page 5-41.
Save Resources Saves the SL-GMSDraw settings in the resource file “.gmsdrawrc”. This file is saved in the following directory:1
32-bit WindowsIf the environment variable %HOME% is defined:
%HOME%else,
%gms_home%\lib
UNIXuser’s HOME directory
Any existing ".gmsdrawrc" file is moved to ".gmsdrawrc0", and any previous ".gmsdrawrc0" file is overwritten.
Refer to Saving the Editor Set-up on page 6-4 for more information.
Tool Tips(Windows only)
Enables/disables Tool Tips for Tool icons.
1. At runtime, the Windows version of SL-GMSDraw initially searches for the ".gmsdrawrc" file in %HOME%, if the environment variable %HOME% is defined. If a ".gmsdrawrc" file is not found or if the environment variable %HOME% is not defined, SL-GMSDraw will search the current directory and, finally, the directory %gms_home%\lib.
At runtime, the Motif version of SL-GMSDraw initially searches for the ".gmsdrawrc" file in the current directory, then in the HOME directory and, finally, in the %GMS_HOME/lib directory.
"Options" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-37Version 6.2a- 26 May 2006
Menus
Grid Options windowSelecting Grid Options invokes the Grid Options window, as shown in Figure5-24:.
Figure 5-24: "Grid Options" window
The grid is used much as a piece of graph paper — as a guide in designing.The grid is either a set of horizontal and vertical lines or a set of dots atintersections. The grid is not an object in the current Model. The grid isdrawn on top of all SL-GMS graphical objects.3 The grid display can beturned ON or OFF and the distance between grid intersections can bechanged both horizontally and vertically.
Grid Options• Size — changes the size of the grid spacing. Use any positive
real number for the horizontal and vertical spacing between gridintersections; if only one number is entered, it is used for boththe horizontal and vertical spacing. The number representsActive Working View units; the default Active Working View is 72units wide by 54 units high, regardless of the size of the displayscreen or Workstation Window. The spacings can have different
3. The grid does not draw on top of Control Objects. This capability will be available in a future release.
Turn grid on/offSelect grid
Set space
Setgrid size
line style
Set gridcolor
Set grid
between gridpoints
offset points
SL-GMS Draw User’s Guide 5-38Version 6.2a- 26 May 2006
Menus
values, for example, 2.5 units by 4 units. The default grid spacingis 10 units by 10 units.
• Divisions — changes the count of the divisions or tick marks foreach single grid space: use any positive real number.
• Grid On — turns the display of the grid ON or OFF: the ActiveWorking View is cleared and the grid is either drawn or not drawnand the objects in the Model are drawn over the grid.
• Solid Lines — toggles between the two grid display styles —solid lines or dots — at the intersections.
• Offset — offsets the first grid intersection from the default. Bydefault, the first grid intersection is at the origin, the Point (0,0).
• Color — changes the color of the grid. To set the grid color, clickone of the colored boxes or enter the numeric color index in thetext entry box provided.
Snap and Point Modes dialogSelecting Snap and Point Modes displays the Snap and Point Modes window.The appropriate snap and point modes are selected by clicking the corre-sponding button. When To Grid is on, the next Point picked is placed at thenearest grid intersection. When To Gravity is on, clicking an object resultsin the predefined Point nearest to the mouse’s location to be selected. ThePoint Mode controls the Reference Point used to move, rotate, scale, ormirror objects. The buttons that appear in the Snap and Point Modes dialogcorrespond to the Point Selection Control icons located in the Main Menubar (refer to page 1-8).
SL-GMS Draw User’s Guide 5-39Version 6.2a- 26 May 2006
Menus
Figure 5-25: "Snap and Point Modes" window
SL-GMS Draw User’s Guide 5-40Version 6.2a- 26 May 2006
Menus
User Preferences windowThe User Preferences window, shown in Figure 5-26:, is brought up byselecting the User Preferences option of the Options Pull-Down Menu.
Figure 5-26: "User Preferences" window
The preference options are defined in the following table.
"User Preferences" Options
Option Description
Undo/Redo Stack Size
Sets the number of editing operations that SL-GMSDraw is able to undo.
Move Delay (ms.) Sets the delay (in milliseconds) between the time the mouse begins to move and when that motion is rendered on the screen.
Move Dist (pixels) Sets the distance (in pixels) that a Move operation must cover before that motion is rendered on the screen.
Keyboard Move Delta
Sets the distance (in pixels) that arrow keys move an object on the screen.
Pick Aperture Specifies the size of the mouse picking rectangle as a percentage of the screen width.
SL-GMS Draw User’s Guide 5-41Version 6.2a- 26 May 2006
Menus
Initial W.C. to Pixel Scale
Indirectly sets the initial size of subsequently created editor windows when entering a positive non-zero value. The value is used as the scaling factor between World Coordinates and pixels.
One World Coordinate in the editing window will be the given number of pixels on the screen. When used in conjunction with the size window to model option, users can map exactly between World Coordinates and pixels on the screen.
Size Window to Model
Controls the behavior of Active Working View windows when a Model is opened. If this control is on, SL-GMSDraw creates a new window and sizes it automatically when a new Model is opened.
If this control is off, SL-GMSDraw opens the new Model in the existing window (replacing any currently displayed Model) and sets the window dimensions to 72 x 54. If the Model falls outside of the range of 72 x 54, the window dimensions are set to 100 x 75 (for compatibility with Models built using SL-Draw2).
View Crop Mode(Crop or Scale)
Controls the behavior of Active Working View windows when the windows are resized. If this control is on, SL-GMSDraw crops (clips) the Model when the window is resized. If this control is off, SL-GMSDraw automatically scales the Model to fit in the resized window.
Create Single Objects
Controls the behavior of the Create Tools. If this control is on, SL-GMSDraw automatically switches to the Select Tool after an object is created. If this control is off, SL-GMSDraw leaves the current Create Tool enabled after an object is created, making it easy to create multiple objects of the same type.
"User Preferences" Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-42Version 6.2a- 26 May 2006
Menus
Drag Objects (Objects or Outline)
Controls the appearance of objects while they are being dragged using the mouse. If this control is on, SL-GMSDraw displays the entire object while it is being dragged. If this control is off, SL-GMSDraw displays only the extent rectangle of the object while it is being dragged. The latter setting improves display performance when complex objects are being dragged.
Blinking Selection Handles
Controls the appearance of the selection handles on selected objects. If this control is on, the selection handles blink. If this control is off, the selection handles remain static.
GMS Control Resize Flag
If this control is on, SL-GMS Control Objects resize when the window is resized. If this control is off, SL-GMS Control Objects will not resize when the window is resized.
"User Preferences" Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-43Version 6.2a- 26 May 2006
Menus
Palettes Pull-Down Menu
The Palettes Pull-Down Menu makes Palettes and SubModels availablewhile creating Models. Palettes are provided for the storage and placementof objects. A Palette is a Model; the Model is displayed in a window whenselected in the Available Palettes window.
When the Available Palettes option of the Palettes Pull-Down Menu isselected, the Available Palettes window, shown in Figure 5-27: (which allowsthe selection of a Palette), is displayed. Figure 5-28: on page 5-46 showsthe six Palettes that are currently available.
The default contents of the Available Palettes window are all of the Modelsin the "/PALETTES" directories found in these paths:
UNIX Systems<current directory><$GMS_HOME>/work/gmsrun/PALETTES
32-bit Window Systems<current directory>%$GMS_HOME%\work\gmsrun\PALETTES
SL-GMS Draw User’s Guide 5-44Version 6.2a- 26 May 2006
Menus
Figure 5-27: "Available Palettes" window
SL-GMS Draw User’s Guide 5-45Version 6.2a- 26 May 2006
Menus
Figure 5-28: Six Palettes available in SL-GMS
SL-GMS Draw User’s Guide 5-46Version 6.2a- 26 May 2006
Menus
Once the Palette is displayed in a window, you can select any object in thePalette Model by clicking it. Place a copy of the selected object into theworking Model by clicking the left mouse button once more in the workingModel. If the selected object from the Palette is a SubModel, the SubModelis automatically added to the External SubModel List.
NOTE: Local SubModels by definition are available only to the Model thatcontains them. Therefore, local SubModels must not be a part ofa Palette Model.
If the Available Palettes window becomes hidden, click the Available Palettesoption once again to pop it to the top.
SL-GMS Draw User’s Guide 5-47Version 6.2a- 26 May 2006
Menus
To create a Palette, set the directory to the PALETTES subdirectory of thecurrent working directory. Create a Model by instancing other externalSubModels or by creating objects using the Object Create Tools. Save theModel in the PALETTES subdirectory. The Palette is now available whencreating Models in the working directory.
"Palettes" Pull-Down Menu Options
Option Description
Available Palettes
Displays the Available Palettes window containing a list of palettes from which the user can select (see descriptions of available palettes, below.)
Available Submodels
Displays the Available Submodels window from which objects can be selected from the current directory and directories in the SL-GMS Library paths, and placed into the Active Working View. Local Models display first in the list.
Controls Displays the Control Objects Palette from which Button, Container, Text Field, Scale, Scrollbar, and Option Menu objects can be selected and placed into the Active Working View. See the SL-GMS® Control Objects Reference Manual for a description of Control Objects.
Buttons Contains a wider selection of predefined Button objects than those provided in the Control Objects Palette.
Containers Contains a wider selection of predefined Container objects than those provided in the Control Objects Palette.
Text Fields Contains a wider selection of predefined Text Field objects than those provided in the Control Objects Palette.
Scales Contains a wider selection of predefined Scale objects than those provided in the Control Objects Palette.
Scrollbars Contains a wider selection of predefined Scrollbar objects than those provided in the Control Objects Palette.
SL-GMS Draw User’s Guide 5-48Version 6.2a- 26 May 2006
Menus
Point Pull-Down Menu
Often, SL-GMSDraw requires a Reference Point for an object, Group, orselected set of objects and prompts you to select one. For example, allSL-GMSDraw operations using the Object Create Tools require a Refer-ence Point to complete the operation. In general, an SL-GMS object may ormay not have its own Reference Point assigned. If none is assigned, onecan be set using the Set Reference Point option of the Point Pull-DownMenu.4
4. Note that a Reference Point can also be set on an object using the SL-GMS function gmsRefPoint( ), described in Reference Point in the SL-GMS Function Reference.
"Point" Pull-Down Menu Options
Option Description
Show Reference Points
Toggles the display of the Reference Point on and off.
SL-GMS Draw User’s Guide 5-49Version 6.2a- 26 May 2006
Menus
Using the Point Pull-Down MenuThis section describes the Set Reference Point option for selecting Points tobe used with SL-GMSDraw. The Set Reference Point option allows the Ref-erence Point used when transforming an object to be changed.
Set Reference Point
Sets the Reference Point on an object. The Reference Point is used for the Copy, Move, Scale, or Rotate operations. If the Reference Point is changed for an object on the Select List, the Reference Points for all objects on the Select List are changed simultaneously.
The default Reference Point is the object’s center. For complex, irregular objects such as Polylines or Splines, the center is calculated by using the center of the extent Rectangle for the object.
When objects are scaled, the center is the only Reference Point whose use does not also result in a Move operation.
If a Reference Point is required for an operation and none exists on an object, SL-GMSDraw creates a temporary Operation Reference Point (see Point Pull-Down Menu on page 5-49 and the Reference Point definition in the SL-GMS Reference).
Clear Reference Points
Resets an object’s Reference Point to its default Reference Point — the center of its extent.
Enter Point Displays the Enter Point window. You can enter an SL-GMS Point by typing in two floating-point numbers (World Coordinates), separated by a space and clicking the Apply button.
"Point" Pull-Down Menu Options(continued)
Option Description
SL-GMS Draw User’s Guide 5-50Version 6.2a- 26 May 2006
Menus
The four transformation options in SL-GMSDraw are Rotate, Move, Mirror,and Scale. The Rotate, Move, and Scale transformation options work rela-tive to a Reference Point. (Mirror works relative to a Reference Line.)
In a Rotate operation, the purpose of the Reference Point is obvious: theobject is rotated around the Reference Point. The Reference Point is dis-played as a Marker, along with a Reference Line used to set the angle ofrotation. In a Move operation, the object is positioned relative to the Refer-ence Point, which is displayed as a Marker. In a Scale operation, the pur-pose of the Reference Point is less obvious. To scale an object, all Pointsdefining an object are multiplied by the scaling factors. If this multiplicationis done in reference to the origin, the Points are moved closer or fartherfrom the origin, and the object appears to have been both scaled andmoved. By picking a Reference Point in the object, the object is not dis-placed when the object is scaled. The Reference Point is displayed as aMarker, along with an extent Rectangle.
It is easy to visualize the center of a Circle, and even a Rectangle. But whatabout an irregular shape, such as a Closed Polyline? SL-GMS uses thecenter of the extent Rectangle for determining the center of an object. Anextent Rectangle, or simply extent, is the smallest Rectangle with a hori-zontal base that completely encloses all parts of an object. SL-GMS usesthe extent Rectangle for determining the center of objects and also forselecting objects. Thus, the center of any object is the center of its extentRectangle.
The Enter Point option allows you to enter an SL-GMS Point from the key-board. The Point is in WC-coordinates. The Point pair is entered by typingin two floating-point numbers, separated by a space and clicking the Applybutton.
Figure 5-29: "Enter Point" window
SL-GMS Draw User’s Guide 5-51Version 6.2a- 26 May 2006
Menus
Help Pull-Down Menu
The About Gmsdraw option (About GMSDraw in Motif) displays the AboutSL-GMSDRAW window, shown in Figure 5-30:. This window displays theconfiguration number (i.e., the version number) of SL-GMS.
Figure 5-30: The "About SL-GMSDRAW" window
SL-GMS Draw User’s Guide 5-52Version 6.2a- 26 May 2006
6
Version 6.2a- 26 M
Building Models
This chapter describes the process of using SL-GMSDraw to construct agraphical user interface for an application.
Invoking the SL-GMSDraw Editor
To invoke the SL-GMSDraw program, go to your working directory and typethe program name after the system prompt.
Command-line options
The following are valid command-line switches to the SL-GMSDraw pro-gram. Option key letters can be in either lower or upper case, as theSL-GMSDraw program makes no distinction between the two.
Platform Command
Motif gmsdraw_xm
32-bit Windows1
1. Refers to a platform with a 32-bitarchitecture running Mircrosoft Win-dows NT or Windows 95.
gmsdraw_mfc
Option Description
-f[msgfile] read State messages from a message file
SL-GMS Draw User’s Guide 6-1ay 2006
Building Models
Setting up the SL-GMSDraw Editor
Typing the command to invoke the SL-GMSDraw editor opens certain win-dows in default locations and with a default set of fonts, colors, and othersettings. This section explains how to modify some of the default aspects ofthe editor to meet your own preferences.
Click the Options Pull-Down Menu and select User Preferences to displaythe User Preferences window. The different options are described on page5-41. Set new preferences and click the Apply button to set the options forthis editing session. Refer to Saving the Editor Set-up on page 6-4 for infor-mation about how to save these preferences for subsequent editing ses-sions.
Figure 6-1: "User Preferences" window
-i<library_path> adds a directory path for finding SubModels; any Models that are in the <library_path> directory are listed in the Available Submodels window
-o
(Windows only)
causes a Command Prompt window to be opened (when the program starts up), so that startup text and error messages can be viewed
-u[n] set update rate to n
Option Description
SL-GMS Draw User’s Guide 6-2Version 6.2a- 26 May 2006
Building Models
You can change the appearance and behavior of the grid in the ActiveWorking View. Click the Options Pull-Down Menu and select Grid Options todisplay the Grid Options window. The size, color, and manner the grid isdrawn can all be modified (refer to Grid Options window on page 5-38).Click the Apply button to apply the changes to the grid. These changesapply only to the current editing session.
Figure 6-2: Setting grid parameters with the "Grid Options" window
Aspects of the Active Working View in which the Model is created can alsobe changed using the View Options window. Clicking the View Pull-DownMenu and selecting View Options brings up the View Options window,shown in Figure 6-3:.
Figure 6-3: "View Options" window
Turn grid on/offSelect grid
Set space
Setgrid size
line style
Set gridcolor
Set grid
between gridpoints
offset points
SL-GMS Draw User’s Guide 6-3Version 6.2a- 26 May 2006
Building Models
A description of the different options in the View Options window appears inthe section View Menu on page 5-21.
In addition, you can resize, move, open or close the various windows (e.g.,Default Graphic Properties, and so on).
Saving the Editor Set-upUser preference settings and window descriptions can be saved in a file.Click the Options Pull-Down Menu and select Save Resources to create the".gmsdrawrc" file in the following directory:
32-bit WindowsIf the environment variable %HOME% is defined:
%HOME%else,
%gms_home%\lib
UNIXuser’s HOME directory
Any existing ".gmsdrawrc" file is overwritten.
At runtime, the 32-bit Windows version of SL-GMSDraw looks for the".gmsdrawrc" file in the %HOME% directory if the environment variable%HOME% is defined. If the environment variable %HOME% is not defined,or if a ".gmsdrawrc" file has not been found, SL-GMSDraw looks in the cur-rent directory and, finally, in the %gms_home%\lib directory.
At runtime, the UNIX version of SL-GMSDraw looks for the ".gmsdrawrc"file first in the current directory, then in the HOME directory and, finally, inthe %GMS_HOME/lib directory.
Setting text font definitionsVarious Text attributes can be modified using the "Text" view in the DefaultGraphic Properties window. Select Properties from the Object Pull-DownMenu, then choose Graphic. Once the Default Graphic Properties windowappears, click the Text tab to display the "Text" view.
SL-GMS Draw User’s Guide 6-4Version 6.2a- 26 May 2006
Building Models
In SL-GMS, Text is defined according to:
• precision. Although most workstation types support onlyprecisions 0 and 1, SL-GMS supports precisions 0, 1, and 2.
• font index within that precision
• workstation class (if appropriate)
The thirteen fonts of the default precision, precision 0, used by SL-GMSmay be overridden by a "fontdef.dat" entry. The thirteen default fontsappear in the text font scrollbox as TrueType fonts on a Windows platformor when Raster is selected on a Motif platform.
Figure 6-4: "Text" view on Windows (top) and Motif (bottom)
SL-GMS reads only one "fontdef.dat" file, searching first in the currentdirectory and, finally, in the $GMS_HOME/lib directory. The $GMS_HOME/libdirectory contains a default "fontdef.dat" file which specifies four Hersheyfonts. The format of the "fontdef.dat" file and the fonts available for eachtype of workstation are described in the chapter Text in the SL-GMS Refer-ence.
SL-GMS Draw User’s Guide 6-5Version 6.2a- 26 May 2006
Building Models
Using the fontdef program (Windows only)The thirteen default fonts are coded into SL-GMS. Each of thedefault fonts has an index that is mapped into a font table. Thedefault fonts are indexed from 1 to 13, and are used even if thereis no "fontdef.dat" file. However, the "fontdef.dat" file may beused to replace the default fonts or to add additional fonts.
The fontdef program is provided with SL-GMS (Windows only) inthe work\fonts directory. The fontdef program enumerates allinstalled TrueType fonts on a given system. When the output isredirected to a file, it generates a font definition file that containsall available fonts.
To run the program, type:
fontdef [index starting_index]["fonts_to_be_ignored"..] >filename
starting_index = optional number specifying the firstindex to start the list. If none isspecified, then 14 is used as thedefault.
"fonts_to_be_ignored" = optional list of font familynames, separated with spaces, thatwill be excluded from the generatedoutput file. A font name thatcontains spaces must be enclosed bydouble quotes (e.g., "Arial Black")
For example, to generate a "fontdef.dat" file in the currentdirectory that will start with index 14 and will not include anyArial or Arial Black fonts, type the following:
fontdef index 14 Arial "Arial Black" > fontdef.dat
NOTE: The "fontdef.dat" file created above must be moved either to the$GMS_HOME\lib directory or the working directory for your
SL-GMS Draw User’s Guide 6-6Version 6.2a- 26 May 2006
Building Models
application. The maximum number of fonts allowed in the"fontdef.dat" file is 1,024.
One of the thirteen default fonts can be overridden by adding anentry for the desired font index to the "fontdef.dat" file.
Enabling Precision 0 (TrueType) font rotationSL-GMS provides the ability to enable or disable (the default) rotation forprecision 0 (TrueType) fonts on Windows systems. Rotation for precision 0(TrueType) fonts is enabled in SL-GMSDraw by sending the"tprec0_rot_flag to the StandardTopState in the ".gmsdrawrc" file as shownbelow:
gmsdraw_standard_top_state tprec0_rot_flag 1
The ".gmsdrawrc" file is edited before SL-GMSDraw is started. Refer toSaving the Editor Set-up on page 6-4 for information on the use of the".gmsdrawrc" file.
Localization of outputThe output of SL-GMSDraw is localized. Output from SL-GMSDraw goesthrough a localization function (refer to the section Internationalization —localization files in the SL-GMS Function Reference). The function looks fora string in the localization file "lib/gmsl10n.txt" using a key. If the key isfound, the localized string is used, otherwise the original default string isused.
The format of the file is a set of STRING_RESOURCE key, string pairsgrouped together by SECTION names. A sample of the "gmsl10n.txt file isshown below:
// GMS Localization (l10n) String file//SECTION Default
STRING_RESOURCE GMSL10N_00000 "Custom Property Window"STRING_RESOURCE GMSL10N_00001 "Custom Object Window"STRING_RESOURCE GMSL10N_00002 "Custom Property Window"STRING_RESOURCE GMSL10N_00003 "Custom Object Window"
SL-GMS Draw User’s Guide 6-7Version 6.2a- 26 May 2006
Building Models
SL-GMSDraw uses the SECTION named "Default" (except on JapaneseWindows NT where it uses the SECTION "Japanese"). A user can thuschange the SECTION to be used for localization by editing the localizationfile, renaming the SECTION they wish to use to "Default", and changing theprevious "Default" section to some other name.
Setting Color DefinitionsThe Default Graphic Properties window and the Grid Options windowcontain color boxes that allow you to set the color of an object or the grid.The colors that are displayed in the color boxes are defined in the file"colordef.dat". This file associates a color index with red, green, and bluevalues and an optional bitplane writemask. The format for an entry in the"colordef.dat" file is described in the chapter entitled Color in the SL-GMSReference.
During its startup sequence, SL-GMSDraw looks for a "colordef.dat" file inthe current working directory. If no "colordef.dat" file is found, SL-GMS-Draw uses its own default "colordef.dat" file located in the $GMS_HOME/libdirectory.
By default, the color panel displays 32 colors. If the "colordef.dat" file con-tains more than 32 entries, the additional colors will be displayed followingthe default colors. Use the scroll bar, displayed to the right of the color box-es, to display the additional colors or type the color index into the ColorIndex text entry box.
Figure 6-5: Color indexes in the "Default Graphic Properties" window
colors in "colordef.dat"
SL-GMS Draw User’s Guide 6-8Version 6.2a- 26 May 2006
Building Models
Laying Out a Model
There are two basic ways to build a Model. Some developers prefer to cre-ate the Model freestyle using the SL-GMSDraw editor. However, a simplermethod is to determine the information set you wish to display in the Modeland lay out the Model before it is actually built in the editor.
The SL-GMSDraw editor can display a grid while objects are being addedto the Model; this grid helps to ensure that the different objects are alignedcorrectly. A printout of a blank grid can be used as a template to manuallydraw the objects before actually building the Model in the editor.
To print a blank Model with a grid, verify that the grid is visible and set theappropriate size (refer to page 6-3). Click the File Pull-Down Menu andselect Print on Motif systems, or Print and then the PostScript option in thePrint submenu on Windows systems. The Print Dialog window will appear,as illustrated in Figure 6-6:.
Figure 6-6: "Print Dialog" window
Make sure that the Print Grid and Landscape options are ON. Enter theprinter name and any other necessary parameters. Click the Print button inthe Print Dialog window.
SelectPrint Grid
SelectLandscape
SL-GMS Draw User’s Guide 6-9Version 6.2a- 26 May 2006
Building Models
When you are laying out the different Models, note which objects you areusing repeatedly or for more than one Model. You can create SubModels (aModel instanced into another Model) with these objects and use themagain and again. Creating SubModels standardizes the appearance andbehavior of an object you use several times. Refer to the section UsingSubModels for Standardized Objects on page 6-14.
Building the Model
You can create Models from objects you construct, or by instancing ControlObjects, GISMOs1 and other SubModels (either user-defined or providedby SL-GMS). One of the advantages of Control Objects is that when theyare added to a Model, the objects are displayed as native controls. In aWindows system, a native control means a Windows control object. InUNIX, native control generally means X-based Motif widgets. The ControlObjects are described in the SL-GMS® Control Objects Reference Manual.
This section presents the types of tools and objects used to display differ-ent types of data and user interfaces.
1. GISMOs are SL-GMS-supplied objects that have input dynamics and optional display dynamics (changes to the appearance of the GISMO in response to changes in one or more application variables). The input dynamics specify actions to be performed whenever an input event occurs. The actions may be to call a function, highlight the object, and so on. The functions that are called can either be one of the SL-GMS supplied functions or a user-defined function. Refer to the chapter GISMOs in the SL-GMS Reference.
SL-GMS Draw User’s Guide 6-10Version 6.2a- 26 May 2006
Building Models
Setting Background Object and Model SizeClick the Model Pull-Down Menu and select Properties to display the ModelProperties window, as shown in Figure 6-7:.
Figure 6-7: Setting background object properties
When a blank Model is created using the the New with Background option ofthe File Pull-Down Menu, SL-GMSDraw automatically creates a non-detect-able Filled Rectangle as the background object in the background color.The size of the background object is set by changing the default values (72units wide and 54 units high) in the Model Properties window.
NOTE: The size of the Model is set to the size of the background object.
A blank Model can also be created using the New option of the FilePull-Down Menu. The first object created in the Model (typically a FilledRectangle) is considered the background object. When the first object iscreated in the Model, the Background Detectable and Background ObjectDimensions and Origin areas are enabled. The size of the backgroundobject can be changed by modifying the width and height values in theModel Properties window.
color
detecton/off
size
erasebehavior
SL-GMS Draw User’s Guide 6-11Version 6.2a- 26 May 2006
Building Models
By default, the lower left corner of the WC-window is defined as the Point0,0. To change the default, modify the text entry box designating the lowerleft corner of the dotted-line graphic.
The color of the background object is set by entering an integer in theBackground Color entry box that corresponds to one of the color boxes inthe Default Graphic Properties window.
In addition, setting Background Detectable to OFF (i.e.,unchecked), willcause the background object in the current Model to become undetectable.Setting Background Detectable to ON (i.e., checked) allows the backgroundobject to be selected and modified.
The erase behavior of objects in the Model can also be controlled with theErase in Background Color setting. Refer to page 3-27 for a further descrip-tion of the erase behavior of objects.
If you have set the size of the Model to a custom setting rather than thedefault size (72 x 54 units), refer to Step 2 - Set the Size of the Model onpage 6-39 for further information.
Attaching Dynamics to an ObjectIn SL-GMS, dynamic behavior is added to an object by attaching a Dyn-Prop (Dynamic Property). A DynProp consists of one or more dynamicdescriptions. The dynamic descriptions are written in a language recog-nized by SL-GMS that specifies a change in the appearance of an object inresponse to a change in an application variable, or an action to be taken inresponse to input events for the object. A sample DynProp is illustrated inFigure 6-8: on page 6-12.
Figure 6-8: A sample DynProp
tanklevel<90.0
fcolor noalarm
#call gms_flash( )
dynamic
dynamic
description
description
DynProp
When user selects objectcall the function gms_flash( )
If the value of the variable tanklevel
equals less than 90.0
set the fill color (fcolor) of theobject to the color indexgiven by the value of the variable noalarm
SL-GMS Draw User’s Guide 6-12Version 6.2a- 26 May 2006
Building Models
Dynamic descriptions are further described in the section Dynamic Descrip-tions on page 4-2. The chapter Dynamics in the SL-GMS Reference dis-cusses the general syntax for the dynamic descriptions and the differenttypes of dynamic actions (changes in appearance of an object), such asscale, fill, and position, that are available. The chapter Dynamics Referencein the SL-GMS Quick Reference contains several tables for use in con-structing DynProps.
To attach a DynProp to an object, select the object, click the DynamicsPull-Down Menu and select Object Dynamic Properties. This displays theObject Dynamic Properties window. Type the DynProp into the ObjectDynamic Properties window, as illustrated in Figure 6-9: on page 6-13.
Figure 6-9: A DynProp in the "Object Dynamic Properties" window
The section Editing Dynamics on page 4-5 describes how to type DynPropsinto the Object Dynamic Properties window.
#call gms_flash( )tanklevel<90.0fcolor noalarm
SL-GMS Draw User’s Guide 6-13Version 6.2a- 26 May 2006
Building Models
Renaming VariablesModels can be reused through instancing. Model Instances, also calledInstances or SubModels, retain the dynamic properties of the original Mod-el. The various Instances are differentiated from the original Model byrenaming variables — the driving variables are renamed to different vari-able names.
For example, three Instances of the Text Display Control Object are placedinto a Model. The Text Display Control Object displays the value of the labelparameter. The original copy of the Text Display Control Object Model wascreated with a dynamic description that displays the value of label. Howev-er, for each of the three Instances of the Text Display Control Object, thelabel parameter has been renamed to display the value of a different vari-able. The first Instance needs to display the value of the variable volts1,therefore, the label parameter is renamed to volts1. The second Instancehas label renamed to amps2, and the third Instance has label renamed tovolts3.
To rename variables, select an object, click the Dynamics Pull-Down Menuand choose Object Renamed Variables. The Object Renamed Variablesoption is described in the section Renaming Variables on page 4-9.
Using SubModels for Standardized Objects The advantage of using SubModels is that the object is created only onceand saved as a Model. Each of the Instances points to the original Model. Ifa change is made to the original Model, for instance, a meter Model, thenthat change is automatically reflected in all meter Instances. This standard-izes the appearance and dynamic behavior of objects.
SL-GMS provides a set of Models that are available for instancing. Theseinclude GISMOs, Graph Models, Control Objects, and others. However, youcan save any object, or group of objects, as a Model and instance it as aSubModel in other Models. An object (or group of objects) you create foruse as a SubModel should be created with its Reference Point at (0,0).When a SubModel is instanced, the location of the mouse cursor will corre-spond to the origin (0,0) of the original Model.
Similarly, create original Models you plan on using as SubModels with theexact size and orientation required in the Models in which they areinstanced. Scaling or rotating a SubModel Instance in a Model decreases
SL-GMS Draw User’s Guide 6-14Version 6.2a- 26 May 2006
Building Models
the performance of the Model. Refer to Building SubModels to Scale onpage 6-50 for further information.
If the Model you wish to use as a SubModel is created using the New withBackground option of the File Pull-Down Menu, then a non-detectable FilledRectangle is automatically created as the background object in the back-ground color. However, the size of the Model used as a SubModel shouldbe only as large as is needed to contain all the parts of the Model. There-fore, if needed, change the size of the Model using the Model Propertieswindow. (Click the Model Pull-Down Menu and select Properties.) Refer toStep 2 - Set the Size of the Model on page 6-39 for further information.
To instance a SubModel in a Model, click the Palettes Pull-Down Menu andselect Available Submodels. The Available Submodels window, shown inFigure 6-10:, is displayed. Scroll down the list of SubModels and click onthe name of the Model you wish to instance. The selected SubModel isplaced in the Active Working View by positioning the cursor in the desiredlocation and clicking the mouse.
Figure 6-10: "Available Submodels" window
SL-GMS Draw User’s Guide 6-15Version 6.2a- 26 May 2006
Building Models
Any Models you create for use as SubModels are placed in the SUBMODSsubdirectory of the working directory. Models placed in this directory2
appear in the Available Submodels window.
Displaying Strings, Integers, and Real ValuesThe different text tools display either string characters, integers, or real val-ues. Textual information can be either static or dynamic (changing). Statictext does not change. Examples include labels and non-dynamic numericvalues.
Dynamic text changes in response to changes in application variables.Examples include the integer or real value of a variable or a text string thatchanges (e.g., ON, OFF, INTERMEDIATE) with the value of a variable.
Static and dynamic text can be displayed by either using an Instance of theText Display Box or Text Display Control Objects or with an object createdwith the Text Rectangle Tool in the Create Tool panel. In addition, static textcan be created using the Text Tool in the Create Tool panel
2. Models placed in the working directory also appear in the Available Submodels window but it is good practice to create a SUBMODS subdirectory and place them there.
SL-GMS Draw User’s Guide 6-16Version 6.2a- 26 May 2006
Building Models
To place an Instance of the Text Display or Text Display Box ControlObjects into a Model, click the Palettes Pull-Down Menu and select TextFields. The Available Palettes window with the "c1_txtflds" palette willdisplay, as shown in Figure 6-11:.
Figure 6-11: "c1_txtflds" Palette
SL-GMS Draw User’s Guide 6-17Version 6.2a- 26 May 2006
Building Models
Text can be displayed either as a real number, integer number, or a textstring. Click the appropriate control object in the "c1_txtflds" palette, thenclick again in the Active Working View at the location in the Model wherethe text field is to be displayed, as shown in Figure 6-12:.
Figure 6-12: Instancing the Text Display Box Control Object
Select each Instance of the Text Display and Text Display Box Controlobjects in turn, renaming the variables listed in the table below. (Refer toRenaming Variables on page 4-9).
SL-GMS Draw User’s Guide 6-18Version 6.2a- 26 May 2006
Building Models
The Text Display Box displays the value of the display_expr parameter. TheText Display object displays the value of the label parameter. The maxcharsparameter sets the maximum number of characters displayed.
NOTE: The Text Display and Text Display Box Instances must be scaledto fit the maximum number of characters that are displayed.
Static text can be created by using either the Text Tool or the Text Rectan-gle Tool (used for text displayed within a rectangular frame) on the CreateTools panel.
For a Text Rectangle object to display dynamic text, dynamic descriptionsneed to be attached to the object. Refer to the section Attaching Dynamicsto an Object on page 6-12 for further information.
The part of a dynamic description required to add dynamic text to a TextRectangle object follows a regular format:
stext <argument> "format-string"
The stext keyword can be followed by a variable name or an expression,which may itself contain variable names. The format string is always sur-rounded by double quotes.
For example:
stext var1 "%s"
displays the value of the variable var1 as a string variable and:
stext var1 "%4.0f"
displays the value of the variable var1 as an integer (four characters withzero characters after the decimal point).
Parameters Related to Text
Control Object Parameter Name
Text Display label
Test Display Box display_exprmaxchars
SL-GMS Draw User’s Guide 6-19Version 6.2a- 26 May 2006
Building Models
NOTE: If the Text Rectangle object is used to display dynamic text onother Models, then create a Model with only the Text Rectangleobject and its associated dynamic descriptions. Create the TextRectangle with (0,0) as its Reference Point. This Model can thenbe instanced into other Models and the variables can be renamedusing the Object Renamed Variables window (refer to RenamingVariables on page 4-9). This standardizes the appearance anddynamic text display in the different Models.
Graphing Data SetsSL-GMS provides a variety of Graph types. Graphs are Models that areinstanced in other Models. First, instance the Graph, then rename the vari-ables which control scaling and labeling of the graph axes and graph tracesto constants or to other variables. You can also design your own graphModels. The chapter in the SL-GMS Reference and the chapter TheSL-GMS Graph Library in the SL-GMS Quick Reference describe the differ-ent types of graphs that are available, define the variables associated withthe graphs, and describe how the existing graph Models can be custom-ized.
SL-GMS Draw User’s Guide 6-20Version 6.2a- 26 May 2006
Building Models
To instance a Graph Model, click the Palettes Pull-Down Menu and selectAvailable Submodels. This will display the Available Submodels window,shown in Figure 6-13:.
Figure 6-13: "Available Submodels" window
Scroll down the list of SubModels and click on the name of the Graph Mod-el you wish to instance. The Graph Models provided by SL-GMS are foundin the scrolling list in the /demo/graphs/GRAPHS/ directory. Place a copy ofthe Graph Model in the Active Working View by clicking the mouse in thedesired location. Rename the variables of the Graph Instance by selectingthe Graph Instance, clicking the Dynamics Pull-Down Menu and selectingObject Renamed Variables. Refer to Renaming Variables on page 4-9 for fur-ther information.
Any Graph Model you create should be placed in the working directory or aGRAPHS subdirectory of the working directory. Graph Models placed ineither of these two directories will appear in the Available Submodels win-dow.
SL-GMS Draw User’s Guide 6-21Version 6.2a- 26 May 2006
Building Models
Displaying a bitmap on a buttonSome Control Objects contain a label that usually consists of a formattedstring describing the purpose of the button. However, a bitmap can be dis-played on the button instead of a text string. As an example, the ObjectCreate Tool buttons display a bitmap indicating the type of object the buttoncreates.
For further information refer to the section General Considerations in theSL-GMS Control Objects Reference Manaul.
SL-GMS Draw User’s Guide 6-22Version 6.2a- 26 May 2006
Building Models
Creating a MenuYou can add a menu to a Model using the Option Menu Control Object. TheOption Menu button has an optional label that presents a pull-down menuwhen selected. Each entry may be one of three types:
• Pushbutton (appears as a string label)
• Cascade (appears as a string label with a right arrow indicatoraligned flush-right)
• Separator (appears as a horizontal separator line)
To place an Instance of an Option Menu into the Model, click the PalettesPull-Down Menu and select Controls. This brings up the Available Paletteswindow and displays the Controls Palette. Select the Option Menu control,as shown in Figure 6-14: on page 6-23.
Figure 6-14: Selecting the Option Menu Control
Click again in the Active Working View where the Option Menu button willappear in the Model.
Option MenuControl
SL-GMS Draw User’s Guide 6-23Version 6.2a- 26 May 2006
Building Models
The method used to define the menu entries is described in the sectionOption Menu in the SL-GMS Control Object Reference Manual.
Sending Messages to StatesUsers may interact with the application at run-time by selecting objects onthe screen that send messages to States. The messages can display a dia-log box, close or open a window, quit an application, and so on.
Two types of objects are used to send messages to a State: ControlObjects and GISMOs.
Control ObjectsThe easiest method to send messages to a State is to use one ofthe Control Objects. The interface to send a message to a Stateis already built into the Control Object.3 All you need to do isrename the appropriate variables (refer to the section RenamingVariables on page 4-9).
Each of the Control Objects, with the exception of the TextDisplay Box and the Text Display objects, can send a messageto a State. The Control Objects contain two parameters:msg_statename and msg_strmsg.
Rename msg_statename to the name of the State which willreceive the message. msg_strmsg is the message sent to thatState. The message that is sent to the State is a string thatcorresponds to the name of a method defined for that State.
If msg_statename is renamed to NULL (the default), then themessage is sent first to the current State. If the current Statedoes not contain a method with the same name as that of themessage string, then the State Management System passes themessage string up the State tree until a State is found with thatparticular method defined in it. For example, a Model isdisplayed using an Instance of the WinModState. The Model
3. Another advantage of Control Objects is that when they are added to a Model, the objects will display as native controls. In a Windows system, a native control means a Windows control object. In UNIX, native control generally means X-based Motif widgets. Control Objects are described in the SL-GMS® Control Objects Reference Manual.
SL-GMS Draw User’s Guide 6-24Version 6.2a- 26 May 2006
Building Models
contains a push button which has msg_statename renamed toNULL and msg_strmsg renamed to quit. When the push button isclicked, the "quit" message is sent to the WinModState Instance.This State does not contain a quit method, so the message ispassed up the State tree until a State is found that does have aquit method defined for it. The StandardTopState has a quitmethod defined, therefore, the StandardTopState executes thequit method to terminate the application.
Two other parameters are also used when sending messages toa State: value and value_valtype. Each method defined for aState receives three parameters when it is called: the State id,value, and a pointer.
For the example given above, the value and value_valtypeparameters were set to their default values because the quitmethod in the StandardTopState receives value but does notactually use it.
However, the value parameter is used by other State methods.One example is the new_model_window( ) method of theWinModState. For this example, a Push Button Control Object ona Model has the following renamed variables.
Messages and Values Sent by the Push Button
Renamed Variables
msg_statename1
1. Renaming the msg_statename variable to NULL indicates that themessage should be sent to the current State, which in this example is theWinModState Instance that is displaying the Model. Since NULL is thedefault value for msg_statename, it does not actually need to be re-named.
msg_strmsg value2
2. "\t" is the <TAB> separator between each message-value pair.
NULL "new_model_window"
"sibling +\twin_position 0.5 0.0"
SL-GMS Draw User’s Guide 6-25Version 6.2a- 26 May 2006
Building Models
This push button executes the new_model_window( ) method in the Win-ModState. The new_model_window( ) method uses the value string to getthe Model name, window position, and the Parent State name for a newInstance of the WinModState. The section Creating Windows and Manipulat-ing Models in the SL-GMS Examples Manual contains several examples ofvalue string usage.
GISMOsA developer can build a GISMO4 to send a message to a State.The input dynamics of the GISMO can contain a call to auser-defined function which contains the necessary functioncalls to send a message to a State. The section State ClassLibrary Interface in the SL-GMS State Class Library ReferenceManual and the chapter General Application Development in theSL-GMS Enhanced SMS User’s Guide describe the functionsused to interface with the SL-GMS State Class Library.
Description of the "value" String
Model name
Parent State1
(Super-State)
State name2
Window position Result
sibling + NULL 0.5 0.5 Window Model State is created under the Backplane State
1. A value of NULL is equivalent to "the State that receives the message";"+" is equivalent to "the direct parent State of the State that receives themessage." However, the NULL value does not need to be included in thevalue string, as it is the default.2. A value of NULL is equivalent to "system generated." However, theNULL value does not need to be included in the value string, as it is thedefault.
4. The chapter GISMOs in the SL-GMS Reference and SL-GMS GISMO Library in the SL-GMS Quick Reference describe how the GISMOs in the SL-GMS GISMO Library are created.
SL-GMS Draw User’s Guide 6-26Version 6.2a- 26 May 2006
Building Models
The user-defined function must be added to the applicationusing the gmsAddUserFctn( ) function. Adding a user-definedfunction to an application is described in the chapter Dynamicsin the SL-GMS Reference.
Sending data to the applicationThere are several ways to send data to the application by interacting withobjects on the screen.
Text Edit Box Control ObjectThe Text Edit Box is a rectangular area in which text can beentered or edited. The Text Edit Box can also display the value ofa parameter set by the application.
The Text Edit Box Control Object is found in the "c1_txtflds"palette window, shown in Figure 6-15:.
Figure 6-15: "c1_txtflds" Palette
Control Objects
Text Edit Box
Text List Box
Control Object
SL-GMS Draw User’s Guide 6-27Version 6.2a- 26 May 2006
Building Models
Text can be entered either as a real number, integer number, ora text string. Click the appropriate Text Edit Box Control object inthe "c1_txtflds" palette window, then click again in the ActiveWorking View at the location in the Model in which the text fieldis to be displayed.
The Text Edit Box contains two parameters: set_variable anddisplay_expr. Rename the set_variable parameter to theapplication variable whose value is set to the text you haveentered in the Text Edit Box. Rename the display_exprparameter to a variable whose value is set by the application anddisplayed in the Text Edit Box.
The section Text Edit Box in the SL-GMS Control ObjectReference Manual describes all of the parameters and theircorresponding data types for the Text Edit Box. Refer to thesection Renaming Variables on page 4-9 for information abouthow to rename the parameters in the Text Edit Box ControlObject.
Text List Box Control ObjectThe Text List Box presents a list of text string choices from whichselections can be made. If necessary, scroll bars are provided toallow you to view all available choices.
The Text List Box Control Object is found in the "c1_txtflds"palette window, as shown in Figure 6-15: on page 6-27. The TextList Box contains two parameters: set_variable and display_expr.Rename the set_variable parameter to the application variablewhose value is set to the text you have selected in the Text ListBox. Rename the display_expr parameter to a variable whosevalue is set by the application and is in the list of items displayedin the Text List Box. In addition, several other parametersspecific to the Text List Box can be renamed, as shown in thefollowing table.
SL-GMS Draw User’s Guide 6-28Version 6.2a- 26 May 2006
Building Models
The section Text List Box in the SL-GMS Control ObjectReference Manual describes all of the parameters and theircorresponding data types for the Text List Box. Refer to thesection Renaming Variables on page 4-9 for information abouthow to rename the parameters in the Text List Box ControlObject.
Parameters Related to the Text List Box Behavior
Parameter Name Description
selected_index index value within the list of text items that is to be highlighted as "selected" when the list is displayed
select_type type of selection mechanism to be used by you
top_index index value of the Text List item to be displayed at the top of the scrolled list
SL-GMS Draw User’s Guide 6-29Version 6.2a- 26 May 2006
Building Models
Scale (Slider) Control ObjectA Scale displays and sets a numerical value from a definedrange. The Scale Control Object is found on the "c1_scales"palette window, as shown in Figure 6-16:.
Figure 6-16: "c1_scales" Palette
The Scale contains two parameters: set_variable anddisplay_expr. Rename the set_variable parameter to theapplication variable whose value you have set to the value of theScale indicator. Rename the display_expr parameter to avariable whose value is set by the application and determinesthe position of the Scale indicator and the value displayed.
In addition, several other parameters specific to the ScaleControl Object need to be renamed. An example of theRenamed Variables for an Instance of the Scale Control Objectis shown in the section Creating an SL-GMS Model dialog box onpage 6-38.
The section Scale (Slider) in the SL-GMS Control ObjectReference describes all of the parameters and theircorresponding data types for the Scale. Refer to the section
SL-GMS Draw User’s Guide 6-30Version 6.2a- 26 May 2006
Building Models
Renaming Variables on page 4-9 for information about how torename the parameters in the Scale Control Object.
GISMOsFour types of GISMOs can be used to send data back to anapplication: TEXTENTRY ARRAY, TEXTENTRY VAR, SLIDER,and SCROLLBOX. The chapter GISMOs in the SL-GMSReference and SL-GMS GISMO Library in the SL-GMS QuickReference describe the different GISMOs, the parameters torename, and their corresponding data types.
Dialog BoxA dialog box allows the values of different variables to be set. Adialog box can contain Text Edit Boxes, sliders, buttons, andother objects which allow you to set the value of differentvariables in an application. Further information is available in thesection Creating an SL-GMS Model dialog box on page 6-38.
UserData UserData is an arbitrary string that is attached to an object.When the object is selected at run time, the gmsQUserData( )function is used in the application to obtain the UserData stringof the object. The application can use the UserData string in anymanner. The section UserData Property Dialog on page 5-30describes how to attach the UserData string to an object.
UserWord A UserWord is an integer that is attached to an object. When theobject is selected at run time, the gmsQUserWord( ) function isused in the application to obtain the UserWord of the object. Theapplication can use the UserWord integer in any manner. Thesection UserWord Property Dialog on page 5-30 describes howto attach a UserWord to an object.
SL-GMS Draw User’s Guide 6-31Version 6.2a- 26 May 2006
Building Models
Switching Models using Control ObjectsThe easiest way to display a new Model is to send either a"new_model_window", "stack", or "replace" message to the Instance of theWinModState that is presently displaying a Model. A Button Control Objectfrom the "c1_buttons" palette window can be used to send the message.
Figure 6-17: "c1_buttons" Palette
The following tables illustrate the variables that are renamed in the Buttonobject to send a "new_model_window" message to the WinModState. Thisexample opens a new window which displays the sibling Model.
Messages and Values Sent by the Push Button
Renamed Variables
msg_statename1 msg_strmsg value2
NULL "new_model_window" "sibling +\twin_position 0.5 0.0"
SL-GMS Draw User’s Guide 6-32Version 6.2a- 26 May 2006
Building Models
Refer to Renaming Variables on page 4-9 for information about renamingvariables. The WinModState and its methods are discussed in theSL-GMS® State Class Library Reference. The section Creating Windowsand Manipulating Models in the SL-GMS Examples Manual provides usageexamples of the three methods.
Creating a Radio Button GroupThis section describes the steps to create a Radio Button group using aContainer Control Object as a parent. This behavior is consistent with Motifstandards.5 The general procedure requires any control that is to begrouped in a container to recognize the container as a “parent” container.This is accomplished by assigning certain rename variables to each radio
1. Renaming the msg_statename variable to NULL indicates that the mes-sage should be sent to the current State, which in this example is the WinMod-State Instance that is displaying the Model. Since NULL is the default valuefor msg_statename, it does not actually need to be renamed.2. "\t" is the <TAB> separator between each message-value pair
Description of the "value" String
Model name
Parent State1
(SuperState)
1. A value of NULL is equivalent to "the State that receives the message";"+" is equivalent to "the direct parent State of the State that receives the mes-sage." However, the NULL value does not need to be included in the valuestring, as it is the default.
State name2
2. A value of NULL is equivalent to "system generated." However, the NULLvalue does not need to be included in the value string, as it is the default.
Window position Result
sibling + NULL 0.5 0.5 Window Model State is created under the Backplane State
5. The process for creating a Radio Button group is the same in a Windows system but the concept of a "parent" container is not applicable.
SL-GMS Draw User’s Guide 6-33Version 6.2a- 26 May 2006
Building Models
button and to the container that groups them. Once this is done, the radiobuttons exhibit appropriate behavior automatically.
Step 1 - Place a Container Control Object
Figure 6-18: Containers Palette
To open the Containers Palette, click the Palettes Pull-DownMenu and select Containers. Click on the container labeled"Column" and create a copy of the Column Container by clickinga second time in the Main Editing Window.
SL-GMS Draw User’s Guide 6-34Version 6.2a- 26 May 2006
Building Models
Step 2 - Place Radio Button Control Objects
Figure 6-19: Buttons Palette
Open the Buttons Palette from the Palettes Pull-Down Menu andcopy three Radio Button Objects to the Active Working View.Enlarge the container so that it surrounds the radio buttons.
For a Motif platform, there is no need to space the Radio Buttonsevenly because Motif automatically arranges items groupedwithin a Container. Since the Column Container was used inStep 1, these Radio Buttons automatically arrange into a column(once the proper rename variables have been assigned to all ofthe Control Objects). Note that had a Row Container beenchosen in Step 1, Motif would have placed the Radio Buttonsinto a row.
SL-GMS Draw User’s Guide 6-35Version 6.2a- 26 May 2006
Building Models
The items are not automatically arranged into a row or columnon a Windows platform. The Radio Buttons must be aligned inthe Column container using SL-GMSDraw.
Step 3 - Assign Rename Variables
Figure 6-20: "Object Renamed Variables" window
SL-GMS Draw User’s Guide 6-36Version 6.2a- 26 May 2006
Building Models
1. Select all four control objects (the container and the threeradio buttons).
2. Click the Dynamics Pull-Down Menu and select ObjectRenamed Variables. The Object Renamed Variables window isdisplayed.
3. Step through the Select List using the Loop Control icons inthe Main Menu bar until the container object is selected. Itsvariables now appear in the Object Renamed Variables win-dow.
4. Assign a string value to the control_name variable. This valuewill correspond to the parent_name variable for each of thethree Radio Buttons. This example assigns the valuemy_container.
5. Click Apply to apply the change.
6. Step through the Select List using the Loop Control icons inthe Main Menu bar until one of the Radio Button objects isselected. Its variables now appear in the Object RenamedVariables window.
7. Assign my_container to the parent_name variable of theRadio Button.
8. Click Apply to apply the change. Repeat the last three stepsfor the remaining Radio Buttons.
SL-GMS Draw User’s Guide 6-37Version 6.2a- 26 May 2006
Building Models
Creating an SL-GMS Model dialog boxThis section describes how to create an SL-GMS Model for use as a dialogbox. Several examples of applications using dialog boxes are described inthe chapter Advanced Use of Dialogs in the SL-GMS Examples Manual.
The general procedure requires creating a Model then instancing ControlObjects and other SL-GMS objects that display information and allow youto edit the information (if required).
Figure 6-21: A dialog box example
There are two basic parts to a dialog box, as shown in Figure 6-21:. Thefirst part allows the values of different variables to be viewed and modified.The second part contains three buttons that send messages to the Dia-logState: to "apply" the value changes to the application variables; to"reset" the displayed values to what they were before any change wasmade; and to "cancel" (close) the dialog box. The physical arrangement ofthe values for display/edit and the buttons do not need to be the same asthose shown in Figure 6-21:.
Buttons for
Values forDisplay/edit
apply/reset/cancel
SL-GMS Draw User’s Guide 6-38Version 6.2a- 26 May 2006
Building Models
Step 1- Lay Out the User InterfaceDetermine the information that will be displayed/edited in thedialog box; different dialog boxes can display different sets ofdata. Once the information set has been determined, lay out thedialog box as it should appear and determine the types ofinteractions that will be used with this information. For each datavalue displayed, decide whether the dialog should haveread-only or read/write capability. Will the dialog be used fortyping in values, using a scale, or picking from a selection ofbuttons?
Step 2 - Set the Size of the ModelTypically a dialog box does not fill the entire screen. Therefore,the size of the dialog box Model needs to be set smaller thanthat of the default Model size of 72 x 54 WC-units. There are twomethods available to set the Model size smaller than the defaultsizze.
In the first method, the developer creates their own backgroundobject. Click the File Pull-Down Menu and select New. Create afilled object, typically a Filled Rectangle, as the first object in aModel.
NOTE: The first object in the Model list is the background object.
The background object must have the same dimensions asrequired for the Model because the size of the Model is set to thesize of the background object.
The second method uses the default background object. Clickthe File Pull-Down Menu and select New with Background. Ablank Model is displayed, and SL-GMSDraw automaticallycreates a non-detectable Filled Rectangle as the backgroundobject in the background color. Click the Model Pull-Down Menuand select Properties. This displays the Model Properties window,as shown in Figure 6-22: on page 6-40.
SL-GMS Draw User’s Guide 6-39Version 6.2a- 26 May 2006
Building Models
Figure 6-22: "Model Properties" window
The size of the background object is set by changing the defaultvalues (72 units wide and 54 units high) in the Model Propertieswindow.
NOTE: The size of the Model is set to the size of the background object.
Modify the Model width and height values (i.e., the backgroundobject width and height) shown in Figure 6-22:. If the backgroundcolor of the dialog box is to be different from that of the default,edit the default Background Color index and enter the new colorindex.
When all of the appropriate Model properties have been edited,6
click the Apply button in the Model Properties window. When theApply button is clicked, SL-GMSDraw displays a rectangleshowing the new Model width and height in the default Modelwindow. Figure 6-23: on page 6-41 illustrates a Model width andheight of 40 and 30, respectively. Only the top and right side ofthe rectangle are visible in Figure 6-23: on page 6-41 becausethe left bottom corner of the Model is set to (0,0). The dialog box
6. The section Setting Model Properties on page 3-26 describes the different Model properties in further detail.
backgroundcolor
width
height
SL-GMS Draw User’s Guide 6-40Version 6.2a- 26 May 2006
Building Models
information is built within this 40 x 30 area. Anything placedoutside this area is not displayed.
Figure 6-23: The Model width and height changed to 40 and 30
NOTE: Selecting the Apply as Default button instead of the Apply buttonapplies the background color, and on/off settings to allsubsequent Models built within the current editing session. Thebackground object dimensions are also applied to all subsequentModels built using the New with Background option of the FilePull-Down Menu within the current editing session.
There is an easy way to ensure that the dialog box Model contains all ofthe objects that it should. Click the Options Pull-Down Menu and selectUser Preferences. This displays the User Preferences window. Enable
40
30
SL-GMS Draw User’s Guide 6-41Version 6.2a- 26 May 2006
Building Models
the Size Window to Model option and click Apply. Next, save the Model,close the Model, and then reopen the Model. SL-GMSDraw redisplaysthe Model in a window sized to 40 x 30, without displaying the rest ofthe default area.
Figure 6-24: Model Edit Mode (New Window) selected
This mustbe turned on as shown
SL-GMS Draw User’s Guide 6-42Version 6.2a- 26 May 2006
Building Models
Step 3 - Place Objects in the ModelBased upon the layout of the dialog box and the user interface,place the appropriate objects in the Model. A variety of objectshave been used in this example for illustrative purposes.
The following description applies to the example shown in Figure6-25:.
Figure 6-25: A dialog box example
The above example uses the Text Tool in the Create Tools panelto create the text labels "Name", "Description", "% Open", "Alarm Setpoint", and "Open/Close Valve". Text
Push Button Control Objects
TextObjects
(read-only)
Text Display BoxControl Objects
(read-only)
Radio Buttongroup
(read/write)
Scale Control Objects(read/write)
SL-GMS Draw User’s Guide 6-43Version 6.2a- 26 May 2006
Building Models
Display Control Objects could also have been used. These areread-only.
Text Display Box Control Objects are used to display the value ofthe valve name and description variables. These are alsoread-only and the value is output as a string.
The Text Display Box Control Object is found in the "c1_txtflds"palette window, as shown in Figure 6-26:.
Figure 6-26: Selecting a Text Display Box Control Object
Click the Text Display Box that displays a "String" and place twoInstances into the Active Working View — one Instance to theright of the "Name" Text and one to the right of the "Description"Text. Rename the display_expr parameter for these twoInstances to the variable names set by the application. For thisexample, the parameters have been renamed, as shown in thefollowing table.
Select "String"
Text Display BoxControl Objects
SL-GMS Draw User’s Guide 6-44Version 6.2a- 26 May 2006
Building Models
Scale Control Objects are used to display the %open and alarmsetpoint values. These objects display the current value and alsoallow the value to be changed. Text Edit Box Control Objects canalso be used. To allow read/write capability, rename both theset_variable and display_expr parameters to applicationvariables. The display_expr parameter determines the position ofthe Scale indicator and the value displayed. When the scaleindicator is moved to change the value, the set_variable renamedvariable will set to the new value. (The value of the variable issent to the application when the Apply button is clicked.) If onlythe display_expr parameter is renamed to an applicationvariable, the scale indicator will be read-only.
For this example, the display_expr and set_variable parametersare renamed, as shown below.
In addition, several other parameters specific to the ScaleControl Object need to be renamed.
Text Display Box
Renamed Variables
display_expr maxchars
Name "ValveName" 20
Description "ValveDesc" 40
Scale ObjectRenamed Variables
display_expr set_variable
% Open "ValvePctopen" "ValvePctopen"
Alarm Setpoint "ValveSetpt" "ValveSetpt"
SL-GMS Draw User’s Guide 6-45Version 6.2a- 26 May 2006
Building Models
The following table shows the additional parameters specific to ascale and their corresponding Renamed Variable that is used toproduce the scales shown in Figure 6-25: on page 6-43.
The section Scale (Slider) in the SL-GMS Control ObjectReference provides a further discussion of these parameters, aswell as their data types.
A Radio Button group is created to allow the valve to be openedand closed through this dialog box. Again, since the currentstate of the valve (open or closed) can be viewed and the statecan be changed, the set_variable and display_expr parametersare renamed to application variables. The section Creating aRadio Button Group on page 6-33 provides further information.
Parameters Related to the Scale Behavior
Parameter Name Description
min_value Minimum value of the Scale
max_value Maximum value of the Scale
decimal_point Number of places to the right of the decimal point
jump_value Fraction of the range (by default 1/10 of range)
numticks Number of tick marks
orientation1
1. The orientation variable is already renamed (i.e., you do not needto rename it) for all Scale objects on the "c1_scales" Palette.
Vertical or horizontal with minimum and maximum at either end
Renamed Variables for the Two Scale Instances
decimal_point jump_value max_value min_value numticks
0 1 100 0 5
SL-GMS Draw User’s Guide 6-46Version 6.2a- 26 May 2006
Building Models
Three "Integer" Push Button Control Objects from the"c1_buttons" palette window are used to send the "apply," "reset,"and "cancel" messages to the DialogState. The "Integer" PushButton Control Object is used because it passes the valueparameter as an integer, and the value parameter is an integerdata type in the apply( ), reset( ), and cancel( ) methods of theDialogState. The SL-GMS® State Class Library Referenceprovides further information.
Figure 6-27: Select button to send "value" as an integer
The following table shows the renamed variables for the threebuttons.
Sends the"value" parameteras an integer
SL-GMS Draw User’s Guide 6-47Version 6.2a- 26 May 2006
Building Models
Messages and Values Sent by the Push Buttons
Button
Renamed Variables
msg_statename1
1. Renaming the msg_statename variable to NULL indicates that themessage should be sent to the current State, which in this example isthe WinModState that is displaying the dialog box Model. However,since the WinModState does not contain an apply, reset, or cancelmethod, the message will be passed up to the DialogState which doescontain these methods. Since NULL is the default value formsg_statename, it does not actually need to be renamed.
msg_strmsg value
Apply NULL "apply" NULL
Reset NULL "reset" NULL
Cancel NULL "cancel" NULL
SL-GMS Draw User’s Guide 6-48Version 6.2a- 26 May 2006
Building Models
Optimizing Loading and Displaying a Model
This section describes the best ways to optimize the performance of Mod-els.
Apply TransformationsEach time an object is moved, rotated, or scaled in the Model, a transfor-mation object is attached to the object. The following example shows theportion of the ".g" file for a polygon object that has been moved and scaled.
poly \11.1 65.9 9.29 53.8 21.7 52.7 \29.8 57.4 25. 63.0
. move 16.5 -48.9
. scale 16.5 -48.9 1.46 1.75
Each time this polygon is drawn on the screen, the system must computeeach of the transformations — one for the move and one for the scale.Selecting the Apply Transform option of the Object Pull-Down Menu com-bines transformations accumulated during editing and applies them to thePoints defining graphical objects. This speeds up the display of objects andreduces the memory required to store them.
Here is the same polygon object after Apply Transform is done. The trans-formation objects for the move and scale operations have been applied tothe Points defining the polygon.
Apply Transformation has no effect in the following cases:
• Unequal scaling of Text, Text Rectangles, Circles, Pies, Sectors,and Three-point sectors
• Rotation of Rectangles
• SubModel Instances
transformationobject
poly \32.7 66.9 30.0 45.7 48.2 43.8 \60.0 52.0 53.0 61.8
SL-GMS Draw User’s Guide 6-49Version 6.2a- 26 May 2006
Building Models
If these types of objects must be moved, rotated, or scaled in a Model, tryto construct the object so that the Apply Transform operation can be used.For example, if a rectangle is to be rotated, create the rectangle as aclosed polygon with four points rather than using the Rectangle Tool.
Building SubModels to ScaleSubModels should be created with the exact size and orientation requiredin the Model into which they will be instanced. Significant performanceimprovement can be achieved because the top-level Model (the Model intowhich the SubModel has been instanced) avoids the application of scalingand rotation transformations on its SubModels. (Remember that the ApplyTransform operation does not work on SubModels.)
Since SubModels are instanced many times in various top-level Models, avery large increase in performance is achieved by concentrating effort onoptimizing the performance of SubModels.
Creating Filled Objects without an edgeFilled objects that do not require their edge color to change at run time canhave their edge style set to 0 (none). Not drawing the edge increases per-formance in the drawing of a filled object by eliminating the step required todraw the outline of the object. Refer to Edge color, style, and width on page3-9 for information about setting an object’s edge style to 0.
The M2 FilerTo achieve maximum possible screen-load performance of a top-level Mod-el at run time,7 the M2 filer is provided. The M2 filer provides a set of func-tions to load and save Models in the ".m2" or contiguous filer format.
In ".m1" files, the format of the information stored is independent of theinternal memory representation of the data at runtime. Each graphical ele-ment is stored as a separate entity; therefore, SL-GMS must parse andreconstruct the elements as the file is read into memory.
The ".m2" format, on the other hand, contains an exact memory image ofthe Model object. Using the M2 filer, the entire Model can be loaded withone quick read, without having to parse and reconnect it, as with the nor-mal ".m1" filer.
7. Currently SL-GMSDraw operates only on ".m1" files.
SL-GMS Draw User’s Guide 6-50Version 6.2a- 26 May 2006
Building Models
Two utilities convert files to the ".m2" format: gm2 and m1m2.
The gm2 utility converts ".g" files to ".m2" files.
gm2 <modelname>.g
The m1m2 utility converts ".m1" files to ".m2" files.
m1m2 <modelname>.m1
If there is a change to the ".g" or ".m1" version of a Model, the ".m2" for-matted file must be recreated using the appropriate utility.
By default, the State Management System first searches for "<model-name>.m2", followed by "<modelname>.m1".8
It is a good practice to free ".m2" Models when they are no longer needed,to make the best use of time and memory.
8. Model search behavior for a given State can be changed using the gmsStM2Flag( ) function, described in the section State — miscellaneous in the SL-GMS Function Reference Manual.
SL-GMS Draw User’s Guide 6-51Version 6.2a- 26 May 2006
Building Models
Testing a Model
Using PreviewSL-GMSDraw is able to preview the dynamic behavior of a Model by apply-ing data from a file to the objects in the Model. The data specification file(".dat") is created with the same name as that of the Model, along with thesuffix ".dat". (For example, if the Model is named "demo1.m1", the ".dat"file will be named "demo1.dat").
To create or edit a ".dat" file during a session, the Edit Data File windowmust be invoked. This is done by clicking the Dynamics Pull-Down Menuand selecting the Edit Data File option. Text which creates or modifies the".dat" file can then be entered in this window. If a data file already exists forthis Model, that data file will automatically display in the Edit Data File win-dow. Clicking the Save File button will write the file to disk. Clicking theOpen File button will display a dialog window which allows entry of thename of a data file.
Figure 6-28: "Edit Data File " window
A ".dat" file contains variable name and value pairs, separated by a space,one pair per line.
volts1 120
SL-GMS Draw User’s Guide 6-52Version 6.2a- 26 May 2006
Building Models
The preview facility also recognizes other keywords in data files. The key-words can be used to automatically generate trigonometric, incremental, orrandom values for dynamic variables. The data format for a ".dat" file isspecified in the chapter Dynamics Reference in the SL-GMS Quick Refer-ence.
The Model must be saved if it has been edited before the dynamics can beexercised. In addition, while the Model is being previewed, it cannot beedited or saved. After previewing, the Model is automatically reloaded sothat any changes made by the dynamic updating are discarded.
To preview the current Model, click the Dynamics Pull-Down Menu andselect Preview Options. This will display the Preview Options window, shownin Figure 6-29:.
Figure 6-29: "Preview Options" window
Adjust the timer period (the time, in milliseconds, between dynamicupdates) using the scale indicator. Click the Start button to load the "<mod-elname>.dat" file9 and begin previewing the Model. Click the Stop button toterminate the preview and reload the Model. Clicking the Pause button willsuspend dynamic updating without leaving Preview Mode but the Modelcannot be edited or saved.
NOTE: If another Model is opened while a Model is being previewed, thenewly-opened Model will begin previewing automatically.
9. If a "<modelname>.dat" file does not exist, a warning message will display and previewing will not occur.
SL-GMS Draw User’s Guide 6-53Version 6.2a- 26 May 2006
Building Models
Using SL-GMSRunSL-GMSRun is useful for testing user-developed Models, including the dis-play of object dynamics. SL-GMSRun is particularly useful for prototypingscreens in the early stages of system development when the critical deci-sions are being made about the user interface.
Without any programming, SL-GMSRun can be invoked with different com-mand line options to:
• preview a Model
• select a Model at run time and preview
• preview a Model and utilize zoom and pan capabilities
• preview dynamic update for a Model using a "<modelname>.dat"file
• generate a PostScript file of a Model
• use a command file to generate a State tree
• access all of the above capabilities via a control panel
The SL-GMS® Enhanced State Management provides a description of thefeatures of the SL-GMSRun utility.
SL-GMS Draw User’s Guide 6-54Version 6.2a- 26 May 2006
A
Version 6.2a- 26 M
Using Active X Controls
gmsdraw_mfc is the version of SL-GMSDraw which runs on 32-bit Win-dows platforms. It uses the Microsoft Foundation Classes (MFC).
Inserting Active X ControlsTo insert an Active X control in a Model, click the Edit Pull-Down Menu andselect Insert Active X Control, as shown in the Figure A-1:. The InsertActive X Control dialog is displayed, as shown in Figure A-2:.
Figure A-1: “Insert Active X Control” option selected
SL-GMS Draw User’s Guide A-1ay 2006
The Insert Active X Control dialog lists the controls available on yoursystem from which you can make your selection.
Figure A-2: “Insert Active X Control” dialog
Select the control to be inserted and select OK. When the control is select-ed, it can be moved or resized using the selection handles. The control isnot active at this point; it can be activated by testing the Model using thePreview feature (refer to Testing a Model on page 6-52).
Editing Active X ControlsOnce inserted into a Model, controls can be treated the same as otherobjects in the Model. When selected, a selection extent is displayed withhandles for moving and resizing. Controls can be cut or copied to the clip-board and pasted into the current Model or into another Model opened inthe same editing session. They can be duplicated with a Ctrl-drag opera-tion and they can be copied to the Scratch Palette and from there used inthe current Model or subsequent Models in the same editing session. Con-trols can also be selected and grouped along with other SL-GMS objects inthe Model. They can be used in SL-GMS SubModels.
SL-GMS Draw User’s Guide A-2Version 6.2a- 26 May 2006
Index
Symbols".dat" files................................4-12, 6-52viewing......................................... 5-5
".gmsdrawrc" file ................3-20, 6-4, 6-7".m1" files
about..........................................5-10number of objects in ..................5-11
"_SCRATCH_" Palette window........5-13"colordef.dat" file................................6-8"fontdef.dat" file..................................6-5
creating in Windows.....................6-6maximum number of fonts ........... 6-7
"gmsl10n.txt" file ................................6-7
Aaction keyword, definition .................. 4-2Active Working View........................5-21
raising window to front ...............5-21Active X control
editingbehavior in gmsdraw_mfc ......A-2
selecting.......................................A-1testing ..........................................A-2
Add Border button............................5-11Add Init Graphics button ..................5-12Align option ......................................5-13alignment of Text .............................3-15
default ........................................3-16All option ..........................................5-17animation
Polygon.............................3-31, 5-31Polyline .............................3-31, 5-31
Apply commandDialog Window...........................1-17
Apply Transform option....................5-26loading/display of Model
optimizing.............................6-49attributes, Text .................................3-14Available Palettes option ........5-44, 5-48
Available Palettes Window...............5-44Available Submodels option.............5-48
graphadding to Model....................6-21
Available Submodels windowexample......................................6-16graph
adding to Model....................6-21
BBack of All option .............................5-16background object
changing........................... 3-27, 6-12color of ............................. 3-27, 6-12detectability ...................... 3-27, 6-12in SubModel ...............................6-15setting size of Model ........ 6-11, 6-39
batcherase flag....................... 3-30, 5-31Blinking Selection Handles option....5-43Buttons Palette
displaying ....... 5-48, 6-32, 6-35, 6-47By Name option................................5-18By Properties option.........................5-18By Selection option ..........................5-16
C
c1_buttons Palette ........ 6-32, 6-35, 6-47c1_scales Palette .............................6-30c1_txtflds Palette.................... 6-27, 6-44
displaying Text ...........................6-17Cancel button ...................................5-12Center Mode ......................................1-9Change Directory option ....................5-4Circle Tool ..........................................2-3Clear Reference Point option ...........5-50Close command
Dialog Window ...........................1-17Close option .......................................5-4color
"colordef.dat" file ..........................6-8
SL-GMS Draw User’s Guide iVersion 6.2a- 26 May 2006
Index
definitionssetting .................................... 6-8grid.............................................5-39
Color Lines button............................5-12command line options........................ 6-1Complex Fill Group option ...............5-27configuration of SL-GMSDraw.........5-52constrain text ...................................3-19Containers option....................5-48, 6-34Containers Palette
displaying..........................5-48, 6-34control objects
adding to Modelexample ...............................6-17
advantage of ..............................6-10Button
renaming variables...............6-32Containers Palette .....................6-34displaying text ............................6-16Radio Button group
creating ................................6-33renaming variables
example ...............................6-18resizing ......................................5-43sending message to State
renaming variables...............6-24using to switch Models...............6-32
Controls option.................................5-48Controls Palette
displaying...................................5-48Copies field ......................................5-12Copy option......................................5-13Copy Tool ........................................2-12Create Single Objects option ...........5-42Create Tool panel ............................6-16Cut option ........................................5-13
D
data sets, graphing ..........................6-20data, sending to application .............6-27
default"colordef.dat" file ..........................6-8"fontdef.dat" file ............................6-5color definitions ............................6-8graphic properties ..... 3-9, 3-19, 3-21Model properties
settings....................... 3-31, 6-41Reference Point .........................5-50startup windows ...........................1-1Text font definitions ......................6-5
Default Graphic Properties window...3-3, 6-4
default mode for transformations .......1-9Delete option....................................5-13Detect Off option ..............................5-26Detect On option ..............................5-26dialog boxes.....................................1-17
creating with SL-GMS Model .....6-38sending data to application ........6-31
directory namesnon-printing characters ..............5-10
display_expr parameter. 6-28, 6-30, 6-44example......................................6-45
Divisions button................................5-39doublebuffer flag .................... 3-31, 5-31Double-clicking left mouse button ....2-18Drag Objects option .........................5-43dynamic descriptions
definition.......................................4-2Dynamic Properties......................4-2example.............................. 4-2, 6-12stext keyword
example................................6-19dynamic expression
definition.......................................4-2Dynamic Property Window
example......................................6-13dynamics
adding to object................ 5-35, 6-12previewing ..................................5-35
SL-GMS Draw User’s Guide iiVersion 6.2a- 26 May 2006
Index
editing data file.....................5-35Dynamics Pull-Down Menu....5-35, 6-37, 6-53adding dynamics to object .........6-13renaming variables ....................6-14
dynamics, previewing ......................6-52dynarray flag ...........................3-31, 5-31DynProp...........................................6-12
specifying in SL-GMSDraw..........4-2
E
edge (Line) style ................................3-9no edge
optimize display of Model.....6-50valid style numbers ....................3-10
Edge graphic properties.....................3-9Edit Data File option ........................5-35
example .....................................6-52Edit Data File window .............4-12, 6-52Edit Pull-Down Menu ..............5-13, 5-16editor set-up, saving .......................... 6-4efficiency in SL-GMS ..............3-10, 5-26
Text.............................................. 2-6estyle attribute ................................... 3-9
valid parameters ........................3-10ewidth attribute ..................................3-9Exit option .......................................... 5-5Export option...............................5-4, 5-5expressions
in dynamic descriptions ............... 4-2extent, selection..........................1-9, 2-9
F-f command line option ...................... 6-1file names
length of ....................................... 5-5valid characters............................ 5-5
File Pull-Down Menu..........5-3, 6-9, 6-39fill
direction ....................................... 3-6
setting style and pattern ...............3-6Fill graphic properties.........................3-5Fill Group option..................... 5-25, 5-27Fill Group Submenu .........................5-27Filled Circle Tool ................................2-3Filled Closed Spline Tool ...................2-2Filled Polygon Tool.............................2-3Filled Rectangle Tool .........................2-3Fit Width setting ...............................3-19Flags option............................ 5-28, 5-30font definitions ....................................6-5
maximum number ........................6-7font index, of Text...............................6-5fontdef program (Windows)................6-6Front of All option .............................5-16fstyle attribute.....................................3-8
GGISMOs
definition.....................................6-10sending data to application ........6-31sending State message..............6-26
GMS Control Resize Flag option......5-43
gmsAgmsAddUserFctn( ) ..........................6-27
gmsDgmsdraw_mfc............................. 6-1, A-1gmsdraw_xm......................................6-1
gmsL
gmsl10n.txt.........................................6-7
gmsZ
Grabber Tool ....................................2-13Graphic option..................................5-28
"Text" view, displaying .................6-4graphing data sets............................6-20Graphs
SL-GMS Draw User’s Guide iiiVersion 6.2a- 26 May 2006
Index
adding to Model .........................6-20renaming variables ....................6-21gridcolor ...........................................5-39definition ....................................5-38divisions .....................................5-39offset ..........................................5-39preferences
setting up ............................... 6-3size ............................................5-38
valid entry.............................5-38styles..........................................5-39turning on/off ..............................5-39use for Model design ................... 6-9
Grid On button .................................5-39Grid Options option...................5-36, 6-3Grid Options window........................5-38Grid Size checkbox..........................5-38Group
create.........................................5-24definition ....................................5-24destroy .......................................5-24saving properties .......................5-25single object...............................5-24
Group option ....................................5-25
HHelp Pull-Down Menu......................5-52Horizontal option..............................5-17
I-i command line option.......................6-1Import option...................................... 5-4
Import Image................................5-6Information option............................5-28Initial W.C. to Pixel Scale option......5-42Insert Active X Control
option ...........................................A-1Insert Active X Control dialog ............A-1Insert Active X Control option ..........5-14
Insert Object dialogembedded client item
creating.................................3-31Invert option .....................................5-17
K
Keyboard Move Delta option............5-41
LLandscape mode..............................5-12Line
appearance ................................3-11Tool ..............................................2-2valid style number ......................3-10
Mm1m2 utility ......................................6-51M2 filer
optimize load/display of Model ...6-50Marker
changing style and color ............3-21Marker graphic properties ................3-21Marker Tool ........................................2-6maximum number of fonts..................6-7menu functions by right
mouse button .............................2-18Menus
Dynamics ...................................5-35Edit .............................................5-13File ...............................................5-3Help............................................5-52Model .........................................5-23Object.........................................5-24Options.......................................5-36Palettes ......................................5-44Point ...........................................5-49View ...........................................5-21
Merge option ......................................5-4Mirror option .....................................5-13Mirror Submenu .................................5-4
SL-GMS Draw User’s Guide ivVersion 6.2a- 26 May 2006
Index
Model Dynamic Properties window..3-30Model Flags window ........................3-30Model Properties window........3-26, 3-29background object .....................6-11description .................................3-26Model size, setting ............6-11, 6-40
Model Pull-Down Menu...........5-23, 6-39Model size, setting .....................6-11
Model UserData window..................3-28Model UserWord window.................3-29Model(s)
adding menu ..............................6-23background object
changing .....................3-27, 6-12detectability .................3-27, 6-12
colorbackground .................3-27, 6-12
control objects, using to switch ..6-32default size.................................6-12files
binary ...................................5-10name length ........................... 5-5opening ................................5-10valid names............................ 5-5
gridlaying out on........................... 6-9
loading/displayoptimizing....................5-31, 6-49
M2 filer .......................................6-50merging......................................5-10object(s)
displaying list of....................5-27maximum number of ............5-11
opening ......................................5-10parts, changing order of.............5-16Points, selecting.........................5-50properties, setting ....3-26, 3-31, 5-23saving .................................5-4, 5-10
as ".m1" file ..........................5-10valid names............................ 5-5
size, setting .... 3-26, 6-11, 6-15, 6-39testing
with Preview .........................6-52with SL-GMSRun..................6-54
UserData string ..........................3-28valid names ..................................5-5
mousedisplay windows
by double-clicking...........2-18move delay.................................5-41move distance ............................5-41right button context menus.........2-18
Move Delay option ...........................5-41Move Dist option ..............................5-41Move option......................................5-26Move window ...................................5-33Move X field .....................................5-12Move Y field .....................................5-12msg_statename parameter ..............6-24msg_strmsg parameter ....................6-24mstyle attribute.................................3-21
N
Name option.....................................5-28New option ............................... 5-4, 6-39New with Background option... 5-4, 6-11,
6-39new_model_window message .........6-32new_model_window method............6-25noerase flag ........................... 3-30, 5-31non-printing letters
in directory names......................5-10
O-o command line option......................6-2Object Dynamic Properties option.....4-5,
5-35, 6-13Object Dynamic Properties window ...4-5Object Flags window........................5-30Object Information window
SL-GMS Draw User’s Guide vVersion 6.2a- 26 May 2006
Index
display by double-clicking ..........2-18Object List option .............................5-27Object Name window..............3-23, 5-29Object Pull-Down Menu ...5-24, 6-4, 6-49Object Renamed Variables option .... 4-9,
5-35, 6-14example .....................................6-37
Object Renamed Variables window...4-9display by double-clicking ..........2-18
Object Userdata window.........3-24, 5-30Object Userword window........3-25, 5-30object(s)
appearance while dragging........5-43center of.....................................5-51control, resizing..........................5-43creating single/multiple ..............5-42delete Point................................2-11detectability, setting ...................5-26display list of, in current Model ..5-27dynamics
adding ..................................5-35editing .................................... 4-5
flags ..................................3-30, 5-31graphical, creating .......................2-1grouping.....................................5-24mirroring....................................... 5-4move Point.................................2-11moving ..............................5-26, 5-33
in back of all .........................5-16in front of all .........................5-16
naming ..............................3-23, 5-29order
changing, in part List............5-16in Model ...............................5-16
passinginteger to application............3-25string to application ..............3-24
propertiesdisplaying .............................5-28setting ..................................5-28
Reference Point .........................5-50renaming variables.......................4-9rotating ............................. 5-27, 5-34scaling ............ 2-10, 5-17, 5-27, 5-33select by properties ....................5-19selected objects, reordering .......5-16selecting .....................................5-17transformation of ........................2-10userdata .....................................3-24userword ....................................3-25visibility on/off.............................5-25
Offset button.....................................5-39Open .g File window...........................5-5Open .m1 File option..........................5-4Option Menu Control Object.............6-23Options Pull-Down Menu . 5-36, 6-2, 6-3,
6-41editor set-up
saving.....................................6-4Order option .....................................5-13Order Submenu................................5-16output
internationalization .......................6-7Output Orientation............................5-12
P
PaletteButtons .................... 6-32, 6-35, 6-47Containers........................ 5-48, 6-34Controls......................................5-48Scales .............................. 5-48, 6-30Scrollbars ...................................5-48Text Fields...... 5-48, 6-17, 6-27, 6-44
Palettes Pull-Down Menu5-44, 6-34, 6-35control objects ............................6-17graph
adding to Model....................6-21Option Menu, adding..................6-23
Pan...................................................2-13Pan percent, setting .........................5-22
SL-GMS Draw User’s Guide viVersion 6.2a- 26 May 2006
Index
Pan Tool ..........................................2-13paneltext alignment ...................3-15, 3-16part List, Model ................................5-16Paste option.....................................5-13Pick Aperture option ........................5-41Point
in objectdeleting ................................2-11moving .................................2-11
Reference Pointresetting to default ...............5-50selecting new point ..............5-50
Point Mode......................................... 1-9Point Pull-Down Menu .....................5-49Polygon Tool...................................... 2-3Polyline Tool ...................................... 2-2Portrait mode ...................................5-12PostScript option (Windows).............. 6-9precision, Text ................................... 6-5Preview Options option....................5-35
testingActive X controls ....................A-2Model ..........................4-12, 6-53
Preview Options window.........4-13, 6-53previewing, dynamics ......................6-52Print Background button ..................5-12Print button ......................................5-12Print Dialog window
model designtemplate for ............................ 6-9
optionsdescription of........................5-11
Print Grid button...............................5-12Print HiLite button ............................5-12Print option (Motif) ......................5-5, 6-9Print option (Windows).......................5-5Print to disk button ...........................5-12Printer Name field ............................5-11Properties option.....................5-25, 6-39
Properties Submenu ........................5-28pts relative flag ....................... 3-31, 5-31pts symmetric flag .................. 3-31, 5-31Push Button Control Object
example......................................6-47renaming variables
example................................6-47
Qquick keys ........................................2-17
RRadio Button group ..........................6-33Raise option .....................................5-21Rectangle Tool ...................................2-3Redo option......................................5-13Reference Mode.................................1-9Reference Point ...............................2-10
changing.....................................5-50default ........................................5-50resetting to default......................5-50setting on Select List ..................5-50showing ......................................5-49
Refresh option..................................5-21Remove Transform option................5-26repair flag .........................................5-32Reset option .....................................5-21Reset View Tool ...............................2-15Rotate field .......................................5-12Rotate option....................................5-27Rotate window..................................5-34rotating
precision 0 fonts .........................3-20TrueType fonts ...........................3-20
rotating precision 0 fonts ....................6-7
S
Same option .....................................5-17Save As option ...................................5-4Save option ........................................5-4
SL-GMS Draw User’s Guide viiVersion 6.2a- 26 May 2006
Index
Save Resources option....................5-37editor set-up, setting .................... 6-4Scale % field ....................................5-12Scale Control Object
example .....................................6-45renaming variables
example ...............................6-45sending data to application ........6-30
Scale option.....................................5-27Scale Relative option .......................5-14Scale window...................................5-33Scales option ...................................5-48Scales Palette
displaying..........................5-48, 6-30scaling objects .................................2-10
relative .......................................5-17Scratch Palette ................................5-13Scrollbars option ..............................5-48Scrollbars Palette
displaying...................................5-48Sector — Three Point Tool ................ 2-4Sector Tool ........................................ 2-4select
all objects...................................5-17all objects not on Select List ......5-17by name of object ......................5-18by property.................................5-18invert ..........................................5-17objects
alternative methods..............5-17by Extent Rectangle.............5-51
Reference Point .........................5-49Select by Extent icon ......................... 1-9Select by Properties window............5-19Select List
invert ..........................................5-17manipulation ..............................5-13mirror objects ............................... 5-4
Select option ....................................5-14selection extent...........................1-9, 2-9
selection handlesblinking .......................................5-43
sending data to applicationinteger ........................................6-31string ..........................................6-31
Set Reference Point option ..............5-50uses............................................2-10
set_variable parameter .......... 6-28, 6-30example......................................6-45
Setting Views ...................................2-16Show Reference Points option.........5-49single object create ..........................5-42Size Window to Model option. 5-42, 6-42SL-GMSDraw
command line options ..................6-1configuration...............................5-52default startup windows................1-1graphic editor ...............................2-1interface preferences
setting........................... 5-36, 6-2internationalized output ................6-7invoking ........................................6-1preferences and set-up
saving.....................................6-4purpose ........................................1-1quick keys ..................................2-17setting
color definitions ......................6-8Text font definitions ................6-4
setting up......................................6-2strings, integers, real
displaying .............................6-16version........................................5-52
SL-GMSRuntesting Models ............................6-54
Snap and Point Modes option..........5-36Snap and Point Modes window........5-39Solid Lines button.............................5-39Special Regroup option....................5-25Special Ungroup option....................5-25
SL-GMS Draw User’s Guide viiiVersion 6.2a- 26 May 2006
Index
Spline Tool......................................... 2-2StandardTopState............................6-25startup windows ................................. 1-1State messagessending ......................................6-24Status Window
displaying...................................5-21Status Window option ......................5-21stext keyword
dynamic description ...................6-19STRING_RESOURCE key ................ 6-7Style Number, line ...........................3-11styles of Line/Edge ..........................3-10SubModel(s)
background object .....................6-15building to scale .........................6-50placing into Model......................6-15Reference Point .........................6-14renaming variables .............4-9, 6-14selecting.....................................5-48setting size of.............................6-15
SUBMODS subdirectory ..................6-16
TText
alignment ...................................3-15default ..................................3-16
attributes ....................................3-14displaying
dynamic................................6-16static.....................................6-16
efficiency...................................... 2-6entry, of multiple lines .................. 2-7fit within text rectangle ...............3-19font index ..................................... 6-5object
attributes ................................2-8creation ..................................2-6lines in.................................... 2-7
precision ...................................... 6-5
Text Rectangle .............................2-7workstation class..........................6-5
Text Alignment Grid .........................3-15Text Display Box Control Object
example......................................6-44renaming variables.....................6-44
example................................6-18Text Display Control Object
renaming variablesexample................................6-18
Text Edit Box Control Objectsending data to application ........6-27
Text Fields option................... 5-48, 6-17Text Fields Palette
displaying ................ 5-48, 6-27, 6-44Text font definitions ............................6-5Text graphic properties ....................3-14Text List Box Control Object
sending data to application ........6-28Text option .......................................5-28Text Rectangle .................................3-19
clip text .......................................3-19Text Rectangle object
adding dynamics ........................6-19Text Rectangle Tool ................. 2-7, 6-16text rotation
enabling.............................. 3-20, 6-7Text Tool ............................................2-7To Scratch Palette option.................5-13Tool Tips option................................5-37Tools option......................................5-36transformation(s)
applying......................................5-26example................................6-49
options........................................5-51removing ....................................5-26
TrueType fontsenabling rotation................. 3-20, 6-7
SL-GMS Draw User’s Guide ixVersion 6.2a- 26 May 2006
Index
U-u command line option .....................6-2Undo option .....................................5-13Undo/Redo Stack Size option..........5-41UnGroup option ...............................5-25User Preferences option .........5-37, 6-41User Preferences window................5-41
setting size of Model ..................6-41UserData.................................3-24, 5-28
definition ....................................3-24length of .....................................3-24sending data to application ........6-31
UserWord.........................................5-28definition ....................................3-25sending data to application ........6-31
Vvalue parameter...............................6-25value_valtype parameter .................6-25Variable Reference
definition ...................................... 4-2variables
renaming...........................5-35, 6-14version
SL-GMSDraw.............................5-52Vertical option ..................................5-17View
optionssetting ...........................5-21, 6-3
presetsaving...................................5-22
resetting ............................2-15, 5-21set coordinates ..........................5-22Tools ..........................................2-13zooming ............................2-14, 2-15
View Crop Mode option ...................5-42View GML File option......................... 5-5View Options option........................... 6-3View Options window................5-21, 6-3
View Preset Tool ..............................2-16View Pull-Down Menu.............. 5-21, 6-3Visibility On/Off options ....................5-25
W
Wedge Tool........................................2-5window
Active Working View, raising......5-21Available Palettes.......................5-44Object Name ..............................3-23Object Userdata .........................3-24Object Userword ........................3-25startup ..........................................1-1
WinModState....................................6-24workstation class
Text ..............................................6-5
Zzoom
by extent.....................................2-14display zoom factor ....................5-22in continuous ..............................2-14in once........................................2-14out ..............................................2-15out continuous............................2-15resetting View.............................2-15set boundary percent .................5-22set limit .......................................5-22set percent .................................5-22
Zoom In Continuous Tool.................2-14Zoom In OnceTool ...........................2-14Zoom Out Continuous Tool ..............2-15Zoom Out Once Tool........................2-15Zoom Rect Tool................................2-14
SL-GMS Draw User’s Guide xVersion 6.2a- 26 May 2006