class MASKING_DLL_DECLSPEC ListItem

The base class for making different kinds of items that can be put in a ListBox.

Inheritance:

ListItem


Public Fields

[more]ListView* parent
The item's parent ListView
[more]bool selected
True if the item is selected, false otherwise

Public Methods

[more]virtual void Draw(Bitmap &canvas, Bitmap &skinBitmap, int state)
Draws the list item background onto the canvas.
[more]virtual int h()
Returns the height of the list item.
[more]virtual char* GetText() const
Returns the items text if any.


Documentation

The base class for making different kinds of items that can be put in a ListBox. It defines a kind of an interface for all derived list item classes to implement. ListItem itself doesn't implement anything else but drawing the item background but derived classes may draw text, bitmaps, etc.

ovirtual void Draw(Bitmap &canvas, Bitmap &skinBitmap, int state)
Draws the list item background onto the canvas. By default skinBitmap is the list item bitmap. Note that a list item can have up to eight different states and not just the familiar four (normal, selected, disabled and focused). The list item's states are as follows:
      0 - list does not have focus, item is not selected
      1 - list does not have focus, item is selected
      2 - list has focus, item is not the focus item, item is not selected
      3 - list has focus, item is the focus item, item is not selected
      4 - list has focus, item is the focus item, item is selected
      5 - list has focus, item is not the focus item, item is selected
      6 - list is disabled, item is not selected
      7 - list is disabled, item is selected
This only applies to multiselect lists. In normal mode only states 0, 1, 5 and 6 are possible and are equivalent to the familiar states NORMAL, SELECTED, FOCUSED and DISABLED.

Derived classes should normally first call this function to draw the background, and then draw themselves on top of it.

ovirtual int h()
Returns the height of the list item. By default this function returns the height of the item bitmap but derived classes should return the actual height of the item.

ovirtual char* GetText() const
Returns the items text if any. This implementation returns NULL.

oListView* parent
The item's parent ListView

obool selected
True if the item is selected, false otherwise


Direct child classes:
ListItemString
See Also:
ListBox, ListView, ListBoxEx

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++