Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CUIWidgetGroup Class Reference

Represents a group of widgets. More...

#include <CUIWidgetGroup.h>

Inheritance diagram for CUIWidgetGroup:

MUIWidget CUIListBox CUIScreen CUICheckListBox CUIRadioButtonListBox CUIStringListBox List of all members.

Public Member Functions

 CUIWidgetGroup (const CUIRect &aRectangle)
 Basic constrcutor.

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 void SetColorScheme (MColorScheme *aColorScheme)
 Sets the custom color scheme for this widget.

virtual void SetFont (MFont *aFont)
 Sets the custom font for this widget.

virtual bool AddWidget (MUIWidget *aChild)
 Adds a new widget to this group. Returns true if succeeded.

virtual bool DeleteWidget (MUIWidget *aChild)
 Deletes a widget from this group. Returns true if succeeded.

virtual bool ContainsWidget (MUIWidget *aChild)
 returns true if this group contains given widget

virtual unsigned int GetWidgetsNumber ()
 Returns number of widgets in this group.

virtual void Clear ()
 Deletes all widgets from this group.

virtual void RestoreBackground (CUIRect &aRect)=0
 Redraws the background in given rectangle.


Protected Types

enum  { KMaxWidgets = 64 }

Protected Member Functions

MUIWidgetFindWidget (const CUIPoint &aPosition) const
 Returns the pointer to MUIWidget interface of child that is pointed by given position.

bool ActivateNextWidget (int aDirection) const
 Activates next child as a reaction on keyboard or remote control input.

MUIWidgetFindActiveWidget (int aDirection, int *aIndex) const
 Returns the pointer to MUIWidget interface of current active child.

MUIWidgetFindDefaultActiveWidget (int aDirection, int *aIndex) const
 Returns the pointer to MUIWidget interface of first widget available for activation if there is no active widget yet.


Protected Attributes

MUIWidgetiPreviousWidget
MUIWidgetiWidgets [KMaxWidgets]

Detailed Description

Represents a group of widgets.

CUIWidgetGroup is an abstract container for a number of MUIWidgets It distributes its events among aproppriate children and takes care about their redrawing


Member Function Documentation

bool CUIWidgetGroup::ActivateNextWidget int  aDirection  )  const [protected]
 

Activates next child as a reaction on keyboard or remote control input.

Returns true if a child was activated

Parameters:
aDirection Direction to move in the m_Widgets array relatively to current . active child -1 means move backwards, 1 forward

virtual void CUIWidgetGroup::Draw  )  [virtual]
 

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

Implements MUIWidget.

Reimplemented in CUIListBox, and CUIScreen.

MUIWidget* CUIWidgetGroup::FindActiveWidget int  aDirection,
int *  aIndex
const [protected]
 

Returns the pointer to MUIWidget interface of current active child.

If there is no active widget, calls FindDefaultActiveWidget() to find an appropriate candidate for activation

Parameters:
aDirection Direction to move in the m_Widgets array if there is no active widget. -1 means look from the end, 1 - from the beginning
aIndex Pointer to a integer that receives index in m_Widgets array of current active widget. Can be NULL.

MUIWidget* CUIWidgetGroup::FindDefaultActiveWidget int  aDirection,
int *  aIndex
const [protected]
 

Returns the pointer to MUIWidget interface of first widget available for activation if there is no active widget yet.

Parameters:
aDirection Direction to move in the m_Widgets array if there is no active widget. -1 means look from the end, 1 - from the beginning
aIndex Pointer to a integer that receives index in m_Widgets array of current active widget. Can be NULL.

virtual bool CUIWidgetGroup::HandleKeyEvent MInputReader::TKeyEventData aData  )  [virtual]
 

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.

Warning:
The full screen redraw could be very time consuming and should be used carefully

Implements MUIWidget.

Reimplemented in CUIListBox.

virtual bool CUIWidgetGroup::HandlePenEvent MInputReader::TTouchEventData aData  )  [virtual]
 

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 ).

Warning:
The full screen redraw could be very time consuming and should be used carefully

Implements MUIWidget.

Reimplemented in CUIListBox.

virtual void CUIWidgetGroup::RestoreBackground CUIRect aRect  )  [pure virtual]
 

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

Parameters:
aRect CUIRect to redraw

Implemented in CUIListBox, and CUIScreen.

virtual void CUIWidgetGroup::SetColorScheme MColorScheme aColorScheme  )  [virtual]
 

Sets the custom color scheme for this widget.

Parameters:
aColorScheme A pointer to MColorScheme interface. Can be NULL to reset to default color scheme

Reimplemented from MUIWidget.

virtual void CUIWidgetGroup::SetFont MFont aFont  )  [virtual]
 

Sets the custom font for this widget.

Parameters:
aFont A pointer to MFont interface. Can be NULL to reset to default font

Reimplemented from MUIWidget.


Member Data Documentation

MUIWidget* CUIWidgetGroup::iPreviousWidget [protected]
 

Previous widget that consumed the pen event

MUIWidget* CUIWidgetGroup::iWidgets[ KMaxWidgets ] [protected]
 

Array pointers to children


The documentation for this class was generated from the following file:
Generated on Fri Jul 15 16:46:44 2005 for TomTom GO User Interface library by doxygen 1.3.5