List Box

Microchip Graphics Library

Microchip Graphics Library
List Box

List Box supports both Touchscreen and Keyboard inputs, replying to their events with the following messages: 

LB_MSG_TOUCHSCREEN – Item is selected using touch screen 

LB_MSG_MOVE – Focus is moved to the next item depending on the key pressed (UP or DOWN key). 

LB_MSG_SEL – Selection is set to the currently focused item. 

 

The List Box Object is rendered using the assigned style scheme. The following figure illustrates the color assignments. Icons can be added to each item when adding items to the list using LbAddItem(). 

 

 

Functions
 
Name 
Description 
 
This function creates a LISTBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object. 
 
This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.
The text or items drawn in the visible window of the list box is dependent on the alignment set.
When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering. 
 
This function allocates memory for the LISTITEM and adds it to the list box. The newly created LISTITEM will store the location of pText, pBitmap and other parameters describing the added item. 
 
This function removes an item from the list box and frees the memory used. 
 
This function changes the selection status of an item in the list box. If the item is currently selected, it resets the selection. If the item is currently not selected it is set to be selected. 
 
This function searches for selected items from the list box. A starting position can optionally be given. If starting position is set to NULL, search will begin from the first item list. It returns the pointer to the first selected item found or NULL if there are no items selected. 
 
This function returns the index of the focused item in the list box. 
 
This function sets the focus for the item with the given index. 
 
This function removes all items from the list box and frees the memory used. 
 
This function performs the actual state change based on the translated message given. The following state changes are supported:  
 
This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
 
Macros
Name 
Description 
This function returns the pointer to the current item list used in the list box. 
This macro sets the selection status of an item to selected. 
This macro returns the number of items in the list box. 
This macro returns the number of items visible in the list box window. 
This macro sets the bitmap used in the item. 
This macro returns the location of the currently used bitmap for the item. 
Structures
Name 
Description 
Defines the parameters required for a list box Object. 
Defines the parameters required for a list item used in list box. 
Topics
Name 
Description 
List of List Box bit states. 
List of Items status. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved