You are on page 1of 10

PADT

1465 N Fiesta Blvd


Suite 107
Gilbert, AZ 85233

Phoenix Analysis &


Design Technologies
www.padtinc.com

Update
U-ERM052102-1

1-800-293-PADT
(480) 813-4884 V
(480) 813 4807 F

Project: AI*Environment GUI & Functionality


Design
Subject:

Initial Specification for


techTk GUI environment

Prepared For: AI*Environment GUI Team


Prepared By: Phoenix Analysis & Design

Technologies, Inc.
Eric Miller
Matt Sutton
Date:

May 21, 2002

PADT

Phoenix Analysis &


Design Technologies

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

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

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:

Phoenix Analysis &


Design Technologies

Page 3 of 10

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

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

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

6.3.1: winMenu name


Defines the main text menu
name
Unique name for the main menu
END specifies the end of the menu definition
6.3.2: popUpMenu name
An invisible container to place pop up menus in
name Name used to catogrize popUpMenus. Has no use in the
GUI. END specifies the end of the definition
7: Text Menu Statements
7.1: Defines text menus at the top of a window or as a popup on a tree leaf
7.2: A mainMenu or popupMenu mus t be active to use text menu statements
7.3: Valid statements for text menus are:
7.3.1: menu label
Defines a vertical text menu.
label
The text to use as the label for the menu
If the menu is to be used in a popup, then the label is used to identify the menu in the
object that calls it. END specifies the end of the definition
7.3.2: menuItem label proc
Defines a command to be placed in the currently active menu
label
The text to be displayed in the menu
proc
The procedure to call when the user selects the menu item
7.3.3: menuCheck label proc checkFlag
Defines a check menu item that user can toggle on and off
label
The text to be displayed in the menu
proc
The procedure to call when the user selects the menu item. If no
action is required other than setting the checkFlag, then use
NULL for the proc name
checkFlag
variable that stores the check status. 1 for checked, 0 for not checked
8: Icon Bar Statements
8.1: Defines icon menu bars that are two levels deep
8.1.1: Level one are the tabs on all the bars
8.1.2: Level two are the bars themselves
8.2: Non tabbed icon bars can also be used if they are placed in an icon zone
8.3: Valid statements for icon bars are:
8.3.1: tabbedIconBar name iconImage toolTip
Defines an icon bar that has a tab on it with an icon.
name
The name for the icon bar
iconImage
Name of the icon image
toolTip
A string in double quotes that will show up under tool tips
Phoenix Analysis &
Design Technologies

Page 5 of 10

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

8.3.2: iconBar name


A standard (non-tabbed) icon bar that can be placed in an icon bar zone or under a
drop down.
name
Name to be used for the icon bar
8.3.3: iconButton name iconImage proc toolTip
Defines an icon button that executes a procedure when pressed
name
Unique name to be used for the icon
iconImage
Name of the icon image
proc
Proc and arguements to be called when activated
(often dezName show)
toolTip
A string in double quotes that will show up under tool tips
8.3.4: iconToggle name iconImage proc statusFlag toolTip (NI)
Defines a icon that toggles on and off.
name Name to be used for the icon
iconImage
Name of the icon image
proc
Proc to be called when activated
statusFlag
Global variable that status of toggle is stored in (1 for on, o off)
toolTip
A string in double quotes that will show up under tool tips
9: Dialog Statements
9.1: Specifies the controls that go inside a dialog area
9.2: Only valid from within a data entry zone
9.3: All controls go on one line, except for radio choice zones.
9.4: Valid statements are:
9.4.1: dataEntryDialog name label
name
Name for the item
label
label to be displayed on top of the entry dialog
Note: Procedure to be executed by pressing the dialog control buttons (Apply, OK,
Cancel) are controlled by default procedures: onNameApply, onNameOK,
onNameCancel. Name is the name specified in the declaration.
Note: The help file for the dialog is nameHelp.
9.4.2:

textEntry name label variable type


Defines a simple text entry control
name
Name for the item
label
Label to be displayed in bold to the left of the entry field
variable Name of global variable to place the enter value i nto
type
Specifies acceptable variable types: NUM, INT, TEXT
grayFlag global variable that, when set, tells the GUI to gray out the item

9.4.3:

entityChooser name label listName type qty

Phoenix Analysis &


Design Technologies

Page 6 of 10

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

Defines an entry item that is used to pick geometry or FE items


name
name for the item
label
Label to be displayed in bold to the left of the entry field
listName Name of a global variable that a list of the chosen items are placed in.
type
Type of entity to be picked: possible options TBD
qty
Number of entities. If:
<N then pick up to N entities
N pick exactly N entities
ANY no restriction on number
9.4.4:

frame name label


Defines a labeled frame that other items can be grouped in
name
Name for the item
label
Label to be displayed in bold in the top left of frame

9.4.5:

greyGroup name label


Defines a collection of items whose grey status is controlled by a radioGroup. The
greyGroup is filled with greyGroupItems. The builder create the radioGroup.
name
Name for the item
label
Text string that is displayed in the controlling RadioGroup frame

9.4.6: greyGroupItem name label


A container to hold one or more dialog items that are to be treated as a group for
greying.
name
Name for the item
label
Text string that is displayed in the controlling radioGroup as a
radioGroupItem
9.4.7:

radioGroup name label numCol variable default proc


Defines a labeled frame that radio choices can be placed in
name
Name of the item
label
Label, and prompt, for the radio group
numCol Number of columns to place radio buttons in. Filled by rows
variable Variable to place the selected radio buttons value in
default
Number of radioItem to set as default
proc
Proc to be run if a radio button is pressed. NULL if none

9.4.8:

radioItem name label value


Defines a radio button to be placed in a radio group.
name
Name of the item
label
Label for the button
value
String that is placed in the parent radioGroups variable if this item is
selected.

9.4.9: dropDownEntry name label list variable multiFlag


Defines a text entry that can be fi lled by choosing from a drop down menu
name
Name of the item
Phoenix Analysis &
Design Technologies

Page 7 of 10

AI*Environment GUI &


Functionality Design

PADT

label
list
variable
multiFlag

Phoenix Analysis &


Design Technologies

Label for entry


Name of a global variable that points to a list with the items to be
chosen from
Name of a global variable to place the users choice in
if True, allow user to pick more than one item, FALSE allows single
pick only

9.4.10: integerEntry name label variable type increment grayFlag


Defines a special type of text entry that only accepts integer numbers and has a
control to increment the number up and down
name
Name of the item
label
Label for entry
variable Name of a global variable to place the users specified integer in
increment Integer to increment number by when up or down arrows are clicked
9.4.11: textButton name label proc grayFlag
Defines a simple text button that runs a proc
name
Name of the item
label
Label for button
proc
proc to execute
9.4.12: iconButton name label iconName proc toolTip
Defines a simple icon button that runs a rpoc
name
Name of the item
label
Label for button
iconName Name of the icon
proc
proc to execute
toolTip
Text to show within tool tip
9.4.13: table name label tableArray colLab
Defines a special entry for users to specify named tables in. The user can specify
the name of a table or click a b utton next to the entry to bring up a table editing
tool.
name
Name of the item
label
Label for entry
tableArray Array variable that table displays
colLab
List containing column labels
9.4.14: checkItem name label variable proc
Defines a check box item for users to make yes/no choices with
name
Name of the item
label
Label for entry
variable Name of global variable to put users choice in
0 for unchecked, 1 for checked.
proc
proc to execute. Enter NULL if no proc is needed

Phoenix Analysis &


Design Technologies

Page 8 of 10

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

9.4.15: dialogSpace quantity


Specifies blank spaces to put in the dialog. Equivalent to of the vertical space
used by a text entry
quantity number of spaces to put in. Default is 1
10: Wizard Statement
10.1: Processes can be represented through the use of wizards
10.2: Wizards consist of a series of wizard pages
10.3: Users can move forward and backward through the wizard pages
10.3.1: By default, the order of movement is the order that the pages are listed in the
resource file
10.3.2: By setting the global variable ttkNextWizPage, a program can control what the
next wizard page is
10.4: Wizards exist in a pop-up dialog window
10.5: Each wizard page can contain any valid dialog statement as described above
10.6: A wizard is shown by calling a proc called wizardNameShow where wizardName is the
name specified for the wizard.
10.7: Valid wizard statements are:
10.7.1: wizard name
Begins specification for a wizard.
name
Name of the wizard. Set to END to close out current wizard definition.
Note: If they exist, the following procs are executed on the given events:
Wizard is first Displayed: onNa meOpen
Cancel button is picked: onNameCancel
Finish button is picked: onNameFinish
10.7.2: wizardPage name
Specifies a page within the wizard. Any dialog statement is valid for the contents
of a wizard page.
name
Name of the wizard. Set to END to close out current wizard definition.
Note: If they exist, the following procs are executed on the given events:
Page is displayed: onNameEnter
Next button is picked: onNameNext
Prev button is picked: onNamePrev

4: Resource File Parser


Tcl/Tk procedures exist that will read the resource files and prepare information for the builder. The data
in the resource file is placed into a data structure in Tcl/Tk and the GUI Builder uses that data structure to
create the GUI.

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

AI*Environment GUI &


Functionality Design

PADT

Phoenix Analysis &


Design Technologies

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

Returns the value of a variable (varName) that is local to a


data entry item.

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

Phoenix Analysis &


Design Technologies

Page 10 of 10

AI*Environment GUI &


Functionality Design

You might also like