LISTBOX

From SEGGER Wiki
Jump to: navigation, search

LISTBOX widgets are used to select one element of a list. A list box can be created without a surrounding frame window, or as a child window of a FRAMEWIN widget. As items in a list box are selected, they appear highlighted. Note that the background color of a selected item depends on whether the list box window has input focus.

LISTBOX
Listbox.gif
Receives focus Yes
Skinnable No
OwnerDraw Yes
Uses Memory Devices No
Attached widgets

Notification codes

The following events are sent from a LISTBOX widget to its parent window as part of a WM_NOTIFY_PARENT message:

Message Description
WM_NOTIFICATION_CLICKED LISTBOX has been clicked.
WM_NOTIFICATION_RELEASED LISTBOX has been released.
WM_NOTIFICATION_MOVED_OUT LISTBOX has been clicked and pointer has been moved out of the LISTBOX widget without releasing.
WM_NOTIFICATION_SCROLL_CHANGED The scroll position of the optional scroll bar has been changed.
WM_NOTIFICATION_SEL_CHANGED The selection of the LISTBOX widget has changed.

Keyboard reaction

The LISTBOX widget reacts to the following keys if it has the input focus:

Message Description
GUI_KEY_SPACE If the widget works in multi selection mode this key toggles the state of the current selected item.
GUI_KEY_RIGHT If the maximum X-size of the list box items is larger than the list box itself this key scrolls the list box content to the left.
GUI_KEY_LEFT If the maximum X-size of the list box items is larger than the list box itself this key scrolls the list box content to the right.
GUI_KEY_DOWN Moves the selection bar down.
GUI_KEY_UP Moves the selection bar up.

Samples

Below are links to samples that demonstrate how to use BUTTON widgets in emWin.