Command Dialog Formatting

The DialogFormatting() method allows a command to apply some customized formatting to its controls in a command dialog. Specifically, it allows the order of the controls (as generated from the command’s arguments) to be changed, dividers to be inserted (with or without a label), and edit fields to be ganged.

Formatting is returned as a string, with each argument presented by its index. For example, this string would return the default ordering of a five argument command:

1
 "0 1 2 3 4"

Each argument is separated by a space. To swap the position of arguments 2 and 3 in the dialog, you’d just swap them in the string. Being able to re-order arguments is useful if you have added a new argument to your command that should be placed earlier in the dialog, but you don’t want to change the argument order due to the risk of breaking scripts that may rely on the original ordering.

1
 "0 1 3 2 4"

To gang related controls together, you wrap them in curly braces. This example gangs the second and third arguments.

1
 "0 1 {2 3} 4"

To insert a divider, use a dash.

1
 "0 1 2 3 - 4"

To name a divider, add the string (preferably as a ./Message Tables lookup, which will automatically be decoded by the command dialog) inside of square braces immediately after the dash.

Any argument not included in the string will be omitted from the dialog. This can be used as an alternative to the HIDDEN argument flag. The command dialog will not open if all arguments are hidden, and the command will simply fail if any of those arguments are required and not set.