Configurable runtime graphical user interface widget management5786815Abstract A method facilitating modification of an application's graphical user interface (GUI), particularly by application end-users. In particular, the method permits modification of the application GUI, without having to specify widgets required for the modified GUI, and without having to modify or add callback routines. Thus, users can tailor the application GUI to suit their needs without having experience in GUI development (and, in particular, with the cumbersome and error-prone tasks of widget-specification and callback programming). Elimination of the need to modify/expand the set of callback routines permits end-users to realize application GUI changes without having to form a new application executable. Thus, user-driven application GUI changes can be achieved without user access to the application source code and without the application developer's involvement. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
__________________________________________________________________________
Init.sub.-- Commands()
Command cmd = NULL;
Node node = NULL;
1 open external file;
2 while ( not end-of-file ) do
3 get next token; // token cannot be a
4 "blank" character
5 if (token is "COMMAND") then
6 if (node is not NULL and cmd is not NULL) then
7 if (cmd.SUB is NULL) then
8 cmd.SUB = new SUB node;
9 endif;
10 insert node into cmd.SUB's list;
11 endif;
12 node = NULL;
13 get next token;
// the command's name
14 cmd = new Command;
15 cmd.name = token;
16 process.sub.-- attributes();
// do the ones before {}
17 // (advances the token)
18 if (token is `{`) then
19 node = process.sub.-- arg.sub.-- syntax();
20 if (node is not NULL) then
21 create an OPT-arg node;
22 OPT-arg.SUB = node;
23 node = OPT-arg;
24 endif;
25 endif;
26 process.sub.-- attributes();
// do the ones after {}
27 // (advances the token)
28 add command to command table;
29 else if (token is not NULL) then
30 create an OPT node; OPT.name = token;
31 if (cmd.SUB is NULL) then
32 cmd.SUB = new SUB node;
33 endif;
34 insert OPT into cmd.SUB's list;
35 process.sub.-- option.sub.-- attributes();
// do the ones before {}
36 // (advances the token)
37 if (token is `{`) then
38 OPT.SUB = process.sub.-- arg.sub.-- syntax ();
39 endif;
40 process.sub.-- option.sub.-- atrributes ();
// do the ones after {}
41 // (advances the token)
42 endif;
43 endloop;
44 close external file;
45 if (node is not NULL and cmd is not NULL) then
46 if (cmd.SUB is NULL) then
47 cmd.SUB = new SUB node;
48 endif;
49 insert node into cmd.SUB's list
50 endif;
end Init.sub.-- Commands;
process.sub.-- attributes ()
read command attribute tokens (if any) and set
corresponding flags in the CMD object's data until a `{`
or an end-of-line is read.
end process.sub.-- option.sub.-- attributes;
process.sub.-- option.sub.-- attributes()
read option attribute tokens (if any) and set
corresponding flags in the OPT object's data until a `{`
or an end-of-line is read.
end process.sub.-- option.sub.-- attributes;
Node process.sub.-- arg.sub.-- syntax ()
Node node;
boolean whitespace = FALSE;
1 create a SUB node;
2 get next token; // token can be a "blank"
3 // character
4 while (token is not NULL) do
5 if (token is `}`) then
// return at end of {. . .}
6 return SUB node;
7 else if (toekn is `›`) then
8 // We must process an optional (or nested) part of
9 // the syntax, delimited by › !
10 node = process.sub.-- arg.sub.-- syntax();
// recursive call
11 // creates a SUB nide
12 node.whitespace = whitespace;
13 whitespace = FALSE;
14 get next token;
15 if (token is `*`) then
16 node.loopdef = ZERO.sub.-- OR.sub.-- MORE;
17 get next token;
18 else if (token is `+`) then
19 node.loopdef = ONE.sub.-- OR.sub.-- ONE;
20 get next token;
21 else
22 node.loopdef = ZERO.sub.-- OR.sub.-- ONE;
23 endif;
24 insert node into SUB's list
25 else if (token is `!`) then
// return at end of ›. . .!
26 return SUB node;
27 else if (token is `<`)then
28 // We must process an identifier definition,
29 // delimited by <>
30 create an ID node;
31 ID.whitespace = whitespace;
32 whitespace = FALSE;
33 get LABEL:TYPE:VALUE:DEFAULT> fields (if necessary);
34 get next token;
35 insert ID into SUB's list
36 else if (token is a space character-blank, tab, etc.) then
37 // whitespace is significant in the argument syntax.
38 // It indicates that similar whitespace must exist
39 // in that location in the UNIX command string. We
40 // attach it as an "attribute" to the next node that
41 // is created.
42 whitespace = TRUE;
43 while (token is a space character) do
44 get next token;
45 endloop;
46 else
47 // Any characters other than }› !<> or whitespace is
48 // assumed to be a literal in the command. It
49 // indicates that a similiar literal must exist in
50 // that location in the UNIX command string.
51 create a LIT node;
52 LIT.whitespace = whitespace;
53 whitespace = FALSE;
54 get next token;
55 insert LIT into SUB's list
56 endif;
57 endloop;
end process.sub.-- arg.sub.-- syntax;
__________________________________________________________________________
Table 1 illustrates steps performed by the above pseudocode when parsing the expanded definition of the a.example command, presented above, to produce the internal format of FIG. 4.
TABLE 1
__________________________________________________________________________
Token read
Location Action Taken
__________________________________________________________________________
COMMAND Init.sub.-- Commands (IC) Line 3
a.example
IC, line 13
IC, line 14 Create CMD node 402
IC, line 15 CMD.name .rarw. a.example.
IC, line 16 Call process.sub.-- attributes to
process any attributes on
command line after CMD name
& before { }
{ last token obtained
in process.sub.-- attributes
IC, line 19 call process.sub.-- arg.sub.-- syntax
(PAS) - call #1
PAS, line 1 create SUB node 411
blank PAS, line 2
PAS, line 42 whitespace .rarw. TRUE
< PAS, line 44
PAS, line 30 create ID node 412
PAS, line 31 whitespace field of ID node
412 set to TRUE
(indicates that a blank to
precede corresponding arg in
UNIX command string)
cmd.sub.-- arg1
PAS, line 33
> PAS, line 33
PAS, line 33 Set name field of ID node 412
to cmd.sub.-- arg1
} PAS, line 34
PAS, line 35 insert ID node 412 into node
list of SUB node 411
PAS, line 6 return SUB node 411 to IC line
19 (return from call #1)
IC, line 21 create OPT-ARG node 410
IC, line 22 set SUB pointer of OPT-ARG
node 410 to point to SUB
node 411
IC, line 23 node .rarw. OPT-arg node 410
IC, line 26 call process.sub.-- attributes to
process any attributes on
command line after { }
NULL last token obtained
in process.sub.-- attributes
IC, line 28 add CMD node 402 to
command table 401
-P IC, line 3
IC, line 30 create OPT node 404
for OPTION"-P" and store
"-P" in name field of node 404
IC, line 32 create SUB node 403
make SUB ptr of CMD node
402 point to SUB node 403
IC, line 34 insert OPT node 404 into node
list of SUB node 403
IC, line 35 call process.sub.-- option.sub.-- attributes to
process any attributes on option
line after option name &
before { }
{ last token obtained
in process.sub.-- option.sub.--
attributes
IC, line 38 call process.sub.-- arg.sub.-- syntax
(PAS) - call #2
PAS, line 1 create SUB node 405
› PAS, line 2
PAS, line 10 call PAS - call #3
PAS, line 1 create SUB node 406
blank PAS, line 2
PAS, line 42 whitespace .rarw. TRUE
< PAS, line 44
PAS, line 30 create ID node 407
PAS, line 31 set whitespace field of
ID node 407 to TRUE
opt.sub.-- arg1
PAS, line 33
> PAS, line 33
PAS, line 33 set name field of ID node
407 to opt.sub.-- arg 1
› PAS, line 34
PAS, line 35 insert ID node 407 into
node list of SUB node 406
PAS, line 10 call PAS-call #4
PAS, line 1 create SUB node 408
blank PAS, line 2
PAS, line 42 whitespace .rarw. TRUE
< PAS, line 44
PAS, line 30 create ID node 409
PAS, line 31 set whitespace field of
ID node 409 to TRUE
opt.sub.-- arg 2
PAS, line 33
> PAS, line 33
PAS, line 33 set name field of ID node
409 to opt.sub.-- arg2
! PAS, line 34
PAS, line 35 insert ID node 409 into
node list of SUB node 408
PAS, line 26 return SUB node 408 to PAS
line 10 (return from call #4)
! PAS, line 14
PAS, line 22 set loopdef field of SUB node
408 to ZERO.sub.-- OR.sub.-- ONE
PAS, line 24 insert SUB node 408 into node
list of SUB node 406
PAS, line 26 return SUB node 406 to PAS,
line 10 (return from call #3)
} PAS, line 14
PAS, line 22 set loopdef field of SUB node
406 to ZERO.sub.-- OR.sub.-- ONE
PAS, line 24 insert SUB node 406 into node
list of SUB node 405
PAS, line 6 return SUB node 405 to IC line
38 (return from call #2)
IC, line 38 set SUB pointer field of OPT
node 404 to point to SUB node
405
NULL IC, line 40 call process.sub.-- option.sub.-- attributes to
process any attributes on option
line after { }
IC, line 49 insert OPT-ARG node 410 into
node Iist of SUB node 403
__________________________________________________________________________
Command and Option Attributes As indicated by the presence of the routines process.sub.-- attributes() and process.sub.-- option.sub.-- attributes() in the above pseudocode, each command and option line of a command definition can have one or more attributes. Some of the attributes affect the execution of a command string formed in accordance with the definition. For example, the JOB command attribute indicates that the command string is to be executed by UNIX in the background. Other attributes affect the GUI that application 11 constructs to reflect the command definition. For example, the MANY option attribute signifies that the option can be repeated more than once in the command string. As a result, operations code 14 creates a scrolling list that allows the user to repeatedly enter values for the option's argument(s). Yet other attributes affect the command strings formed according to the command definition. For example, the LAST option attribute indicates that the option and its arguments are to appear at the end of the command string. Operations Code 14 Operations code 14 (which performs widget creation and callback processing for application 11) contains the following eight functions for each of the five object types described above. Pseudocode for the functions is presented in Appendix 2, and should be referred to while reading through several examples of callback processing presented below in tabular format:
______________________________________
Function name
Action
______________________________________
Construct.sub.-- Props()
create widgets required to represent the
arguments and options of a command stored
in IDS 13. usually called once for each
command.
Destroy.sub.-- Props()
destroy widgets previousiy created (via
Construct.sub.-- Props) to represent a particular
command
Display.sub.-- Props()
copy data from a representation for a
command stored in IDS 13 to widgets that
were previousiy created for that command
(via Construct.sub.-- Props). called just before
the widgets are managed (i.e. displayed on
the screen).
Apply.sub.-- Props()
copy data entered by the user into widgets
of the GUI representing a particular
command (created via Construct.sub.-- Props) to
the representation for the command in IDS
13. called when the Ok or Apply button is
pressed.
Activate() cause a widget hierarchy to become active.
called when a user turns a checkbox "on".
Inactivate() cause a widget hierarchy to become
inactive. called when a user turns a
checkbox "off".
Parse.sub.-- Command()
parse a command string stored on disk and
copy data from the command string into the
representation for the command in IDS 13.
called only if commands are available in
UNIX command string form.
Construct.sub.-- Command()
translate the representation for a
particular command stored in IDS 13 into a
command string for use as a UNIX comman
ready to execute and/or for storage on
(and future retrieval from) disk.
______________________________________
The desired function action is achieved by invoking the associated function of the CMD object corresponding to the command definition of interest. This function then calls the associated function of the SUB object pointed to by the CMD object. Each function call of a SUB object calls the same function in each of the objects in its list. Each function call of an OPT object calls the same function of the SUB object pointed to by the OPT object. Thus, operations code 14 is designed to "walk" through the hierarchy of objects of IDS 13 (as will become clearer after presentation of several examples further below). Because operations code 14 has been designed in this way, the set of callback routines of application 11 does not need to be modified or expanded upon changes to input file 10 (performed by the user in order to change the GUI of application 11). In application 11, a command and its options are represented in 3 formats: 1) as a set of widgets (which in this embodiment are maintained by Motif/XWindows) underlying the GUI of application 11; 2) in an internal format, i.e. IDS 13 , described above; 3) and as a command string ready for execution. FIG. 5 illustrates the three formats and the functions of operations code 14 used to translate between the formats. The processing performed in various functions in operations code 14 will be described in some detail below in conjunction with several examples. Initiation of Application 11 and callback processing When AdaVision begins to execute, the routine Init.sub.-- Commands() is called to parse input file 10 into IDS 13 (i.e. the corresponding internal format), as described above. Then AdaVision displays its main window. When the user clicks on a particular menu item of the main window, a Command Options window is created and displayed in order to show the user the structure of the arguments and options of a particular command. FIG. 6 depicts one example of a Command Options window 600 for the command "PreProcess". At the top of window 600 is a button 601, whose associated menu is constructed from the name fields of the CMD objects in the command table of IDS 13. Underneath the menu button is an options frame 602 where the widgets for all the options and arguments for the "PreProcess" command are displayed. Under frame 602 is a message area 603 (for error reporting) and a row of buttons 604A-D (Ok, Apply, Cancel, Help). The first Commands Options window brought up by AdaVision is created for the first command definition in input file 10 by calling the Construct.sub.-- Props() function (and then the Display.sub.-- Props function) of the CMD object in IDS 13 corresponding to the first command definition. Display.sub.-- Props() places a command string to be parsed into a command buffer. This command string is either retrieved from disk, or if no such command is stored on disk, constructed from the name of the selected command and the names of units and/or libraries the user has selected from AdaVision's Unit View and/or Library View windows. Display.sub.-- Props() then calls Parse.sub.-- Command() to translate the command string in the buffer into the corresponding IDS (13). An example of the processing performed in Construct.sub.-- Props and Display.sub.-- Props is described below in conjunction with the discussion of the callback routine, MenuButton.sub.-- Callback. This callback routine is executed upon selection of a command from the menulist that is brought up upon clicking on menu button 601. As mentioned above, the user can see the entire list of available commands by clicking on button 601 of the Command Options window. FIG. 7 depicts the window of FIG. 6 covered by a menu 701 displaying such a list of available commands. When another command is chosen from menu 701, a new frame is created and filled with widgets for the chosen command by calling Construct.sub.-- Props(), and then Display.sub.-- Props(), for the corresponding CMD object. The old frame is set aside, not destroyed, so that redisplaying it will be faster (i.e. no need to call Construct.sub.-- Props to create the widgets). However, redisplaying an old command will still call Display.sub.-- Props() in case the available UNIX command string has been changed since the first display. Currently, Adavision does not call Destroy.sub.-- Props() to destroy the widgets of a Command Options window, but there are three possible reasons for calling Destroy.sub.-- Props(): 1) application 11 could be designed to re-read input file 10 in order to reflect user changes to file 10 made during execution of application 11. Thus, application 11 would have to destroy and re-create the widgets. 2) if application 11 would allow the user to customize the command options window to leave out certain options that they don't care about it would have to destroy and re-create the widgets every time they were customized. 3) if application 11 creates copies of the widgets for temporary purposes it would have to destroy the copies. Pseudocode for the Callback routines As described above, each callback routine of application 11 is called upon the occurrence of a particular interaction of the user with a widget of GUI 16. Examples of such an interaction are clicking on a checkbox, typing into a text field, and selecting a command from the menulist of commands. The callbacks for the various widgets created by Options.sub.-- Callouts are contained within the Options.sub.-- Callouts software (which, as described above, isolates the rest of application 11 from the particular widget creation/management system used). Each of the callback routines sets a "changed" flag in the Command Options window. This is an enhancement that makes it easier to skip a lot of steps when the Ok, Apply, or Cancel button is clicked. For instance, if "changed" is FALSE when the Ok button is clicked, it will not be necessary to call Apply.sub.-- Props() (to copy changes made by the user to the widgets into the corresponding part of IDS 13 ) since a value of FALSE for "changed" indicates that the user didn't make any changes. Pseudocode for the callback routines is given by the following:
______________________________________
CheckBox.sub.-- Callback (Widget checkbox)
Widget cmdoptions.sub.-- window;
cmdoptions.sub.-- window = Parent (Parent (checkbox));
cmdoptions.sub.-- window->changed = TRUE;
if (checkbox is set) then
current.sub.-- command->Activate (checkbox);
else
current.sub.-- command->Inactivate (checkbox);
endif;
end CheckBox.sub.-- Callback;
Textfield.sub.-- Callback (Widget textfield)
Widget cmdoptions.sub.-- window;
cmdoptions.sub.-- window = Parent(Parent(textfield));
cmdoptions.sub.-- window->changed = TRUE;
end Textfield.sub.-- Callback;
FileTextfield.sub.-- Callback(Widget filetextfield)
Widget cmdoptions.sub.-- window;
cmdoptions.sub.-- window =Parent (Parent (Parent (filetextfield)));
cmdoptions.sub.-- window->changed = TRUE;
end FileTextfield.sub.-- Callback;
ExclusiveChoice.sub.-- Callback (Widget exclusivechoice)
Widget cmdoptions.sub.-- window;
cmdoptions.sub.-- window =
Parent(Parent(Parent(exclusivechoice)));
cmdoptions.sub.-- window->changed = TRUE;
end ExclusiveChoice.sub.-- Callback;
ScrollingList.sub.-- Callback(Widget scrollinglist)
Widget cmdoptions.sub.-- window;
cmdoptions.sub.-- window = Parent(Parent(scrollinglist));
cmdoptions.sub.-- window->changed = TRUE;
end ScrollingList.sub.-- callback;
MenuButton.sub.-- Callback (int commandindex)
// Don't do a new command unless the old one is clean:
if (changed) then
ask the user if she wants to save changes
if (yes) then
current.sub.-- command->Apply.sub.-- Props();
endif;
endif;
// Take down old command options before displaying new
// ones.
if (options.sub.-- frame›current.sub.-- commandindex! is not NULL)
then
// Stop displaying the window
Unmanage (options.sub.-- frame›current.sub.-- commandindex!);
endif;
current.sub.-- commandindex = commandindex;
current.sub.-- command = command.sub.-- table›current.sub.-- commandindex!
if (options.sub.-- frame›current.sub.-- commandindex! is NULL) then
options.sub.-- frame›current.sub.-- commandindex! = new options
frame;
current.sub.-- command->Construct.sub.-- Props();
}
current.sub.-- command->Display.sub.-- Props();
changed = FALSE;
// Start displaying the window
Manage(options.sub.-- frame›current.sub.-- commandindex!);
end MenuButton.sub.-- Callback;
OkButton.sub.-- Callback ()
if (changed) then
// Let Apply.sub.-- Props() do all the work
current.sub.-- command->Apply.sub.-- Props();
changed = FALSE;
endif;
// Take the window down
Unmanage(options.sub.-- frame›current.sub.-- commandindex!);
end OkButton.sub.-- Callback;
ApplyButton.sub.-- Callback ()
if (changed) then
// Let Apply.sub.-- Props() do all the work
current.sub.-- command->Apply.sub.-- Props();
changed = FALSE;
endif;
end ApplyButton.sub.-- Callback;
CancelButton.sub.-- Callback()
changed = FALSE;
// Take the window down; do not Destroy.sub.-- Props()||
Unmanage (options.sub.-- frame›current.sub.-- commandindex!);
end CancelButton.sub.-- Callback;
HelpButton.sub.-- Callback ()
if (current.sub.-- command->help.sub.-- tag is not NULL) then
ShowHelp(current.sub.-- command->help.sub.-- tag);
endif;
end HelpButton.sub.-- Callback;
The following callback demonstrates the use of
Construct.sub.-- Command() when the user clicks in the Command
(Actions) menu to execute a command.
CommandMenu.sub.-- Callback (int commandindex)
command.sub.-- table›commandindex!->Construct.sub.-- Command ()
Execute.sub.-- Command(command buffer);
end CommandMenu.sub.-- Callback;
______________________________________
field entry callbacks The callbacks for entering into a text field, a file text field, an exclusive choice field, and a scrolling list (i.e. Textfield.sub.-- Callback, FileTextfield.sub.-- Callback, ExclusiveChoice.sub.-- Callback, ScrollingList.sub.-- Callback, respectively) merely set the "changed" flag in the Command Options window to TRUE for the above indicated reason. callback for selecting a command from the command list in order to display the command's arguments and options FIGS. 8A-8B depict a flowchart of the callback routine "MenuButton.sub.-- Callback". This routine is executed when the user clicks on a command in the menulist of commands that can be displayed over the Commands Options window (see menulist 701 of FIG. 7). This callback routine will be described in conjunction with an example in which the user selects the eighth and final entry "a.example" from menulist 701 in FIG. 7. If the "changed" flag of the current Command Options window is TRUE and the user wishes to save the changes made to the window's widgets into IDS 13 , then Apply.sub.-- Props of the CMD object corresponding to the current Commands Options window is called (steps 801-803). Next, the window is taken down (but not destroyed, in order to facilitate fast redisplay in the future) (step 804). Assuming no Command Options window was previously created for the selected command (i.e. "a.example"), such a window is created. The widgets required for the new window are created by calling Construct.sub.-- Props of the CMD object corresponding to the selected command (steps 805-806). Table 2 shows the resulting hierarchy of function calls and the associated steps taken if the structure stored in IDS 13 for the "a.example" command is that illustrated in FIG. 4. The steps creating the widgets of FIG. 3 are bolded.
TABLE 2
______________________________________
Function call Actions performed within function call
______________________________________
CMD401.Construct.sub.-- Props
SUB403.Construct.sub.-- Props
SUB403.Construct.sub.-- Props
OPT404.Construct.sub.-- Props
OPT-ARG 410.Construct.sub.-- Props
OPT404.Construct.sub.-- Props
create checkbox 301 and text label 311
OPT404.my.sub.-- ui.sub.-- handle .rarw. UI handle
of checkbox 301
create label 311
SUB405.Construc.sub.-- Props
SUB405.Construct.sub.-- Props
SUB406.Construct.sub.-- Props
SUB406.Construct.sub.-- Props
create checkbox 302
SUB406.my.sub.-- ui.sub.-- handle .rarw. UI handle
of checkbox 302
ID407.Construct.sub.-- Props
SUB408.Construct.sub.-- Props
ID407.Construct.sub.-- Props
create label 303
create text field 304
SUB408.Construct.sub.-- Props
create a checkbox 305
SUB408.my.sub.-- ui.sub.-- handle .rarw. UI handle
of checkbox 305
ID409.Construct.sub.-- Props
ID409.Construct.sub.-- Props
create label 306
create text field 307
OPT-ARG410.Construct.sub.-- Props
create separator line 308
SUB411.Construct.sub.-- Props
SUB411.Construct.sub.-- Props
ID412.Construct.sub.-- Props
ID412.Construct.sub.-- Props
create label 309
create text field 310
______________________________________
Next, in step 807 Display.sub.-- Props of the CMD object 402 is called in order to copy command and option argument values stored in IDS 13 for the "a.example" command into the widgets created in step 806. The corresponding hierarchy of calls is given by Table 3. The steps directly affecting the widgets of FIG. 3 have been bolded.
TABLE 3
__________________________________________________________________________
Function call
Actions performed within function
__________________________________________________________________________
CMD402.Display.sub.-- Props
retrieve stored command string (i.e. "a.example val1 -P
val2
val3 ")from disk and insert into command buffer;
CMD402.Parse.sub.-- Command (See Table 4)
SUB403.Display.sub.-- Props(0)
SUB403.Display.sub.-- Props(0)
OPT404.Display.sub.-- Props(0)
OPT404.Display.sub.-- Props(0)
make checkbox 301 checked (since OPT404.Active =
TRUE); SUB405.Display.sub.-- Props(0)
SUB405.Display.sub.-- Props(0)
SUB406.Display.sub.-- Props(0)
SUB406.Display.sub.-- Props(0)
make checkbox 302 checked (since SUB406.loopcount =
1 >0); ID407.Display.sub.-- Props(0)
ID407.Display.sub.-- Props(0)
value of text widget 304 .rarw. ID407.value›0! = val2;
return
to SUB406.Display.sub.-- Props
SUB406.Display.sub.-- Props
ID407.Activate (NULL); (since SUB406.loopcount = 1>0)
ID407.Activate (NULL)
activate local widgets of ID407 (i.e. text label 303 & text
0
field 304); return to SUB406.Display.sub.-- Props
SUB406.Display.sub.-- Props
SUB408.Display.sub.-- Props(0)
SUB408.Display.sub.-- Props
make checkbox 305 checked (since SUB408.loopcount =
1>0); ID409.Display.sub.-- Props(0)
ID409.Display.sub.-- Props
value of text widget 307 .rarw. ID409.value›0! = val3;
return to SUB408.Display.sub.-- Props
SUB408.Display.sub.-- Props
ID409.Activate (NULL)
ID409.Activate (NULL)
activate local widgets of ID409 (i.e. text label 306 & text
.
field 307); return to SUB408.Display.sub.-- Props
SUB408.Display.sub.-- Props
return to SUB406.Display.sub.-- Props
SUB406.Display.sub.-- Props
SUB408.Activate (NULL)
SUB408.Activate (NULL)
activate local widgets of SUB408 (i.e. checkbox 305);
ID409.Activate (NULL) - see above
return to SUB406.Display.sub.-- Props
SUB406.Display.sub.-- Props
return to SUB405.Display.sub.-- Props
SUB405.Display.sub.-- Props
SUB406.Activate (NULL)
SUB406.Activate (NULL)
activate local widgets of SUB406 (i.e. checkbox 302);
ID407.Activate; - see above
Sub 408.Activate; - see above
return to SUB405.Display.sub.-- Props
SUB405.Display.sub.-- Props
return to OPT404.Display.sub.-- Props
OPT404.Display.sub.-- Props
SUB405.Activate; . . . return to OPT404.Display.sub.--
Props
OPT404.Display.sub.-- Props
return to SUB403.Display.sub.-- Props
SUB403.Display.sub.-- Props
OPT404.Activate (NULL)
OPT404.Activate (NULL)
activate local widget of OPT404 (i.e. checkbox 301 &
text label 311
. . .; return to SUB403.Display.sub.-- Props
SUB403.Display.sub.-- Props
OPT-ARG410.Display.sub.-- Props
OPT-ARG410. SUB411.Display.sub.-- Props(0)
Display.sub.-- Props
SUB411.Display.sub.-- Props(0)
ID412.Display.sub.-- Props(0)
ID412.Display.sub.-- Props
value of text widget 310 .rarw. ID412.value›0! = val1;
return
to SUB411.Display.sub.-- Props
SUB411.Display.sub.-- Props
ID412.Activate (NULL)
ID412.Activate (NULL)
activate local widgets of ID412 (i.e. text label 309 & text
7
field 310); return to SUB411.Display.sub.-- Props
SUB411.Display.sub.-- Props
return to OPT-ARG.410.Display.sub.-- Props
OPT-ARG410. . . .; return to SUB403.Display.sub.-- Props
Display.sub.-- Prop
SUB403.Display.sub.-- Props
. . .; return to CMD402.Display.sub.-- Props
CMD402.Display.sub.-- Props
__________________________________________________________________________
The first call made by Display.sub.-- Props of CMD object 402 is a call to Parse.sub.-- Command of the same object. This call to Parse.sub.-- Command parses a buffer containing the "a.example" command to provide corresponding data to be written into IDS 13. The series of calls resulting from this call is shown in Table 4, in which the steps of writing data into IDS 13 are bolded.
TABLE 4
__________________________________________________________________________
Function Actions performed within function
__________________________________________________________________________
CMD402.Parse.sub.-- Command
remove CMD402.name, i.e. "a.example" from
command buffer; SUB403.Parse.sub.-- Command
SUB403.Parse.sub.-- Command
result .rarw. FALSE; done .rarw. FALSE;
SUB403.loopcount .rarw. 0;
parse.sub.-- failed .rarw. OPT404.Parse.sub.-- Command
OPT404.Parse.sub.-- Command
reset pointer to start of command buffer; search
command buffer for OPT404.name (i.e. "-P")
(search is successful); remove "-P" from command
buffer; OPT404.Active .rarw. TRUE;
temp .rarw. SUB405.Parse.sub.-- Command
SUB405.Parse.sub.-- Command
result .rarw. FALSE; done.rarw. FALSE;
SUB405.loopcount .rarw. 0;
parse.sub.-- failed .rarw. SUB406.Parse.sub.-- Command
SUB406.Parse.sub.-- Command
result .rarw. FALSE; done .rarw. FALSE;
SUB406.loopcount .rarw. 0,
parse.sub.-- failed .rarw. ID407.Parse.sub.-- Command
ID407.Parse.sub.-- Command
remove a space character and val2 from command
buffer; ID407.Value›0! .rarw. val2;
return FALSE to SUB406.Parse.sub.-- Command
SUB406.Parse.sub.-- Command
parse.sub.-- failed FALSE;
parse.sub.-- failed .rarw. SUB408.Parse.sub.-- Command
SUB408.Parse.sub.-- Command
result .rarw. FALSE; done .rarw. FALSE;
SUB408.loopcount .rarw. 0;
parse.sub.-- failed .rarw. ID409.Parse.sub.-- Command
ID409.Parse.sub.-- Command
remove a space character and val3 from command
buffer; ID409.value›0! .rarw. val3; return FALSE to
SUB408.Parse.sub.-- Command
SUB408.Parse.sub.-- Command
SUB408 done .rarw. TRUE.loopcount .rarw.
SUB408.loopcount + 1 = 1; (since SUB408.loopdef
is ZERO.sub.-- OR.sub.-- ONE);
return result (=FALSE) to
SUB406.Parse.sub.-- Command
SUB406.Parse.sub.-- Command
parse.sub.-- failed .rarw. FALSE;
SUB406.loopcount .rarw. SUB406.loopcount +
1 = 1; done .rarw. TRUE (since SUB406.loopdef is
ZERO.sub.-- OR.sub.-- ONE); return result (=FALSE) to
SUB405.Parse.sub.-- Command
SUB405.Parse.sub.-- Command
parse.sub.-- failed FALSE;
SUB405.loopcount .rarw. SUB405.loopcount +
1 = 1;
done .rarw. TRUE (since SUB405.loopdef is
TOP.sub.-- ONE);
return result (=FALSE) to
OPT404.Parse.sub.-- Command
OPT404.Parse.sub.-- Command
return FALSE to SUB403.Parse.sub.-- Command
SUB403.Parse.sub.-- Command
parse.sub.-- failed .rarw. FALSE
parse.sub.-- failed .rarw. OPT.sub.-- ARG410.Parse.sub.--
Command
OPT-ARG410.Parse.sub.-- Command
reset pointer to start of command buffer; temp .rarw.
SUB411.Parse.sub.-- Command
SUB411.Parse.sub.-- Command
result .rarw. FALSE; done .rarw. FALSE;
SUB411.loopcount .rarw. 0; parse.sub.-- failed .rarw.
ID412.Parse.sub.-- Command
ID412.Parse.sub.-- Command
remove a space character and val1 from command
buffer; ID412.value›0! .rarw. val1; return FALSE to
SUB411.Parse.sub.-- Command
SUB411.Parse.sub.-- Command
SUB411.loopcount .rarw. SUB411.loopcount +
1 = 1;
done .rarw. TRUE; (since SUB411.loopdef is
TOP.sub.-- ONE); return result (=FALSE) to
OPT.sub.-- ARG410.Parse.sub.-- Command
OPT-ARG410.Parse.sub.-- Command
OPT-ARG410.active .rarw. TRUE; return FALSE to
SUB403.Parse.sub.-- Command
SUB403.Parse.sub.-- Command
parse.sub.-- failed .rarw. FALSE
SUB403.loopcount .rarw. SUB403.loopcount +
1 = 1;
done .rarw. TRUE; (since SUB403.loopdef =
TOP.sub.-- ONE); return FALSE to
CMD402.Parse.sub.-- Command
CMD402.Parse.sub.-- Command
return FALSE
__________________________________________________________________________
The contents of Tables 3 and 4 assume that the command instance "a.example val1 -P val2 val3" is parsed by Parse.sub.-- Command. The processing shown in Table 4 causes val1, val2, and val3 to be copied into ID nodes 412, 407, and 409 (FIG. 4), respectively, of IDS 13. Finally, the "changed" flag for the new Commands Options window is set to "FALSE" and the window is displayed (steps 808-809). The processing shown in Table 3 causes val1, val2, and val3 to be copied from ID nodes 412, 407, and 409, respectively, to text widgets 310, 304, and 307 (FIG. 3), respectively. callbacks for copying data entered into widgets by the user into IDS 13 The user saves data entered into screen widgets into IDS 13 by clicking on one of the OK and Apply buttons on the Command Options windows (see buttons 604A-B of FIG. 6). The data saved into IDS 13 can be used to construct a UNIX command string via the Construct.sub.-- Command routine as discussed further below. The corresponding callback routines for clicking on the Ok and Apply buttons are OKButton.sub.-- Callback and Apply.sub.-- Callback, respectively. The only difference between the two routines is that only the OKButton.sub.-- Callback routine takes down the current Commands Options window. If the changed flag of the current window is TRUE then each of the 2 callback routines calls Apply.sub.-- Props of the CMD object corresponding to the current window and then sets the changed flag to FALSE. Table 5 indicates the resulting hierarchy of calls when the user clicks on the OK or Apply button in the Command Options window of FIG.3, after having checked checkboxes 301 and 302 and having entered "val1" and "val2" into text widgets 304 and 310, respectively. In particular, the steps in which the values entered into text widgets 304 and 310 are copied to ID nodes 407 and 412, respectively, of IDS 13 are bolded.
TABLE 5
__________________________________________________________________________
Function Actions performed within function
__________________________________________________________________________
CMD402.Apply.sub.-- Props
temp .rarw. SUB403.Apply.sub.-- Props(0)
SUB403.Apply.sub.-- Props(0)
result .rarw. FALSE; apply.sub.-- failed .rarw. OPT404.Apply.s
ub.-- Props(0)
OPT404.Apply.sub.-- Props(0)
OPT404.active .rarw. options.sub.-- callouts.Get.sub.--
checkbox() = TRUE;
status .rarw. SUB405.Apply.sub.-- Props(0)
SUB405.Apply.sub.-- Props(0)
result .rarw. FALSE; apply.sub.-- failed .rarw. SUB406.Apply.s
ub.-- Props(0)
SUB406.Apply.sub.-- Props(0)
result .rarw. FALSE; apply.sub.-- failed .rarw. ID407.Apply.su
b.-- Props(0)
ID407.Apply.sub.-- Props(0)
value›0! field of ID node 407 .rarw. value entered by user
into text field widget 304 (i.e. val1)
(a field specifying widget 304 was stored in ID node 407
when widget 304 was created in ID407.Construc.sub.-- Props);
return FALSE to SUB406.Apply.sub.-- Props
SUB406.Apply.sub.-- Props(0)
apply.sub.-- failed .rarw. FALSE;
apply.sub.-- failed .rarw. SUB408.Apply.sub.-- Props(0)
SUB408.Apply.sub.-- Props(0)
result .rarw. FALSE; return result to SUB406.Apply.sub.--
Props
(i.e. Options.sub.-- Callouts.Get.sub.-- Checkbox() returns
FALSE
because user did not check checkbox 305)
SUB406.Apply.sub.-- Props(0)
apply.sub.-- failed .rarw. FALSE;
done .rarw. TRUE (because SUB406.loopdef is
ZERO.sub.-- OR.sub.-- ONE);
return result (=FALSE) to SUB405.Apply.sub.-- Props
SUB405.Apply.sub.-- Props(0)
apply.sub.-- falied .rarw. FALSE;
done .rarw. TRUE (because SUB405.loopdef is TOP.sub.-- ONE);
return result (=FALSE) to OPT404.Apply.sub.-- Props
OPT404.Apply.sub.-- Props(0)
status .rarw. FALSE; return status to SUB403.Apply.sub.--
Props
SUB403.Apply.sub.-- Props(0)
apply.sub.-- failed .rarw. FALSE;
apply.sub.-- failed .rarw. OPT-ARG410.Apply.sub.-- Props(0)
OPT-ARG410. status .rarw. SUB411.Apply.sub.-- Props(0)
Apply.sub.-- Props(0)
SUB411.Apply.sub.-- Props(0)
result .rarw. FALSE;
apply.sub.-- failed .rarw. ID412.Apply.sub.-- Props(0)
ID412.Apply.sub.-- Props(0)
value›0! field of ID node 412 .rarw. value entered by user
into text field widget 310 (i.e. val2)
return FALSE to SUB411.Apply.sub.-- Props
SUB411.Apply.sub.-- Props(0)
apply-failed .rarw. FALSE;
done .rarw. TRUE (because SUB411.loopdef is TOP.sub.-- ONE);
return result (=FALSE) to OPT-ARG410.Apply.sub.-- Props
OPT-ARG410. status .rarw. FALSE; return status to SUB403.Apply.sub.--
Props
Apply.sub.-- Props(0)
SUB403.Apply.sub.-- Props
apply.sub.-- failed .rarw. FALSE;
done .rarw. TRUE (i.e. SUB403.loopdef is TOP.sub.-- ONE);
return result (=FALSE) to CMD402.Apply.sub.-- Props
CMD402.Apply.sub.-- Props
__________________________________________________________________________
Callback for clicking in the Command (Actions) menu to execute a command The callback routine, CommandMenu.sub.-- Callback, is executed upon clicking in the Command (Actions) menu on a command that the user wishes to execute. CommandMenu.sub.-- Callback calls Construct.sub.-- Commands of the CMD object in IDS 13 representing the selected command, in order to construct a UNIX command string using data stored for the selected command in IDS 13. The resulting hierarchy of calls is illustrated in Table 6, assuming that the selected command is "a.example" and the corresponding data for the command in IDS 13 is that associated with Table 5 (i.e. val1 and val2 entered into text widgets 304 and 310, respectively, saved into ID nodes 407 and 412 of IDS 13 , respectively). The result of the processing shown in Table 6 is the creation of the UNIX command string "a.example val2 -P val1", which is placed into a command buffer. Finally, CommandMenu.sub.-- Callback executes the command stored in the command buffer.
TABLE 6
__________________________________________________________________________
Function Actions performed within the function
__________________________________________________________________________
CMD402.Construct.sub.-- Command
clear command buffers;
SUB403.Construct.sub.-- Cornmand
SUB403.Construct.sub.-- Comrnand
OPT404.Construct.sub.-- Command
OPT404.Construct.sub.-- Command
choose before.sub.-- args buffer;
(before.sub.-- args is the default)
append option string "-P" to before.sub.-- args buffer
(-P stored in OPT404.name during creation of IDS
13);
SUB405.Construct.sub.-- Command (before.sub.-- args)
SUB405.Construct.sub.-- Command
SUB406.Construct.sub.-- Command (before.sub.-- args)
(before.sub.-- args)
SUB406.Construct.sub.-- Command
ID407.Construct.sub.-- Command (before.sub.-- args)
(before.sub.-- args)
ID407.Construct.sub.-- Command
append a space and ID407.value›0! (i.e. val1) to
(before.sub.-- args)
before.sub.-- args. buffer;
return to SUB406.Construct.sub.-- Command
SUB406.Construct.sub.-- Command
SUB408.Construct.sub.-- Command (before.sub.-- args).
(before.sub.-- args)
SUB408.Construct.sub.-- Command
return to SUB406.Construct.sub.-- Command
(before.sub.-- args)
(because SUB408.loopcount = 0)
SUB406.Construct.sub.-- Command
return to SUB405.Construct.sub.-- Command
SUB405.Construct.sub.-- Command
return to OPT404.Construct.sub.-- Command
OPT404.Construct.sub.-- Command
return to SUB403.Construct.sub.-- Command
SUB403.Construct.sub.-- Command
OPT-ARG410.Construct.sub.-- Command
OPT-ARG410. choose the.sub.-- args buffer;
Construct.sub.-- Command
SUB411.Construct.sub.-- Command (the.sub.-- args)
SUB411.Construct.sub.-- Command
ID412.Construct.sub.-- Command (the.sub.-- args)
(the.sub.-- args)
ID412.Construct.sub.-- Command
append a space character and ID412.value›0! (i.e.
(the.sub.-- args)
val2) to the.sub.-- args buffer;
return to SUB411.Construct.sub.-- Command
SUB411.Construct.sub.-- Command
return to OPT.sub.-- ARG410.Construct.sub.-- Command
OPT-ARG410. return to SUB403.Construct.sub.-- Command
Construct.sub.-- Command
SUB403.Construct.sub.-- Command
return to CMD402.Construct.sub.-- Command
CMD402.Construct.sub.-- Command
merge CMD402.name (i.e. "a.example")
with before.sub.-- args buffer (i.e. "-P val1") and
the.sub.-- args
buffer (i.e. "val 2") and to obtain final UNIX
command string "a.example -P val1 val2" (in this
example internal.sub.-- args, after.sub.-- args &
last.sub.-- arg buffers
are empty)
__________________________________________________________________________
Callback for checking a checkbox The callback routine, CheckBox.sub.-- Callback is executed whenever any checkbox is checked. XWindows passed to the callback routine a parameter "Checkbox", which is basically a unique identifier (also called a UI handle) for the particular checkbox that was checked. CheckBox.sub.-- Callback first sets the changed flag for the current Command Options window to TRUE and then calls the Activate function of the CMD object in IDS 13 corresponding to the current window. Table 7 shows the hierarchy of function calls that would result upon checking checkbox 302 in the Command options window of FIG. 3. The steps where text label 303, text field 304 and nested checkbox 305 are activated are shown in bold.
TABLE 7
__________________________________________________________________________
Function Actions performed
__________________________________________________________________________
CMD402.Activate (checkbox 302)
SUB403.Activate (checkbox 302)
SUB403.Activate (checkbox 302)
UI .rarw. checkbox 302;
OPT 404.Activate (checkbox 302)
OPT404.Activate (checkbox 302)
UI .rarw. checkbox 302;
SUB405.Activate (checkbox 302)
SUB405.Activate (checkbox 302)
UI .rarw. checkbox 302;
SUB406.Activate (checkbox 302)
SUB406.Activate (checkbox 302)
UI .rarw. checkbox 302;
UI .rarw. NULL (because
SUB406.my.sub.-- ui.sub.-- handle = checkbox 302, as set
in
SUB406.Construct.sub.-- Props); ID407. Activate
(NULL)
ID407.Activate (NULL)
activate local widgets of ID407 (i.e. text label 303
and text field 304); return to SUB406.Activate
SUB406. Activate
SUB408.Activate (NULL)
SUB408.Activate (NULL)
UI .rarw. NULL;
activate local widget of SUB405 (i.e. checkbox
305); return to SUB406.Activate (i.e.
SUB408.loopdef is ZERO.sub.-- OR.sub.-- ONE and checkbox
305 was not checked)
SUB406.Activate return to SUB405.Activate
SUB405.Activate return to OPT404.Activate (because UI in
SUB405.Activate = checkbox 302 =
SUB406.Activate .fwdarw. my.sub.-- ui.sub.-- handle)
OPT404.Activate return to SUB403.Activate
SUB403.Activate OPT-ARG410.Activate (checkbox 302)
OPT-ARG410.Activate
UI .rarw. checkbox 302
(checkbox 302) SUB411.Activate (checkbox 302)
SUB411.Activate (checkbox 302)
UI .rarw. checkbox 302;
ID412.Activate (checkbox 302)
ID412.Activate (checkbox 302)
return to SUB411.Activate (since checkbox 302 .noteq.
NULL)
SUB411.Activate return to OPT-ARG410.Activate
OPT-ARG401.Activate
return to SUB403.Activate
SUB403.Activate return to CMD402.Activate
__________________________________________________________________________
Conclusion In the specific embodiment disclosed herein, the entities of interest (instances of which the user can create and modify via the application GUI) are UNIX shell commands. However, the invention is equally applicable to displaying the structure of other entities (not necessarily commands), particularly entities whose structure is likely to change over time and/or vary between end users of the application. For example, a particular software program might support a command set with an elaborate structure (e.g. many, perhaps rarely used, options and command/option optional arguments). A given user, depending on his or her experience level and needs, might only require the program's GUI to display a subset of the full command set structure (e.g. the user never specifies 19 of 20 possible options of a particular command). Employing the techniques of the invention, the program's GUI could be tailored to the user's requirements by editing the input file of command definitions to reflect a simpler command set (e.g. a command with only 1 instead of 20 options). In this way, the program's efficiency would increase because the widget processing burden associated with command options of no interest to the user would be eliminated. In addition, the GUI would not be cluttered with various widgets distracting the user's attention away from the widgets of interest to him or her. Therefore, the above description should not be taken as limiting the scope of the invention which is defined by the appended claims. Appendix 1 Appendix 1 describes a syntax for specifying command definitions, in one embodiment of the invention. Appendix 2 Appendix 2 provides pseudocode for operations code 14, in one embodiment of the invention. ##SPC1##
|
Same subclass Same class Consider this |
||||||||||
