Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: eiklbv.h
Link against: eikcoctl.lib

Class CSnakingListBoxView

CSnakingListBoxView

Support

Supported from 6.0

Description

List box view for snaking list boxes.

The view is responsible for drawing items and maintaining the selection status.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CListBoxViewList box view
CSnakingListBoxViewList box view for snaking list boxes

Defined in CSnakingListBoxView:
CSnakingListBoxView(), CalcBottomItemIndex(), CalcDataWidth(), CalcItemIndexFromRowAndColIndexes(), CalcNewTopItemIndexSoItemIsVisible(), CalcRowAndColIndexesFromItemIndex(), CalculateHScrollOffsetSoItemIsVisible(), ClearUnusedItemSpace(), ColumnWidth(), Draw(), DrawColumnRange(), DrawItemRange(), HScroll(), ItemPos(), ItemSize(), MoveCursorL(), MoveToNextColumnL(), MoveToPreviousColumnL(), NumberOfItemsPerColumn(), NumberOfItemsThatFitInRect(), ScrollToMakeItemVisible(), SetColumnWidth(), SetItemHeight(), SetTopItemIndex(), UpdateHScrollOffsetBasedOnTopItemIndex(), VisibleWidth(), XYPosToItemIndex(), iColumnWidth, ~CSnakingListBoxView()

Inherited from CBase:
operator new()

Inherited from CListBoxView:
BackColor(), BottomItemIndex(), CSelectionIndexArray, ClearFlags(), ClearSelection(), ClearSelectionAnchorAndActiveIndex(), ConstructL(), CurrentItemIndex(), DataWidth(), DeselectItem(), DrawItem(), DrawMatcherCursor(), EAnchorExists, EContiguousSelection, ECursorFirstItem, ECursorLastItem, ECursorNextColumn, ECursorNextItem, ECursorNextPage, ECursorPreviousColumn, ECursorPreviousItem, ECursorPreviousPage, EDimmed, EDisableRedraw, EDisjointSelection, EEmphasized, EHasMatcherCursor, ENoSelection, ESingleSelection, Flags(), GetSelectionIndexesL(), HScrollOffset(), HideMatcherCursor(), IsVisible(), ItemDrawer(), ItemIsSelected(), ItemIsVisible(), MatcherCursorPos(), RedrawDisabled(), SelectItemL(), SelectRangeL(), SelectionIndexes(), SetAnchor(), SetBackColor(), SetCurrentItemIndex(), SetDimmed(), SetDisableRedraw(), SetEmphasized(), SetFlags(), SetHScrollOffset(), SetMatcherCursor(), SetMatcherCursorColor(), SetMatcherCursorPos(), SetPaintedSelection(), SetSelectionIndexesL(), SetTextColor(), SetViewRect(), SetVisibilityObserver(), TCursorMovement, TFlags, TSelectionMode, TextColor(), ToggleItemL(), TopItemIndex(), UpdateSelectionL(), VScrollTo(), VerticalMoveToItemL(), ViewRect(), iBottomItemIndex, iCurrentItemIndex, iDataWidth, iFlags, iGc, iGroupWin, iHScrollOffset, iItemDrawer, iItemHeight, iModel, iTopItemIndex, iViewRect, iWin

See also:


Construction and destruction


CSnakingListBoxView()

CSnakingListBoxView();

Description

Default constructor.


~CSnakingListBoxView()

~CSnakingListBoxView();

Description

Destructor.

[Top]


Column widths


ColumnWidth()

TInt ColumnWidth() const;

Description

Gets the width of all columns in the view.

Return value

TInt

The width of all columns in the view, in pixels.


SetColumnWidth()

void SetColumnWidth(TInt aColumnWidth);

Description

Sets the width of all columns in the view.

Parameters

TInt aColumnWidth

The required width of all columns in the view, in pixels.

[Top]


View position

Description

The following functions affect the location of the view within the list.


SetTopItemIndex()

virtual void SetTopItemIndex(TInt aItemIndex);

Description

Sets which item appears at the top left corner of the view. The function changes items displayed in the view appropriately.

Parameters

TInt aItemIndex

Index of the item to set at the top left.


ScrollToMakeItemVisible()

virtual TBool ScrollToMakeItemVisible(TInt aItemIndex);

Description

Makes the specified item visible by moving the view location and redrawing the control.

Parameters

TInt aItemIndex

Index of the item to make visible.

Return value

TBool

ETrue if the control was redrawn, EFalse if no redraw happened (i.e. the item was already visible, or redraw was disabled).


HScroll()

virtual void HScroll(TInt aHScrollAmount);

Description

Scrolls horizontally by a number of columns.

Parameters

TInt aHScrollAmount

Number of columns to move. A positive value scrolls to the right, a negative value scrolls to the left.


CalculateHScrollOffsetSoItemIsVisible()

virtual TInt CalculateHScrollOffsetSoItemIsVisible(TInt aItemIndex);

Description

Gets the number of columns that this view would need to be scrolled by to make the specified item visible. The function returns 0 if no scrolling is needed.

ScrollToMakeItemVisible() uses this function.

Parameters

TInt aItemIndex

Item to make visible.

Return value

TInt

The number of columns to scroll, or zero if no scrolling is needed.


CalcNewTopItemIndexSoItemIsVisible()

virtual TInt CalcNewTopItemIndexSoItemIsVisible(TInt aItemIndex) const;

Description

Gets the item the view would need to be moved to in order to make the specified item visible.

Parameters

TInt aItemIndex

The item to make visible.

Return value

TInt

The item to scroll to to make aItemIndex visible.

See also:


CalcBottomItemIndex()

virtual void CalcBottomItemIndex();

Description

Recalculates the bottom item’s index.

This function is called by the list box control when either the size of the list box or the number of items in its model changes. In CSnakingListBox, this function calculates the bottom right item’s index.

[Top]


Selection


MoveCursorL()

virtual void MoveCursorL(TCursorMovement aCursorMovement,TSelectionMode aSelectionMode);

Description

Responds to cursor movement commands sent by the list box control, updating the selection appropriately if a selection mode has been set for the action.

Parameters

TCursorMovement aCursorMovement

A cursor movement action.

TSelectionMode aSelectionMode

The selection mode in use for that action.

[Top]


Drawing


Draw()

virtual void Draw(const TRect* aClipRect = NULL) const;

Description

Draws the portion of the view inside the specified rectangle into iGc. This function is called by the control’s own Draw() function.

Parameters

const TRect* aClipRect = NULL

Clipping rectangle. NULL means redraw the entire view.

[Top]


Item and list dimensions


ItemSize()

virtual TSize ItemSize(TInt aItemIndex=0) const;

Description

Gets the size of the specified item.

Parameters

TInt aItemIndex=0

The index of the item whose size this call is to get.

Return value

TSize

The size of the item in pixels.


SetItemHeight()

virtual void SetItemHeight(TInt aItemHeight);

Description

Sets item height in pixels.

Parameters

TInt aItemHeight

New height in pixels for this view’s items.


NumberOfItemsThatFitInRect()

virtual TInt NumberOfItemsThatFitInRect(const TRect& aRect) const;

Description

Gets the largest number of items that could fit inside the specified rectangle. This virtual function is used internally for layout of the view.

Parameters

const TRect& aRect

A rectangle.

Return value

TInt

The largest number of items that could fit in the rectangle.


CalcDataWidth()

virtual void CalcDataWidth();

Description

Calculates the data width in columns. iDataWidth is calculated based on model and drawer information.


VisibleWidth()

TInt VisibleWidth(const TRect& aRect) const;

Description

Gets the visible width of the specified rectangle in pixels.

Parameters

const TRect& aRect

The rectangle for which to get the visible width.

Return value

TInt

Visible width of aRect in pixels.

[Top]


Column contents


NumberOfItemsPerColumn()

TInt NumberOfItemsPerColumn() const;

Description

Gets the number of items that can fit in a column.

Return value

TInt

The number of items that can fit in a column.

[Top]


Column positions and indices


CalcRowAndColIndexesFromItemIndex()

void CalcRowAndColIndexesFromItemIndex(TInt aItemIndex,TInt& aRowIndex,TInt& aColIndex) const;

Description

Converts an item index into the (row, column) pair describing that item.

Parameters

TInt aItemIndex

The item index.

TInt& aRowIndex

Returns the row index.

TInt& aColIndex

Returns the column index.

See also:


CalcItemIndexFromRowAndColIndexes()

void CalcItemIndexFromRowAndColIndexes(TInt& aItemIndex,TInt aRowIndex,TInt aColIndex) const;

Description

Converts a (row, column) pair into the item index for that item.

Parameters

TInt& aItemIndex

Returns the item index.

TInt aRowIndex

Row index of the item.

TInt aColIndex

Column index of the item.

See also:


XYPosToItemIndex()

virtual TBool XYPosToItemIndex(TPoint aPosition,TInt& aItemIndex) const;

Description

Converts an (x, y) pixel position to an item index.

The function returns ETrue and sets aItemIndex to the index of the item whose bounding box contains aPosition; returns EFalse if no such item exists.

Parameters

TPoint aPosition

Pixel position in the viewing rectangle.

TInt& aItemIndex

On return: the index of the appropriate item.

Return value

TBool

ETrue if aItemIndex has been set to a valid item.


ItemPos()

virtual TPoint ItemPos(TInt aItemIndex) const;

Description

Gets the position of the top left corner of the specified item, in pixels.

Parameters

TInt aItemIndex

An item in the model.

Return value

TPoint

Position of the top left corner of the item, in pixels.

[Top]


Protected member functions


DrawItemRange()

protected: void DrawItemRange(TInt aStartItemIndex,TInt aEndItemIndex) const;

Description

Draws every item between the start and end indices inclusively.

Parameters

TInt aStartItemIndex

First item to draw.

TInt aEndItemIndex

Final item to draw.

See also:


DrawColumnRange()

protected: void DrawColumnRange(TInt aStartColIndex,TInt aEndColIndex) const;

Description

Draws every item in every column between the start and end columns inclusively.

Parameters

TInt aStartColIndex

First column to draw.

TInt aEndColIndex

Last column to draw.

See also:


MoveToPreviousColumnL()

protected:void MoveToPreviousColumnL(TSelectionMode aSelectionMode);

Description

Move to previous column. Whether the selection is updated depends on aSelectionMode.

Parameters

TSelectionMode aSelectionMode

Determines whether and how the selection is updated.


MoveToNextColumnL()

protected:void MoveToNextColumnL(TSelectionMode aSelectionMode);

Description

Move to next column. Whether the selection is updated depends on aSelectionMode.

Parameters

TSelectionMode aSelectionMode

Determines whether and how the selection is updated.


ClearUnusedItemSpace()

protected:void ClearUnusedItemSpace(TInt aStartItemIndex,TInt aEndItemIndex) const;

Description

Clears each item’s rectangle between the specified start and finish item’s indexes.

Parameters

TInt aStartItemIndex

First item to clear.

TInt aEndItemIndex

Last item to clear.


UpdateHScrollOffsetBasedOnTopItemIndex()

protected: void UpdateHScrollOffsetBasedOnTopItemIndex();

Description

Updates the horizontal scroll offset (iHScrollOffset) based on the top item’s index. This function is called internally by CEikSnakingListBoxes when needed.

[Top]


Protected data members


iColumnWidth

TInt iColumnWidth

Description

The width of a column in pixels.