The IListBoxDrawItemHandler class processes list box
draw-item events.
Create a handler derived from IListBoxDrawItemHandler and attach it to a list box
or its owner window.
You can do this by calling
IListBoxDrawItemHandler::handleEventsFor.
When the list box draw-item handler receives a list box draw-item event,
it creates an IListBoxDrawItemEvent or IListBoxSizeItemEvent object
and routes that object to the appropriate
IListBoxDrawItemHandler virtual function.
Override these virtual functions to supply your own specialized processing
of a list box draw-item event.
See
IListBoxDrawItemEvent
and
IListBoxSizeItemEvent
for information about these classes.
The return value from the virtual functions specifies whether the list box draw-item
event should be passed on for additional processing, as follows:
Note:
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IListBoxDrawItemHandler()
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
public:
IListBoxDrawItemHandler()
The only way to construct an object of this class is to use the default constructor, which does not accept any arguments.
Windows | OS/2 | AIX |
Yes | Yes | No |
Use these members in the dispatching of events by the handler. These members evaluate events for potential processing or are used to attach the handler to a list box or its owner window.
![]() |
Attaches the handler to process item-drawing events for the specified window. You can attach the handler to a list box or to its owner window.
public:
virtual IListBoxDrawItemHandler& handleEventsFor( IWindow* listBoxOwner )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IListBoxDrawItemHandler& handleEventsFor( IListBox* listBox )
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
Calls the appropriate virtual function if a list box draw-item event is found.
Windows | OS/2 | AIX |
Yes | Yes | No |
Use these members to process specific requests in support of drawing a list box item. You can override these virtual members in a derived class.
![]() |
protected:
virtual bool deselectItem(IListBoxDrawItemEvent& event)
Called when a list box item is deselected. Override this function if you want to remove the highlight to indicate a list item has been deselected. Do this only if the system default method is unacceptable. To prevent the system default method from altering the item, call IListBoxDrawItemEvent::setSelectionStateDrawn, and return true.
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
protected:
virtual bool drawItem(IListBoxDrawItemEvent& event)
Called when a list box item needs to be drawn or refreshed. Override this function to draw the list item. By default, the system applies selected-state emphasis (inverts the bits used to display the item) to indicate list-item selection. Unless the system default method is unacceptable, you do not have to draw the list item.
If you draw the list item yourself, return true from this function. You can additionally control whether the windowing system draws any highlighting to indicate whether the item is selected. To prevent the system default method from altering the highlighting of the item, call IListBoxDrawItemEvent::setSelectionStateDrawn before returning true.
The IListBoxDrawItemEvent class provides isSelected to query whether the list item is selected.
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
protected:
virtual bool selectItem(IListBoxDrawItemEvent& event)
Called when a list box item is selected. Override this function if you want to draw the highlighting that indicates the list item has been selected. Do this only if the system default of inverting the bits for a selected item is unacceptable. To prevent the system default method from altering the item, call IListBoxDrawItemEvent::setSelectionStateDrawn and return true.
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
protected:
virtual bool setItemSize(IListBoxSizeItemEvent& event)
Called if any of the following occurs:
Windows | OS/2 | AIX |
Yes | Yes | No |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0