CEikSnakingListBox Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib

Capability Information

Required Capabilities

None


#include <eiklbx.h>

Inherits CEikListBox.

Inherited by CEikSnakingTextListBox.


Detailed Description

This is a list box that scrolls horizontally, displaying its items in as many vertical columns as needed.

Columns are arranged across the control from left to right; within columns, items are arranged from top to bottom. The flow of items or text ‘snakes’ across the face of the control.

This is a flexible control class that makes good use of short, wide display areas; for instance, subclasses of CEikSnakingListBox could be used for file lists or for a control panel. A standard user subclass, CEikSnakingTextListBox, also exists.


Public Member Functions

IMPORT_C  CEikSnakingListBox ()
  C++ standard constructor.
IMPORT_C  ~CEikSnakingListBox ()
  Destructor.
virtual IMPORT_C CListBoxView MakeViewClassInstanceL ()
  Creates an instance of the view class.
virtual IMPORT_C void  SetTopItemIndex (TInt aItemIndex) const
  Sets the top item’s index.
IMPORT_C TInt  ColumnWidth () const
  Gets the width of this list box’s columns.
IMPORT_C void  SetColumnWidth (TInt aColumnWidth)
  Sets the width of all columns in the list box.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Member Functions

virtual IMPORT_C void  HandleViewRectSizeChangeL ()
  Handles a change in size of the viewing rectangle.
virtual IMPORT_C void  HandleLeftArrowKeyL (CListBoxView::TSelectionMode aSelectionMode)
  Handles a left arrow key event.
virtual IMPORT_C void  HandleRightArrowKeyL (CListBoxView::TSelectionMode aSelectionMode)
  Handles a right arrow key event.
virtual IMPORT_C TInt  HorizontalNudgeValue () const
  Gets the number of grains to move horizontally when a nudge button is tapped.
virtual IMPORT_C TInt  HorizScrollGranularityInPixels () const
  Gets the granularity for horizontal scrolls.
virtual IMPORT_C void  AdjustTopItemIndex () const
  Called by various functions of this class to ensure that the top item index is always a sane value.
virtual IMPORT_C void  HandleDragEventL (TPoint aPointerPos)
  Handles drag events.
virtual IMPORT_C void  RestoreClientRectFromViewRect (TRect &aClientRect) const
  Calculates the client area.
virtual IMPORT_C TInt  AdjustRectHeightToWholeNumberOfItems (TRect &aRect) const
  Rounds down the height of the rectangle (if necessary) so that only a whole number of items can be displayed inside the list box.
IMPORT_C void  MoveToNextOrPreviousItemL (TPoint aPoint)
  Move to next or previous item according to the given parameter.
virtual IMPORT_C void  SizeChanged ()
  From CCoeControl.
virtual IMPORT_C void  GetColorUseListL (CArrayFix< TCoeColorUse > &aColorUseList) const
  From CCoeControl.
virtual IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.

Constructor & Destructor Documentation

IMPORT_C CEikSnakingListBox::CEikSnakingListBox  ) 
 

C++ standard constructor.

IMPORT_C CEikSnakingListBox::~CEikSnakingListBox  ) 
 

Destructor.


Member Function Documentation

virtual IMPORT_C TInt CEikSnakingListBox::AdjustRectHeightToWholeNumberOfItems TRect &  aRect  )  const [protected, virtual]
 

Rounds down the height of the rectangle (if necessary) so that only a whole number of items can be displayed inside the list box.

Parameters:
aRect  The rectangle to be modified.
Returns:
The number of pixels reduced.

Reimplemented from CEikListBox.

virtual IMPORT_C void CEikSnakingListBox::AdjustTopItemIndex  )  const [protected, virtual]
 

Called by various functions of this class to ensure that the top item index is always a sane value.

The implementation in CEikListBox tries to ensure the minimum amount of white space at the bottom of the list box. Note that this function does not affect the current item index.

Reimplemented from CEikListBox.

IMPORT_C TInt CEikSnakingListBox::ColumnWidth  )  const
 

Gets the width of this list box’s columns.

Returns:
Width of each column.
virtual IMPORT_C void CEikSnakingListBox::GetColorUseListL CArrayFix< TCoeColorUse > &  aColorUseList  )  const [protected, virtual]
 

From CCoeControl.

Gets the list of logical colours employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.

Parameters:
aColorUseList  List of logical colours.

Reimplemented from CEikListBox.

Reimplemented in CEikSnakingTextListBox.

virtual IMPORT_C void CEikSnakingListBox::HandleDragEventL TPoint  aPointerPos  )  [protected, virtual]
 

Handles drag events.

This function is called by HandlePointerEventL() to handle pointer drag events appropriately.

Parameters:
aPointerPos  The position of the TPointerEvent for which this handler is invoked.

Reimplemented from CEikListBox.

virtual IMPORT_C void CEikSnakingListBox::HandleLeftArrowKeyL CListBoxView::TSelectionMode  aSelectionMode  )  [protected, virtual]
 

Handles a left arrow key event.

Moves the cursor into the correct column and clears any matcher buffer that may have been built up.

Parameters:
aSelectionMode  Not used.

Reimplemented from CEikListBox.

IMPORT_C void CEikSnakingListBox::HandlePointerEventL const TPointerEvent &  aPointerEvent  )  [virtual]
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikListBox.

Reimplemented in CEikSnakingTextListBox.

virtual IMPORT_C void CEikSnakingListBox::HandleResourceChange TInt  aType  )  [protected, virtual]
 

From CCoeControl.

Handles a change to the list box’s resources of type aType which are shared across the environment, colours or fonts for example.

Parameters:
aType  The type of resources that have changed.

Reimplemented from CEikListBox.

Reimplemented in CEikSnakingTextListBox.

virtual IMPORT_C void CEikSnakingListBox::HandleRightArrowKeyL CListBoxView::TSelectionMode  aSelectionMode  )  [protected, virtual]
 

Handles a right arrow key event.

Moves the cursor into the correct column and clears any matcher buffer that may have been built up.

Parameters:
aSelectionMode  Not used.

Reimplemented from CEikListBox.

virtual IMPORT_C void CEikSnakingListBox::HandleViewRectSizeChangeL  )  [protected, virtual]
 

Handles a change in size of the viewing rectangle.

This function is called by framework functions to update the content, view, and scroll bars of this list box after the viewing rectangle has changed size. This implementation ensures that the current item is visible after a resize.

Reimplemented from CEikListBox.

virtual IMPORT_C TInt CEikSnakingListBox::HorizontalNudgeValue  )  const [protected, virtual]
 

Gets the number of grains to move horizontally when a nudge button is tapped.

For simple list boxes, this value is a fraction of the width of the client area.

Returns:
Number of grains to move left or right on each nudge.

Reimplemented from CEikListBox.

virtual IMPORT_C TInt CEikSnakingListBox::HorizScrollGranularityInPixels  )  const [protected, virtual]
 

Gets the granularity for horizontal scrolls.

The granularity is the minimum size of a horizontal move of the client area.

Returns:
Grain size for horizontal scrolling in pixels.

Reimplemented from CEikListBox.

virtual IMPORT_C CListBoxView* CEikSnakingListBox::MakeViewClassInstanceL  )  [virtual]
 

Creates an instance of the view class.

This function is called during construction to create (but not second-phase construct) an instance of the correct view class for this list box control. In the case of the snaking list box, a CSnakingListBoxView is returned.

This function overrides CEikListBox::MakeViewClassInstanceL().

Returns:
The view which will be used by the list box being created

Reimplemented from CEikListBox.

IMPORT_C void CEikSnakingListBox::MoveToNextOrPreviousItemL TPoint  aPoint  )  [protected]
 

Move to next or previous item according to the given parameter.

Parameters:
aPoint  Position which defines the moving direction.
virtual IMPORT_C void CEikSnakingListBox::RestoreClientRectFromViewRect TRect &  aClientRect  )  const [protected, virtual]
 

Calculates the client area.

This method is called by various functions of this class to recalculate the extent of the client area from iViewRect. This implementation takes into account any rounding of the viewing rectangle made to fit a whole number of items.

Parameters:
aClientRect  On return contains a size for the client area in pixels.

Reimplemented from CEikListBox.

IMPORT_C void CEikSnakingListBox::SetColumnWidth TInt  aColumnWidth  ) 
 

Sets the width of all columns in the list box.

Parameters:
aColumnWidth  New column width.
virtual IMPORT_C void CEikSnakingListBox::SetTopItemIndex TInt  aItemIndex  )  const [virtual]
 

Sets the top item’s index.

Parameters:
aItemIndex  Index of the item to set as the top item.

Reimplemented from CEikListBox.

virtual IMPORT_C void CEikSnakingListBox::SizeChanged  )  [protected, virtual]
 

From CCoeControl.

Updates the viewing rectangle of this control appropriately. The function updates the viewing rectangle, and invokes HandleViewRectSizeChangeL().

Reimplemented from CEikListBox.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top