| LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes |
This page describes the TCL/TK entry forms generated by LLOOP and explains how to use them.
TCL/TK forms can be generated from the definitions of command line options in gsp files.
The generated forms can also be used as general-purpose data forms not only intended for entering option values, provided that data are represented and specified the same way as described below for command line options.
These forms allow to enter option values through graphical interface. They offer the following ergonomic features:
The forms are supported by a set of functions (TCL) which allow seamless integration with the final application, among which:
The generated forms rely on an extension of the TCL standard functions which are defined in TCL files to be used along the generated code. Further information can be found at the end of this page.
A child form is created for each option subset defined within another set of options. The child form is opened through a button which replaces a conventional entry field.
There is no limit with regard to the hierarchy level child forms can be defined in, and there can be a random number of child forms at a given level.
The GSP Language Reference explains how to create option sets and option subsets.
The following table describes the types of entry field generated according to the passed option values. Most time, a type of entry field is tied to a predefined token of the standard GSP library:
| Option value / Token | Type of Entry |
| text | Multi-line Entry |
|
existingfile, existingdir, dir, forcedir, existingimage |
Line entry when option can be specified once only. Multi-line entry when option can be specified several times. Push button to browse file or directory. |
|
uint, int |
Spinbox entry. Values are separated with comas when option can be specified several times. |
| Option with no value | Check box |
| Option with value (default) |
Line entry Values are separated with comas when option can be specified several times. |
| Option Set | Push button |
Example:

Note: the function that creates the window and the OK, Cancel buttons is not generated, but generic and predefined in the required TCL extension.
Example:
Panel Forms
These forms have the following characteristics:

The following table describes useful generic TCL functions which are predefined in the required TCL extension:
The TCL code generated from a gsp file defines its own TCL namespace which is the same as the C++ namespace defined for the generated parse code.
The following table describes the generated TCL functions, defined in that namespace, which allow to create the TK forms and manage the entry data:
| Function | Purpose |
| proc namespace::ControlPanel { panel } | Creates a panel form taking panel as parent widget. |
| proc namespace::SimpleControlPanel { parent onModificationCallbackProc onHelpCallbackProc } |
Same as ControlPanel, and additionally: - shows the titles Property and Values for the labels and the entry fields - when a field is modified, executes the onModificationCallbackProc callback function, passing a boolean telling whether the value changed - when a field is selected, executes the onHelpCallbackProc callback function, passing the help text to the function call |
| proc namespace::MDIControlPanel { parent onModificationCallbackProc onHelpCallbackProc } |
Same as SimpleControlPanel, and additionally: - puts the panel into an incrusted MDI window. The title of the window is Option Values |
| proc namespace::ControlPanel_save { fd } | Saves the entered field values (inclusive all those of sub-forms) using the fd file descriptor. fd must have been opened with the tcl open function. The values are saved as TCL code. |
| proc namespace::ControlPanel_saveToOptionFile { file {append 0}} | Saves the entered field values (inclusive all those of sub-forms) into the specified file file. append tells whether to append the values the files or to overwrite it. Calls internally ControlPanel_save. |
| proc namespace::ControlPanel_readFromOptionFile { file } | Reads the field values (inclusive all those of sub-forms) from the specified file file. Updates the form accordingly. |
| proc namespace::ControlPanel_getCommandLine { executablePath } | Builds the command line. This line starts with the passed executable name executablePath followed by all entry field values and the appropriate option switches. |
| proc namespace::ControlPanel_isModified { } | Tells whether the form or any of its sub-forms is modified. |
| proc namespace::ControlPanel_resetOptionValues { } | Empties all entry fields (inclusive all those of sub-forms). |
| proc namespace::ControlPanel_backupCurrentOptionValues { } | Adds the entry values into the change history. |
| proc namespace::ControlPanel_undoOptionValues { } | Undo last change by taking the last value added to the change history with ControlPanel_backupCurrentOptionValues. |
| proc namespace::ControlPanel_backupOptionValues { } | Make a backup of current value. The new backup overwrites the previous backup done with this function. |
| proc namespace::ControlPanel_restoreOptionValues { } | Restores a backup make with ControlPanel_backupOptionValues |
The generated forms and the generic GFE applications rely on a set of functions which are defined in the TCL files listed below. All sources are licensed under the GNU license terms and available below the gfe_source directory of the release package.
It is possible to create Graphical Front End Applications (GFE) for controlling command line programs, without any programming. A GFE is created based on:
The TCL source file gfe.tcl defines the set of required functions to set up generic GUI applications. It requires the TCL extensions mentioned above.
The TCL source file gfe_cfg.tcl is a configuration file created and managed by the generic application itself. It contains all the configuration parameters for the application, among which user-written functions used to customise the application.
All TCL sources can be integrated into a single executable file using FreeWrap v6.1.
The graphical interface of LLOOP, GFE LLOOP, relies fully on a generic GFE application and forms generated from the gspc option specifications. The GFE application is customised through the gfe_cfg.tcl configuration.
The graphical interface of Makedoc, GFE Makedoc, also bases on a generic GFE application and generated forms.
This file is part of the LLOOP Reversible Object-Oriented Parser Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.
| Copyright (c) 2005-2006 Michel MEHL, Haguenau, France |
| LLOOP version 1.1 |