Shiny Language Reference
Language Reference > User Interface > List Boxes
createlistbox
int createlistbox(int ID, int X, int Y, int Width, int Height);
Creates a list box in the display panel
The CREATELISTBOX statement creates a user interface list box in the plugin display panel. Listboxes within Brass work exactly the same way as the Windows list control. They are designed to store an arbitrary number of text lines, displayed in a scrolling list. The number of visible lines in a listbox is determined by the height of the font selected for use. Brass does not currently support multiple selections in listboxes. Listboxes respond to the up and down arrow keys, page up, page down, home and end keys. The scrollbar only appears when more items are associated with the listbox than it can display in a single "page".
Every user interface element is assigned a "control ID". This ID uniquely references an individual control and is the method by which you access and manage the control. This is analogous to the win32 HWND or HANDLE objects. Note that Brass controls are not Windows controls and can only be accessed via the appropriate Shiny language statements.
CREATELISTBOX is the only statement you must call to create a working list box in the display panel. The remaining list box statements are provided for extra functionality and ease of use, however they are not mandatory.
Unlike Windows, Brass allows controls to be stacked on top of each other. Controls are ordered visually in the same order that they are created. Therefore to display smaller button A on top of larger editbox B, create editbox B before button A. This technique allows for controls-in-controls, for example to place a "Browse" button inside an edit box, where the edit box is used to select a folder.
Parameters
ID
Your preferred control ID for this control. You may specify any positive (greater than 0) integer for a control ID. If you specify a control ID that is already in use, the CREATELISTBOX statement will return a new, unique ID for this control. Therefore you should assume that any value supplied for this parameter is only a suggestion, and the return value is the absolute control ID. You may specify integer 1 for every call to this statement, which will cause CREATELISTBOX to return sequential control IDs for you, removing the need to store the last used control ID.
X
The X pixel position within the display panel of the top left of the list control
Y
The Y pixel position within the display panel of the top left of the list control
Width
The width in pixels of the list control
Height
The height in pixels of the list control
Return Value
The actual control ID assigned to this control.
Example Code
// Create the edit box X: 10, Y:10 and sized 200*120
int iListBoxID = createlistbox(1, 10, 10, 200, 120);