Utility Dialog: String List Editor / RiverWare 6.7 / May 2015
Phil Weinstein, CADSWES. Edit: 6-01-2015
A general purpose dialog class supporting the editing of a string list having unique string elements was developed for RiverWare 6.7. The String List Editor supports two dialog modes:
- Full List Editing
- List Reordering

These dialogs are shown modally, i.e. use of the dialog must be completed before other RiverWare dialogs can be operated.
All visible text referring to application-level use (purpose) of these strings is configurable. This applies also to tool tips on various GUI controls. (See sample invocations below).
These dialogs currently support the following character validation modes:
- No validation: all characters are acceptable.
- RiverWare Name validation: alpha-numeric characters, underscore ("_"), and space.
- Unit Scheme Name validation: same as above, plus period (".").
The Full List Editing mode supports the following operations. The List Reordering mode supports a subset of these operations.
- Add String (green "plus" icon button). This is enabled only if the entered string (with leading and trailing space trimmed, and internal contiguous white space condensed to single spaces) is not represented within the list.
- Modify String ("Apply" button). This is enabled only if exactly one item in the string list is selected and the entered string is different from the selected string, with the space-simplification changes described in the prior item.
- Move Selected Strings Up or Down (up and down arrow buttons).
- Delete Selected Strings (red "X" icon button).
The following operations, including system clipboard operations, are provided via a context menu within the list:
- Copy All and Copy Selected Strings. Either the full list, or only the selected string items are copied to the system clipboard, with one item per line. That is, the copied list items are separated with new-line characters.
- Paste Append and Paste Replace All. The individual lines in the system clipboard which represent valid new strings for the string list are added to the list. (The "Replace All" variation first removes all of the list's current strings). Lines which contain characters not conforming to the configured validation mode are quietly ignored, as are blank lines. (Space-simplification changes are first applied to the clipboard lines). Any clipboard lines which are already in the list are first removed from the list. Only the first 1000 valid lines from the system clipboard are pasted. After the paste operation, the item selection represents the newly added items.
- Select All. All items in the list are selected. This is useful for determining the number of strings in the list, as indicated in a status message at the bottom of the dialog, and for preparing to delete all items with the red "X" icon button.
- Sort. Sorts the strings in the list.
- Reverse Order. Reverses the current order of strings in the list.
The OK button is enabled only if the current list (including string item order) is different from the original list (i.e. as it was when the dialog was shown).
- Note that although the subset of items which are selected is settable by the client code, and returned to that client, a change in the item selection is not considered significant for the purpose of the enabledness of the OK button. The related UniqueNameEntryDlg utility dialog would be more appropriate for applications where the selection of a single item within a string list is needed. As suggested by that module name, the entry of a new unique name is supported. That module supports the same "character validation" modes as the String List Editor being described in this document.
The Close button label changes to "Cancel" if any changes to the list have been made (i.e. when the OK button is enabled).
As mentioned above, all visible text referring to the use of the strings in the string list is configurable. This is done through parameters to the utility function which shows and "runs" the String List Editor dialog. Examples of typical uses for the two modes of this dialog are illustrated below.


The first use of this dialog -- in the Full List Editing mode -- is an enhancement to the Excel Dataset Single Run Name configuration. A list of common run names can be defined within the Excel Dataset. This list shows up in the Single Run Name combo box, and in a new related Script Action for setting an Excel Dataset's Single Run Name. The clipboard copy/paste operations provided by the String List Editor support copying this common run names list between different Excel Datasets. (This works even between Excel Datasets in different run instances of the RiverWare program).
The String List Editor's List Reordering mode may be used to satisfy a new requirement to reorder the Slot Curve Legends in a RiverWare Plot.
--- (end) ---