Professional Documents
Culture Documents
Update
U-ERM052102-1
1-800-293-PADT
(480) 813-4884 V
(480) 813 4807 F
Technologies, Inc.
Eric Miller
Matt Sutton
Date:
PADT
1: Introduction
Phoenix Analysis & Design Technologies (PADT) has been asked by ANSYS, Inc. to assist in the design
of the GUI and functionality of their upcoming AI*Environment tool. The foundation of this tool, ICEM
CFD Technology, is primarily oriented towards the CFD user and PADT will work to design an interface
the delivers considerable value to customers. The goal is to produce a tool that competes favorably with
PATRAN and FEMAP.
This document presents the initial specification for a new GUI development environment that is an
enhancement to existing Tcl/Tk environments. The proposed name is: techTk for technical Tk since it is
aimed at speeding the development of technical applications in general, and AI*Environment in particular.
This initial specification is for PADT, ICEM CFD and ANSYS internal use and review only.
2: Concept
Existing Tcl/Tk development tools are varied and powerful. As a way to create GUIs for cross platform
applications, it has few rivals. However, there are two significant drawbacks that PADT feels are
significant enough to warrant an addition to available technology in the area:
1. The Tcl language is just too verbose. A significant amount of code is required to define, place and
manage even a simple button. For small applications this is not an issue, but for a large application
with 100s of features, it cannot only slow the development process, but it can also make debugging
difficult.
2. The flexibility of Tcl/Tk and its existing add-ons allow a developer to create radically different
look and feel for a given application, or within a single application. This is a significant usability
issue and with so many different developers at ICEM CFD, it is very difficult to control.
PADT will solve these problems be using the common GUI design concept of a resource file to define the
GUI, rather than writing code for every element in the interface. The amount of information required to
specify an element will be kept to a minimum by the approach, solving problem 1. In addition, a builder
that uses the resource file as a basic description will control the actual decorating and layout of the GUI
elements and their placement relative to other elements. The result is that all elements will be created in a
consistent and controlled manner, solving problem 2.
To be successful, four elements must by created:
1. A description of the GUI in the resource file
2. A resource file parser that reads the file and checks for errors
3. A builder that takes the resource file information and creates the actual Tcl/Tk widgets on the
screen.
4. A library of procs that can be used to use, update and manage GUI items.
This document will outline the requirements of all four areas, and focus on the specification for the
resource file.
3: Resource File
Phoenix Analysis &
Design Technologies
Page 2 of 10
PADT
The resource file will contain a simple and readable description of the proposed GUI elements. It is
hierarchical in nature and is focused on minimizing the effort required to expose a command to the user in
the interface.
Note: Statements followed by (NI) are not implemented. The parser will read the command but no
process it.
The following is the specification:
1: Files
1.1: Directory
1.1.1: All files used to describe the GUI will be placed in a directory hierarchy
1.1.1.1: The parser and builder are stored in scripts
1.1.1.2: The resource file(s) are stored in resource
1.1.1.3: The icons are stored in icons.
1.1.2: The directory tree should be a sub -directory of the main application directory.
1.1.3: The calling Tcl/Tk script needs to establish the root directory for the techTK files
1.2: Default Resource File
1.2.1: The parser will read a resource file from a specified directory
1.2.2: The calling routine needs to call:
::AIEnv::GUIManagement::InNamespaceBuildAIEnv
with the full name and path of the resource file as its only argument
1.3: Supplemental Resource Files
1.3.1: The GUI description can be organized in multiple files resource files that are called
by other resource files
1.3.2: An include Statement controls what files are read
1.4: File Naming conventions
1.4.1: Resource files should end with .ttkrf
1.5: Images
1.5.1: Images used in Icons or to decorate the GUI are also stored in the techTK directory
1.5.2: The naming convention for icons is name.gif where name is a unique identifier that
is used to call the icon.
1.5.3: One size of icons is currently supported:
1.5.3.1: 24x24 are stored in icons/small
2: Hierarchy
2.1: The resource file is hierarchical in nature
2.2: An item that is defined within an open item or items, is placed into that item
2.3: Items are closed with itemStatement END
2.4: Indentation should be used to enforce clarity
2.5: Example simple menu that has an open, save and exit:
Page 3 of 10
PADT
winMenu windowMenu
menu file
menuItem Open openFileProc
menuItem Save saveFileProc
menuItem Save as saveAsFileProc
separator
menuItem Exit exitProgramProc
menu END
winMenu END
3: Statement Syntax
3.1: Resource files are made up of a series of one line statements that define the GUI
3.2: All statements take the form of a single keyword followed by a space delimited list of
arguments
3.3: Arguments with spaces in them should be enclosed in double quotes
3.4: Statements should not exceed 130 characters
3.5: Keywords are case sensitive
3.6: Blank lines are ignored
3.7: Lines beginning with a # are treated as comments and are ignored
4: Reserved Strings
4.1: The parser will recognize the following predefined argument values:
NULL
SMALL
INT
TRUE
MEDIUM
TEXT
FALSE
LARGE
END
NUM
4.2: See the specific argument documentation for a given statement to see how the defined
values are interpreted
5: Common Statements
5.1: Some statements are common across elements or control element usage
5.2: Valid common statements are:
5.2.1: # string (Not working!)
Defines a comment.
string A string that is ignored by the parser. Does not need to be
double quoted
5.2.2: include fileName (NI)
Specifies another resource file to read
fileName
name of the resource file to read. Must be in the resource file
directory.
5.2.3: separator
Specifies that some sort of spacer should be inserted between the previous and next
elements.
6: Container Statements
6.1: GUI elements are placed with containers of a certain type
6.2: Each container in an application must be defined and told where it is to be placed.
6.3: The following statements are allowed:
Phoenix Analysis &
Design Technologies
Page 4 of 10
PADT
Page 5 of 10
PADT
9.4.3:
Page 6 of 10
PADT
9.4.5:
9.4.8:
Page 7 of 10
PADT
label
list
variable
multiFlag
Page 8 of 10
PADT
5: GUI Builder
When the program needs to build the GUI, or an element within it. A call can be made to the GUI builder
proc. The argument to the builder is the parent of the branch that needs to be built. The GUI builder will
step through the list outlined in the previous section and build the pieces. Control of the look and feel for
the interface is expressed in this part of the tool and it is critical that it work robustly.
Phoenix Analysis &
Design Technologies
Page 9 of 10
PADT
6: GUI Utilities
There are a small number of utilities that are required to interact with the techTK GUI. Most of them take
the form of itemName action arg1argN where itemName is the name of some techTK item described in
the resource file.
The procedures for data entry and wizard items are:
itemName set varName val
Sets a variable (varName) that is local to a data entry item to a
value (val)
itemName get varName
itemName show
Displays a data entry item in the data entry zone of the GUI.
Most often used as the proc argument to an iconButton
Page 10 of 10