Location:
eiklbi.h
Link against:
eikcoctl.lib
CListItemDrawer
Supported from 6.0
Draws individual list box items for a CListBoxView
.
The items may optionally be markable.
Writing derived classes:
This class may be derived from to provide a different appearance for a list box.
|
Defined in CListItemDrawer
:
BackColor()
, CListItemDrawer()
, ClearFlags()
, ClearRect()
, DimmedBackColor()
, DimmedTextColor()
, DrawActualItem()
, DrawFrame()
, DrawItem()
, DrawItemMark()
, ECurrent
, EDrawMarkSelection
, EDrawOnlyActiveSelection
, EEmphasized
, EMask
, EPaintedSelection
, ESelected
, Flags()
, Font()
, Gc()
, HighlightedBackColor()
, HighlightedTextColor()
, ItemWidthInPixels()
, MarkColor()
, MarkColumn()
, MarkGutter()
, MatcherCursorAscent()
, MatcherCursorRect()
, MinimumCellSize()
, Properties()
, ResetGc()
, SetBackColor()
, SetData()
, SetDimmedBackColor()
, SetDimmedTextColor()
, SetDrawMark()
, SetFlags()
, SetGc()
, SetHighlightedBackColor()
, SetHighlightedTextColor()
, SetItemCellSize()
, SetMarkColumnWidth()
, SetMarkGutter()
, SetSymbolFont()
, SetTextColor()
, SetVerticalInterItemGap()
, SetViewRect()
, SetupGc()
, TFlags
, TListItemAttribute
, TextColor()
, VerticalInterItemGap()
, iBackColor
, iData
, iDimmedBackColor
, iDimmedTextColor
, iDrawMark
, iGc
, iHighlightedBackColor
, iHighlightedTextColor
, iItemCellSize
, iMarkColor
, iMarkColumnWidth
, iMarkGutter
, iTextColor
, iViewRect
, ~CListItemDrawer()
Inherited from CBase
:
operator new()
protected: CListItemDrawer();
Constructs a list item drawer.
Note that the graphics context is not yet set; initialisation may be completed with SetGc()
.
void SetItemCellSize(const TSize& aSizeInPixels);
Sets the item cell size.
The cell size is the on-screen size of the entire item, including its text and its item mark.
|
virtual void SetViewRect(const TRect& aRect);
Sets the viewing rectangle for this item drawer.
This value is not used by CListItemViewer
, but may be used by its derived classes; see iViewRect
.
|
virtual void SetGc(CWindowGc* aGc);
Sets the graphics context which this object uses for drawing.
|
CWindowGc* Gc() const;
Gets the graphics context. See iGc
.
|
protected: virtual void ResetGc() const;
Resets the pen style, brush style, brush colour etc. to suitable starting values for this class.
This function is called after every drawing operation.
protected: void SetupGc(TInt aItemIndex) const;
Sets up the graphics context for the specified item.
|
virtual void DrawItem(TInt aItemIndex, TPoint aItemRectPos,
TBool aSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized,
TBool aViewIsDimmed) const;
Draws the entire item.
This function is called by the list box view. As implemented in CListItemDrawer
, this function draws the item text using DrawActualItem()
, and an item mark using DrawItemMark()
.
|
static void DrawFrame(CWindowGc& aGc,const TRect& aRect,TInt aFlags);
Draws the frame.
Uses the colours set with the fonts and colour functions described above.
|
virtual void ClearRect(const TRect& aRect) const;
Clears the specified rectangle of this object's graphics context.
|
protected: virtual void DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const = 0;
Draws item text.
This function is called by CListItemDrawer::DrawItem()
with appropriate arguments. Its purpose is to draw the actual item — everything other than the item mark — into the graphics context.
|
virtual TInt ItemWidthInPixels(TInt aItemIndex) const;
Gets the width of the specified item.
|
|
virtual TSize MinimumCellSize() const;
Gets the minimum cell size.
|
void SetVerticalInterItemGap(TInt aGapInPixels);
Sets the vertical gap between items in the list.
|
protected: TInt VerticalInterItemGap() const;
Gets the vertical gap between items in pixels.
|
void SetDrawMark(TBool aDrawMark);
Sets whether item tick marks are drawn.
If the draw mark flag iDrawMark
is set, DrawItem()
leaves space for the marks column to the left of the text column, and DrawItemMark()
draws the item marks.
|
virtual void DrawItemMark(TBool aSelected, TBool aViewIsDimmed,const TPoint& aMarkPos) const;
Draws an item tick mark.
A tick mark is used in multiple selection lists to indicate an item is selected.
This function is invoked by the framework to draw an item mark if iDrawMark
is set. The mark should be drawn into this list item drawer's graphics context; by default, DrawItemMark()
draws a tick using the standard symbol font.
This function does not need to be re-implemented for derived classes which do not draw item marks.
|
virtual void SetMarkColumnWidth(TInt aWidthInPixels);
Sets the width of the column containing the mark.
|
TInt MarkColumn() const;
Gets the width of the item tick mark column.
|
virtual void SetMarkGutter(TInt aGapInPixels);
Sets the width of the gap between the column containing the lists item marks and the text column.
|
TInt MarkGutter() const;
Gets the width of the gap between the column containing the list's item marks and the text column.
|
TRgb MarkColor() const;
Gets the colour used to draw tick marks.
A tick mark usually indicates that an item is selected.
|
List item drawers can represent the current position in an incremental match (see CEikListBox
) by drawing a cursor at the appropriate location. Derived classes that deal with text and want to support incremental matching in list boxes need to redefine these functions.
virtual TRect MatcherCursorRect(const TDesC& aMatchableText, TInt aCharPos, TInt aItemCellYPos) const;
Gets a rectangle describing where the matcher cursor should be drawn.
The default behaviour is to return an uninitialised TRect
.
|
|
virtual TInt MatcherCursorAscent() const;
Gets the ascent of the matcher cursor.
This is obtained for the item at index aCurrentItemIndex
determined from the ascent of the font used for that item.
The function returns 0 by default.
|
void SetData(CListBoxData* aData);
Sets the font storage data for the item drawer and transfers ownership of that data.
|
void SetSymbolFont(const CFont* aFont);
Sets the symbol font use by this item drawer.
The symbol font is used to draw the standard tick item marks.
|
CFont* Font(TInt aItemIndex) const;
Gets the font for the specified item.
The function returns NULL if no font storage data has been set.
|
|
void SetBackColor(TRgb aColor);
Sets the colour used to draw the background for non-highlighted items.
|
TRgb BackColor() const;
Gets the colour used to draw the background for non-highlighted items.
|
void SetHighlightedBackColor(TRgb aColor);
Sets the colour used to draw the background for highlighted items.
|
TRgb HighlightedBackColor() const;
Gets the colour used to draw the background for highlighted items.
|
void SetDimmedTextColor(TRgb aColor);
Sets the colour used to draw dimmed text.
|
TRgb DimmedTextColor() const;
Gets the colour used to draw dimmed text.
|
void SetDimmedBackColor(TRgb aColor);
Sets the colour used to draw the background for dimmed items.
|
TRgb DimmedBackColor() const;
Gets the colour used to draw the background for dimmed items.
|
void SetHighlightedTextColor(TRgb aColor);
Sets the colour used to draw highlighted text.
|
TRgb HighlightedTextColor() const;
Gets the colour used to draw highlighted text.
|
void SetTextColor(TRgb aColor);
Sets the colour used to draw non-highlighted text.
|
TRgb TextColor() const;
Gets the colour used to draw non-highlighted text.
|
void SetFlags(TInt aFlags);
Sets the item drawer flags.
|
void ClearFlags(TInt aFlags);
Clears the specified item drawer flags.
|
TListItemProperties Properties(TInt aItemIndex) const;
Gets the colour and style properties of the specified item.
|
|
TInt iMarkGutter;
Width of the gutter between the item mark column and the rest of the item cell.
TFlags enum
Provides list box attributes for handling multiple selections. These flags can be set using the CListItemDrawer::SetFlags
function.
|
TListItemAttribute
Provides attributes for list items.
|