Custom Data Windows

In this section the Tcl/Tk (scripted) customization of the look and feel of the data windows is shown. The layout of the properties drawn in the interior of any of the data windows - either Conditions, Materials, Interval Data or Problem Data - can be customized by a feature called TkWidget; moreover, the common behaviour of two specific data windows, Conditions and Materials, can be modified by a Tcl procedure provided for that purpose. This common behaviour includes, in the case of Materials for example, assigning/unassigning, drawing, geometry types, where to assign materials, creating/deleting materials, etc.

TkWidget

The problem type developer can change the way a QUESTION is displayed and if he wishes he can also change the whole contents of a window, while maintaining the basic behavior of the data set, i.e. in the Condition window: assign, unassign, draw; in the Material window: create material, delete material; and so on.

With the default layout for the data windows, the questions are placed one after another in one column inside a container frame, the QUESTION 's label in column zero and the VALUE in column one. For an example see picture below.

CONDITION: Steel_section

CONDTYPE: over lines

CONDMESHTYPE: over body elements

QUESTION: Local_Axes#LA#(-Default-,-Automatic-)

VALUE: -Default-

QUESTION: SteelName

VALUE: IPN-80

QUESTION: SteelType

VALUE: A37

END CONDITION

Default layout in data windows

The developer can override this behavior using TKWIDGET . TKWIDGET is defined as an attribute of a QUESTION and the value associated with it must be the name of a Tcl procedure, normally implemented in a Tcl file for the problem type. This procedure will take care of drawing the QUESTION . A TKWIDGET may also draw the entire contents of the window and deal with some events related to the window and its data.

The prototype of a TKWIDGET procedure is as follow:

proc TKWidgetProc {event args} {

switch $event {

INIT {

...

}

SYNC {

...

}

DEPEND {

...

}

CLOSE {

...

}

}

}

The procedure should return:

The argument event is the type of event and args is the list of arguments depending on the event type. The possible events are: INIT , SYNC , CLOSE and DEPEND . Below is a description of each event.

The picture below shows a fragment of the data definition file and the GUI obtained. This sample is taken from the problem type RamSeries/rambshell and in this case the TKWIDGET is used to create the whole contents of the condition windows. For a full implementation, please download the problem type and check it.

CONDITION: Steel_section

CONDTYPE: over lines

CONDMESHTYPE: over body elements

QUESTION: Local_Axes#LA#(-Default-,-Automatic-)

VALUE: -Default-

QUESTION: SteelName

VALUE: -

QUESTION: SteelType

VALUE: -

TKWIDGET: SteelSections

END CONDITION

Customized layout in data windows

Data Windows Behavior

In this subsection we explain a Tcl procedure used to configure the common behaviour of Materials. We are working on providing a similar functionality for Conditions using the same interface.

GiD_DataBehaviour controls properties of data windows for Materials and Conditions (not currently implemented). For Materials we can modify the behaviour of assign, draw, unassign, impexp (import/export), new, modify and delete. We can also specify the entity type list with the assign option throught the subcommands geomlist and meshlist.

The syntax of the procedure is as follows:

GiD_DataBehaviour data_class name ?cmd? proplist

where

Example:

GiD_DataBehaviour materials Table geomlist {surfaces volumes}

GiD_DataBehaviour materials Solid hide {delete impexp}