User defined GUI capability

In ClearTrigger there is a method to create you own dialog windows that ask questions or ask for input without having to write code using clearprompt or worry about temporary file creation or cleanup. Three fields are added to each command key that allows you to define the dialog as a prompt or question , define the displayed prompt, and define the buttons displayed and the default button or string.

;{dialog_type};{dialog_prompt};{dialog_mask or dialog_string or dialog_choices}

Where the first field (dialog_type) is:

Value Defines this feature as...
‘E’ No dialog is requested
‘Q’ A "Question" dialog is requested
‘P’ A "Prompt" dialog is requested
‘S’ A "Selection" dialog is requested
‘A’ An "Advise" dialog is requested
‘M’ A "Multi-Selection" dialog is requested


Where the second field (dialog_prompt) is any string without semi-colons ‘;’ in it.

If the requested dialog is a Question dialog then the third field is a Dialog_Mask that contains a mask string containing button characters in any order from the characters (‘C’,’N’,’Y’):

Value Displays ths button...
‘C’ Cancel button
‘N’ No button
‘Y’ Yes button


Only buttons in the mask are displayed and always in this order Yes, No, Cancel when they exists. The first button requested is the default button and is pre-selected in the displayed dialog.

The command key ending:

;Q;I don’t want you to do this…;C;     or     ;Q;This is a question?;YNC;

Produce dialogs like the ones below respectively:

  

Where the environmental variable CLEARTRIGGER_DIALOG_REPLY would be set to 0 for Yes or 1 for No and is available for use in triggers defined within the command key. When Cancel is selected it always stops the processing.

If the requested dialog is a Prompt dialog then the third field is a Dialog_String that contains a string (possibly empty) that constitutes the displayed default string in a text dialog box.

The command key ending:

;P;Please input a defect number…;;     or     ;P;This is a question?;Default answer…;

Produce dialogs like the ones below respectively:

  

The OK and Cancel buttons are always displayed. The environmental variable CLEARTRIGGER_DIALOG_REPLY would be set to 0 for OK and is available for use in triggers defined within the command key. When Cancel is selected it always stops the processing. The environmental variable CLEARTRIGGER_REPLY_STRING would be set to the input string and is available for use in triggers defined within the command key.

If the requested dialog is a Selection dialog then the third field is a Selection_List that contains a string (must be populated) that constitutes the displayed values to select from (they must be comma ‘,’ separated)..

The command key ending:

;S;Please input a branch mode…;integration,system test, unit test, private;

Produce a dialog like the one below:



The Yes and Abort buttons are always displayed. Only single selection is supported. The environmental variable CLEARTRIGGER_DIALOG_REPLY would be set to 0 for Yes and is available for use in triggers defined within the command key. When Abort is selected it always stops the processing. The environmental variable CLEARTRIGGER_REPLY_STRING would be set to the selected choice and is available for use in triggers defined within the command key.

If the requested dialog is a Multi-Selection dialog then the third field is a Selection_List that contains a string (must be populated) that constitutes the displayed values to select from (they must be comma ‘,’ separated)..

The command key ending:

;M;Which user(s) should be notified…;cclarke,jlungu,rcarter,slewand;

Produce a dialog like the one below:



The Yes and Abort buttons are always displayed. Multiple selection is supported. The environmental variable CLEARTRIGGER_DIALOG_REPLY would be set to 0 for Yes and is available for use in triggers defined within the command key. When Abort is selected it always stops the processing. The environmental variable CLEARTRIGGER_REPLY_STRING would be set to a comma ',' separated list of selected choice(s) and is available for use in triggers defined within the command key.

If the requested dialog is an Advise dialog then the third field is optional and ignored..

The command key ending:

;A;Don't forget to inform QA...;;

Produce a dialog like the one below:



The Yes or OK button is displayed, but the dialog is modeless (does not wait for an answer to continue), does not effect whether or not the command continues or not and is strictly informational in nature... The environmental variables CLEARTRIGGER_DIALOG_REPLY and CLEARTRIGGER_REPLY_STRING are undetermined in this case.