In file Gui.h:

class Gui

Implements a graphic user interface for a DODS client.

Public Methods

bool progress_visible(int state = -1)
Set or test progress indicator visibility.
bool show_gui(int state = -1)
Should the GUI be used?
bool command(string command)
Send the GUI process a command.
bool command(string command, string * result1, string * result2)
bool simple_error(string msg)
Print an error message and wait for the user to acknowledge it

Public

Gui();
The Gui class constructor.
Gui(const string cmd)
Gui()

Documentation

This class manages a simple graphical user interface (GUI) for a DODS client. The GUI consists of a process that can interpret tcl/tk commands. The DODS client sends commands to the GUI process, who executes them and displays the results. The GUI process was created to display a progress indicator---a bar graph showing the progress of a data transfer. The progress indicator uses three tcl programs which can be found in the #$(DODS_ROOT)/etc# directory: #dods_gui.tcl#, #error.tcl#, and #progress.tcl#. The GUI process is a versatile feature, and may be used for more than a progress indicator. It can display any graphical information that can be encoded into tcl/tk. Do not confuse the DODS Client GUI, managed by this class, with a DODS GUI Client, such as the DODS Matlab GUI, used for the graphical display of DODS datasets. The two can work together, but otherwise have nothing to do with each other. The GUI process uses the following environment variables: \begin{description} \item{#DODS_USE_GUI#} If this variable exists and equals ``no'', the progress indicator will not appear. If it does not exist, or if it has any other value, the progress indicator will be activated. \item{#DODS_GUI#} This is the name of the interpreter to be used to interpret the three tcl programs that make up the GUI. If it does not exist, the program will default to #wish#. \item{#DODS_GUI_INIT#} This is the name of the program to start the GUI manager. If the variable is not defined, the default will be the program that comes with DODS, #dods_gui.tcl#, found in the #$(DODS_ROOT)/etc# directory. \end{description} Note that since the job of the Gui class involves managing a process, there is no copy constructor or compare operators.
Gui();
The class constructor for Gui does not start the GUI process. It only fills in the state variables and awaits further attention from the client process. If the constructor is called with a string argument, that is used as the command to start the GUI process. If the {\it cmd} argument is omitted, the default value is taken from the #DODS_GUI# environment variable. If that variable is not defined, the default value of #wish# is used.

Gui(const string cmd)

Gui()

bool progress_visible(int state = -1)
This function can be used to query whether the progress indicator is visible or not. It may also be used to set whether it is to be seen or not.
Returns:
Returns TRUE if the GUI is visible, false otherwise.
Parameters:
state - If {\it state} is omitted (or is -1, the default), the function returns the visibility state. If {\it state} is included, the function sets the visibility state to the given value.

bool show_gui(int state = -1)
This function returns the state of two internal flags. The first, under program control, indicates whether or not to use the GUI at all. This is a private value called #_show_gui#. The second flag is derived from the value of the environment variable #DODS_USE_GUI#, and is set when the class instance is created. It is also a private value (#_user_wants_gui#), and cannot be modified. The GUI is displayed only if both these flags are TRUE. This function can be used to modify the value of the #_show_gui# flag.
Returns:
The value of #_show_gui# AND #_user_wants_gui#.
Parameters:
state - If {\it state} is omitted (or is -1, the default), the function returns the result of the operation #_show_gui# AND #_user_wants_gui#. If {\it state} is included, the function sets the value of the #_show_gui# flag.

bool command(string command)
Submits a command to the GUI process for execution. It may be that users turn off the GUI (because they are sick of it). In that case, this command will simply return false. It does no harm to call the command when no GUI is running. Care should be taken to send only valid commands---invalid commands may put the GUI into an inoperable state. If the GUI is not running, this function starts it. The GUI process command interpreter is specified with the #DODS_GUI# environment variable, or with the constructor function. The second version of command is used to retrieve a username and password respectively, in result1 and result2
Returns:
TRUE if the command succeeded, FALSE otherwise.
Parameters:
command - A command to submit to the GUI process for execution.

bool command(string command, string * result1, string * result2)

bool simple_error(string msg)
Print an error message and wait for the user to acknowledge it The GUI process command interpreter is specified with the #DODS_GUI# environment variable, or with the constructor function.
Parameters:
msg - message to be printed


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++