Syntax
ListBox *ListBoxNew( int top, int left, int bottom, int right, int dropDown );
Arguments
top, left, bottom, right the inclusive screen bounds. NIL is invalid for any coordinate.
dropDown use T for a drop-down list or F or NIL for an always-open list. Any other nonzero value enables drop-down mode.
Return value
The new ListBox object, or NULL when a coordinate is NIL. Release it with ListBoxFree().
Description
Include xdev-wtui-classes.h. The list starts empty, without a selected item or input focus. The caption and message are empty, and the caption starts at `top, left`. The default frames are `B_SINGLE` without focus and `B_DOUBLE` with focus.
An always-open list starts with its item area open. A drop-down list starts closed and uses the top row for the current choice and the `▼` button. The constructor saves the screen region below the top row. `ListBoxOpen()` captures it again when the drop-down opens so `ListBoxClose()` can restore it.
Add choices with `ListBoxAddItem()`, set the initial selection with `ListBoxSelect()` and draw with `ListBoxDisplay()`. The C control draws on a terminal with characters and colors. The xBase bitmap property applies to graphical mode. The C methods for drawing and selection use logical results so the caller can check success directly.