Synopsis

DPK_listUI [flags]

The command is NOT Undoable, NOT Queryable, and NOT Editable

Return Value

string[] - A string array with two elements. The first is the created window’s name, the second is the full path to the textScrollList of the UI.

Description

With this command, you can quickly create windows which already contain layouts and controls for showing a list and some buttons. The list is the MEL textScrollList (which I refer to as a TSL). You can specify various options for the window, the list, and the buttons. Above the list, there can optionally be a label text.

Flags

Flags (short/long)Argument(s)Return

-win/-window

string

 

The name of the window to be created.

-t/-title

string

 

The title string of the window.

-s/-sizeable

bool

 

Specifies whether or not the window can be resized by the user.

-tb/-titleBar

bool

 

Specifies whether the window’s title bar should be visible.

-mnb/-minimizeButton

bool

 

Specifies whether the window’s minimize button should be visible.

-mxb/-maximizeButton

bool

 

Specifies whether the window’s maximize button should be visible.

-mb/-menuBar

bool

 

Adds a menu bar to the window.

-mbv/-menuBarVisible

bool

 

Specifies the visibility of the menu bar.

-te/-topEdge

int

 

Specifies the position of the top edge of the window.

-le/-leftEdge

int

 

Specifies the position of the left edge of the window.

-tlc/-topLeftCorner

int int

 

Specifies the position of the top left corner of the window.

-w/-width

int

 

Specifies the width of the window.

-h/-height

int

 

Specifies the height of the window.

-wh/-widthHeight

int int

 

Specifies the width and height of the window.

-rtf/-resizeToFitChildren

bool

 

If set to true, the window will grow so that all controls fit into it. If not set, the -nr flag has no effect. Default is false.

-vis/-visible

bool

 

If set to true, the window will be shown after creation. If left at its default of false, the window will stay hidden until a showWindow has been executed on it.

-rp/-removePrefs

bool

 

If set to true, the stored window’s preferences are removed before the window is created. If a window has stored prefs and they are not removed, they overwrite the width, height, and position. Default is false.

-ll/-listLabel

string

 

Text to display above the list.

-lla/-listLabelAlign

string

 

Alignment of the -ll text. Valid values are left, right, and center.

-llf/-listLabelFont

string

 

The font of the -ll text. Possible values are:

    boldLabelFont
    smallBoldLabelFont
    tinyBoldLabelFont
    plainLabelFont
    smallPlainLabelFont
    obliqueLabelFont
    smallObliqueLabelFont
    fixedWidthFont
    smallFixedWidthFont

-ams/-allowMultiSelection

bool

 

If set to true, more than one item can be selected in the TSL. Default is false.

-dcc/-doubleClickCommand

string

 

The script to execute when an item is double-clicked in the list.

-dkc/-deleteKeyCommand

string

 

The script to execute when the delete key is pressed.

-nr/-numberOfRows

int

 

Specifies the height of the list using the number of items the list should be able to display.

-sc/-selectCommand

string

 

The script to execute when an item is selected in the list.

-lf/-listFont

string

 

The font of the list’s text. Possible values are:

    boldLabelFont
    smallBoldLabelFont
    tinyBoldLabelFont
    plainLabelFont
    smallPlainLabelFont
    obliqueLabelFont
    smallObliqueLabelFont
    fixedWidthFont
    smallFixedWidthFont

-fl/-fillList

string[]

 

The elements of the specified string array will be shown in the list. Empty strings are ignored. To make a blank entry in the list, use a space.

-b/-buttons

string[]

 

This string array contains the labels of the buttons the UI should have. The buttons will be positioned at the bottom of the window and are distributed from left to right in the order they are listed in this array.

-bc/-buttonCommands

string[]

 

The strings in this array will be executed when their corresponding button is pressed. If specified, the array has to have the same length as the -buttons list.

Examples

The following example will create a window that should look like this:

// Create a listUI with two buttons ("OK" and "Cancel"). The "Cancel" button
// will close the UI. The "OK" button will just print it was pressed.
DPK_listUI
    -t   "Example Window"
    -win "testWin"
    -vis true
    -wh  180 1
    -rtf true
    -rp  true
    -ll  "Some Colors:"
    -lla "center"
    -llf "boldLabelFont"
    -dcc "print \"// Double-Click!\\n\""
    -nr  5
    -fl  {"Red", "Green", "Blue", "Yellow", "Orange"}
    -b   {"OK", "Cancel"}
    -bc  {"print \"// OK button pressed!\\n\"",
          "deleteUI -window \"testWin\""};
// Result: testWin testWin|FL|FL|TSL1 //

// The second string of the result array is the textScrollList. Change its
// selectCommand.
textScrollList -edit -sc "print \"// Select!\\n\"" "testWin|FL|FL|TSL1";