#include <CUIListBox.h>
Inheritance diagram for CUIListBox:
Public Types | |
enum | EListBoxOptions { KTransparentDraw = 0x01, KConstItemHeight = 0x02, KDefaultOptions = KTransparentDraw | KConstItemHeight } |
ListBox behavior options. More... | |
Public Member Functions | |
CUIListBox (const CUIRect &aRectangle, const char *aTitle, MUIWidgetEvents *aObserver) | |
Constructs the CUIListBox class. | |
virtual void | Draw () |
Draws this widget on the virtual screen. | |
virtual bool | HandlePenEvent (MInputReader::TTouchEventData &aData) |
Reacts on touch screen event. | |
virtual bool | HandleKeyEvent (MInputReader::TKeyEventData &aData) |
Reacts on keyboard or remote control input event. | |
virtual bool | SetActive (bool aActive) |
Changes the iActive property of this widget. | |
virtual void | RestoreBackground (CUIRect &aRect) |
Redraws the background in given rectangle. | |
virtual unsigned int | GetItemsNumber ()=0 |
Returns the number of items in the ListBox. | |
virtual unsigned int | GetItemHeight (unsigned int aItemIndex)=0 |
Returns the height of item with given index. | |
virtual void | DrawItem (unsigned int aItemIndex, CUIRect &aRect)=0 |
Draws specified item in a given rectangle. | |
void | CalculateParameters () |
Calculates basic list parameters such as number of items per pare, etc. | |
Public Attributes | |
unsigned int | iNrItemsPerPage |
unsigned int | iPage |
int | iSelected |
EListBoxOptions | iOptions |
List Box is a control that can show a number of items (strings or other widgets) in a separate window on the screen. It is not necessary that all items are always visible the controls also shows scrolling bars allowing the user to scroll among its items.
CUIListBox implements basic drawing, control management and events constumption mechanism. Derived classes should implement its abstract methods in order to be instantiated. See GetItemsNumber(), GetItemHeight() and DrawItem()
|
ListBox behavior options.
|
|
Constructs the CUIListBox class.
|
|
Calculates basic list parameters such as number of items per pare, etc. Should be called in the constructor of derived class. Calls GetItemHeight(0) See also GetItemHeight() |
|
Draws this widget on the virtual screen. The library does not provide any clipping mechanism, so the widget is completely responsible for drawing in its iRectangle. If the widget should be drawn fully or partially transparently over its iParent, it should call iParent->RestoreBackground() for every transparent region Reimplemented from CUIWidgetGroup. |
|
Returns the height of item with given index. If KConstItemHeight is among the iOptions only GetItemHeight(0) is called by the CUIListBox. GetItemHeight( 0 ) is also called from the CalculateParameters() so the derived class must be ready to return a correct value even if the ListBox contains no items yet. Implemented in CUIStringListBox, CUIRadioButtonListBox, and CUICheckListBox. |
|
Reacts on keyboard or remote control input event. It is permitted to re-draw this or other widgets as a response on this event. In this case the CUIEventLoop flushes the virtual screen automatically to ensure that it is displayed. In some cases it's necessary to completely re-draw the whole screen. If it's needed, the handling code should set CUIEventLoop::GetEventLoop().iForceFullRedraw to true.
Reimplemented from CUIWidgetGroup. |
|
Reacts on touch screen event. Returns true if the event was consumed. It is permitted to re-draw this or other widgets as a response on this event. In this case the CUIEventLoop flushes the virtual screen automatically to ensure that it is displayed. In some cases it's necessary to completely re-draw the whole screen. If it's needed, the handling code should set CUIEventLoop::GetEventLoop().iForceFullRedraw to true. Note that because of nature of the touchscreen, the widget could receive PenUp event (aData.iPressure == 0) with the aData.iX and aData.iY pointing outside of iRectangle of this widget. In this case the widget should not react for such an event or perform necessary cleanup if it has reacted on PenDown event (aData.iPressure != 0 ).
Reimplemented from CUIWidgetGroup. |
|
Redraws the background in given rectangle. This method is used by transparent children that need to redraw itself. Full screen redraw is very expensive and much oftet it's only needed to redraw a small screen part
Implements CUIWidgetGroup. |
|
Changes the iActive property of this widget. Returns true if the state was changed Active widgets may Draw themselves with differently and they receive keyboard and remote control events. Only one visible widget could be active at a time. Reimplemented from MUIWidget. |
|
Number of items per page |
|
ListBox options |
|
Currently active page number |
|
Index of selected item, -1 when no item is selected |