Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GRDSTD.H>
Link against: grid.lib

Class CGridImg

class CGridImg : public CBase;

Description

Draws the contents of the grid.

Derivation

Members

Defined in CGridImg:

Inherited from CBase:


Construction and destruction


~CGridImg()

IMPORT_C virtual ~CGridImg();

Description

Destructor.

Frees resources before destruction of the object.


NewL(CGraphicsDevice *,CGridCellImg *,CGridLay *)

IMPORT_C static CGridImg* NewL(CGraphicsDevice *aGraphicsDevice, CGridCellImg *aGridCellImg, CGridLay *aGridLay);

Description

Creates a new grid image object.

Parameters

CGraphicsDevice *aGraphicsDevice

The graphics device to be used for drawing.

CGridCellImg *aGridCellImg

A pointer to an object that draws the contents of a single cell.

CGridLay *aGridLay

A pointer to the object that controls the layout of rows and columns.

Return value

CGridImg *

A pointer to the new grid image object.


NewL(CGridCellImg *,CGridLay *)

IMPORT_C static CGridImg* NewL(CGridCellImg *aGridCellImg, CGridLay *aGridLay);

Description

Creates a new grid image object suitable for printing.

Parameters

CGridCellImg *aGridCellImg

A pointer to an object that draws the contents of a single cell.

CGridLay *aGridLay

A pointer to the object that controls the layout of rows and columns.

Return value

CGridImg *

A pointer to the new grid image object.

[Top]


Member functions


SetGridLay(CGridLay *)

inline void SetGridLay(CGridLay *aGridLay);

Description

Sets the specified grid layout object.

Parameters

CGridLay *aGridLay

A pointer to the object that controls the layout of rows and columns.


SetWindow(RWindow *)

inline void SetWindow(RWindow *aWin);

Description

Sets the specified window.

Parameters

RWindow *aWin

A pointer to the currently active window.


SetGridLabelImg(CGridLabelImg *)

IMPORT_C void SetGridLabelImg(CGridLabelImg *aGridLabelImg);

Description

Sets an object that draws a cell label.

Parameters

CGridLabelImg *aGridLabelImg

A pointer to an object that draws a cell label.


SetCursorMoveCallBack(MGridCursorMoveCallBack *)

inline void SetCursorMoveCallBack(MGridCursorMoveCallBack *aCursorMoveCallBack);

Description

Sets the cursor moved call-back object.

The call-back object encapsulates the implementation of a call-back function that is called whenever there is a change to the cursor position.

Parameters

MGridCursorMoveCallBack *aCursorMoveCallBack

A pointer to the callback object.


Selected()const

inline const CGridCellRegion* Selected() const;

Description

Gets the currently selected region.

Return value

const CGridCellRegion *

A pointer to the selected region object.


GridLabelImg()const

inline const CGridLabelImg* GridLabelImg() const;

Description

Gets the the object that is used to draw a cell label.

Return value

const CGridLabelImg *

A pointer to the object that is used to draw a cell label.


ScrollL(const TPoint &)

IMPORT_C void ScrollL(const TPoint &aOffset);

Description

Scrolls the grid by the specified number of pixels.

Draws the minimum necessary, i.e. grid labels, grid lines, grid cells, selected regions and the cursor.

Parameters

const TPoint &aOffset

Scroll offset, in pixels.


MoveCursorL(TMoveDirectionAndAmount,TUint)

IMPORT_C void MoveCursorL(TMoveDirectionAndAmount aCursorMove, TUint aSelectState);

Description

Moves the cursor to the specified position.

The screen is scrolled as necessary.

Parameters

TMoveDirectionAndAmount aCursorMove

Defines the direction and the amount by which the cursor is to be moved.

TUint aSelectState

Flag. If set to EIsWithSelect, then the cursor may become part of the selected region.


SetCursorWithPointerL(const TPoint &,TUint)

IMPORT_C void SetCursorWithPointerL(const TPoint &aPoint, TUint aFlagList);

Description

Moves the cursor to an absolute position.

Parameters

const TPoint &aPoint

The absolute position.

TUint aFlagList

Flag. Can be set to EIsWithDrag.


ResetSelectedL()

IMPORT_C void ResetSelectedL();

Description

Clears the selected region.


AddRangeToSelectedL(const TRangeRef &,TSelectType)

IMPORT_C void AddRangeToSelectedL(const TRangeRef &aRange, TSelectType aType=ESelectOverwrite);

Description

Adds the specified range to, or replaces, the currently selected region.

The range can be added to the existing selected region or it can replace the existing selected region.

Parameters

const TRangeRef &aRange

The range to be added.

CGridImg::TSelectType aType

Indicates whether the existing selected region is to be reset (i.e. emptied) before adding the new range.


AddRegionToSelectedL(const CArrayFix< TRangeRef > *,TSelectType)

IMPORT_C void AddRegionToSelectedL(const CArrayFix< TRangeRef > *aCellRegion, TSelectType aType=ESelectOverwrite);

Description

Adds the specified region to, or replaces, the currently selected region.

The region can be added to the existing selected region, or it can replace the existing selected region.

Parameters

const CArrayFix< TRangeRef > *aCellRegion

A set of ranges that form the region to be added.

CGridImg::TSelectType aType

Indicates whether the existing selected region is to be reset (i.e. emptied) before adding the new region.


AddRowToSelectedL(TInt,TSelectType)

IMPORT_C void AddRowToSelectedL(TInt aRow, TSelectType aType=ESelectOverwrite);

Description

Adds a row to, or replaces, the currently selected region.

The row can be added to the existing selected region, or it can replace the existing selected region.

Parameters

TInt aRow

The row to be added.

CGridImg::TSelectType aType

Indicates whether the existing selected region is to be reset (i.e. emptied) before adding the new region.


AddColToSelectedL(TInt,TSelectType)

IMPORT_C void AddColToSelectedL(TInt aCol, TSelectType aType=ESelectOverwrite);

Description

Adds a column to, or replaces, the currently selected region.

The column can be added to the existing selected region, or it can replace the existing selected region.

Parameters

TInt aCol

The column to be added.

CGridImg::TSelectType aType

Indicates whether the existing selected region is to be reset (i.e. emptied) before adding the new region.


DrawL(CGraphicsContext *)const

IMPORT_C void DrawL(CGraphicsContext *aGc) const;

Description

Draws the entire grid and its contents.

Parameters

CGraphicsContext *aGc

The graphics context to be used for drawing.


DrawL(CGraphicsContext *,const TRect &)const

IMPORT_C void DrawL(CGraphicsContext *aGc, const TRect &aRect) const;

Description

Draws the grid and its contents that are visible within the specified rectangle.

Parameters

CGraphicsContext *aGc

The graphics context to be used for drawing.

const TRect &aRect

Drawing of the grid is restricted to this rectangle.


DrawCellL(const TCellRef &)const

IMPORT_C void DrawCellL(const TCellRef &aCell) const;

Description

Draws the content of the specified cell.

Parameters

const TCellRef &aCell

The cell to be drawn.


DrawRangeL(const TRangeRef &)const

IMPORT_C void DrawRangeL(const TRangeRef &aRange) const;

Description

Draws the rectangle corresponding to the specified range.

Parameters

const TRangeRef &aRange

The range to be drawn.


DrawSelectedL()const

IMPORT_C void DrawSelectedL() const;

Description

Draws the currently selected region.


DrawTitleLines()const

IMPORT_C void DrawTitleLines() const;

Description

Draws the title lines.


ClearTitleLineRegionL(const TPoint &)const

IMPORT_C void ClearTitleLineRegionL(const TPoint &aCrossPoint) const;

Description

Clears the region where the the title lines are.

Parameters

const TPoint &aCrossPoint

Any point within the title region.


PrintGridLinesAndCellsInRangeL(CGraphicsContext *,const TRangeRef &,TInt)const

IMPORT_C void PrintGridLinesAndCellsInRangeL(CGraphicsContext *aPrinterGc, const TRangeRef &aRange, TInt aScaleFactor) const;

Description

Prints the grid lines and cells in the specified range.

Parameters

CGraphicsContext *aPrinterGc

The printer graphics context.

const TRangeRef &aRange

The cell range.

TInt aScaleFactor

The scale factor. A value of: 2, scales down by a half; 4, scales down by a quarter, etc.


CursorPos()const

inline TCellRef CursorPos() const;

Description

Gets the current position of the cursor.

Return value

TCellRef

The cell reference of the current cursor position.


SetCursorPosL(const TCellRef &)

IMPORT_C void SetCursorPosL(const TCellRef &aCursorPos);

Description

Sets the new position of the cursor.

This is the proposed position that the cursor would occupy after a keypress.

Parameters

const TCellRef &aCursorPos

The cell reference of the new cursor position.


NewCursorPos()const

inline TCellRef NewCursorPos() const;

Description

Gets the new position of the cursor.

Return value

TCellRef

The cell reference of the new cursor position.

See also:


AnchorPos()const

inline TCellRef AnchorPos() const;

Description

Gets the cursor's anchor position.

This is the cell reference of the position that the cursor must return to after a series of selected movements have been made.

Return value

TCellRef

The cell reference of the cursor's anchor position.


SetAnchorPosL(const TCellRef &)

IMPORT_C void SetAnchorPosL(const TCellRef &aAnchorPos);

Description

Sets the cursor's anchor position.

Note that the cursor's anchor position is unchanged if the specified position lies outside the currently selected region.

Parameters

const TCellRef &aAnchorPos

The cell reference of the cursor's anchor position.


GridRect()const

inline TRect GridRect() const;

Description

Gets the rectangle containing the grid.

Return value

TRect

The rectangle containing the grid.


SetGridRect(const TRect &)

IMPORT_C void SetGridRect(const TRect &aNewRect);

Description

Sets the rectangle that is to contain the grid.

Parameters

const TRect &aNewRect

The rectangle that is to contain the grid.


SetPrintGridRect(const TRect &)

IMPORT_C void SetPrintGridRect(const TRect &aPrintRect);

Description

Sets the rectangle that is to contain the grid for the purpose of printing.

Parameters

const TRect &aPrintRect

The rectangle that is to contain the grid.


TitlePoint()const

inline TPoint TitlePoint() const;

Description

Gets the position of the title.

This is the point at the top left of the grid excluding the labels.

Return value

TPoint

The position of the title.


MainPoint()const

inline TPoint MainPoint() const;

Description

Gets the position at which the visible range starts.

Return value

TPoint

The position at which the visible range starts.


MainRect()const

inline TRect MainRect() const;

Description

Gets the rectangle that corresponds to the visible range.

Return value

TRect

The rectangle that corresponds to the visible range.


ResetReferencePoints()

IMPORT_C void ResetReferencePoints();

Description

Resets the reference points.

The reference points are the mainpoint and the titlepoint, i.e the point at which the visible range starts, and the point at the top left of the grid not including the labels.


NotifyGridRangeResize()

IMPORT_C void NotifyGridRangeResize();

Description

Resets the region boundary to the grid boundary.


CheckSideLabelWidthAndScrollL()

IMPORT_C void CheckSideLabelWidthAndScrollL();

Description

Checks the side label width and, if changed, scrolls the screen.


CheckSideLabelWidth()

IMPORT_C TInt CheckSideLabelWidth();

Description

Checks whether there has been a change in the width of the side label.

Return value

TInt

The difference between the new width and the old width (new width


SideLabelWidthInPixels()const

IMPORT_C TInt SideLabelWidthInPixels() const;

Description

Gets the width of the side label.

Return value

TInt

The width of the side label, in pixels.


MaxSideLabelWidthInPixels()const

IMPORT_C TInt MaxSideLabelWidthInPixels() const;

Description

Gets the maximum width of the side label.

Return value

TInt

The maximum width of the side label, in pixels.


TopLabelHeightInPixels()const

IMPORT_C TInt TopLabelHeightInPixels() const;

Description

Gets the height of the top labels.

Return value

TInt

The height of the top labels, in pixels.


FinishLabelDragL()

IMPORT_C void FinishLabelDragL();

Description

Deals with the end of a drag operation.

Typically, the function is called whan handling a pointer event in a control.

The function removes the dotted drag line indicating a drag operation, and, if necessary, updates the column width/row height, and then scrolls and redraws the necessary regions.

See also:


StartLabelDrag(const TPoint &)

IMPORT_C TBool StartLabelDrag(const TPoint &aPoint);

Description

Deals with the start of a drag operation.

Typically, the function is called whan handling a pointer event in a control.

The function checks that the pointer event is within 10 pixels of the boundary between label cells, and draws a dotted line along the row or column boundary together with pairs of arrows on either side of that line, and prepares for the continuation or end of a drag operation on the boundary separating a row or a column (to expand or contract that row or column).

The dotted line is a visual indication that a drag operation is in progress.

Parameters

const TPoint &aPoint

The position of the pointer event.

Return value

TBool

True, if the pointer event marks the start of a drag operation, and dragging is permitted; false otherwise.


UpdateLabelDrag(const TPoint &)

IMPORT_C TBool UpdateLabelDrag(const TPoint &aPoint);

Description

Deletes the dotted drag line and and redraws it at the new pointer position.

Typically, the function is called whan handling a pointer event in a control.

Parameters

const TPoint &aPoint

The position of the pointer event.

Return value

TBool

True, if a drag operation was in progress; false, otherwise.


StartLabelResize(TBool,TInt)

IMPORT_C TBool StartLabelResize(TBool aIsColumnLabel, TInt aIndex);

Description

Begins the resizing of a column or a row.

Parameters

TBool aIsColumnLabel

Indicates whether a column or row is to be resized: specify ETrue for a column; specify EFalse for a row.

TInt aIndex

Identifes the row or column to be resized. This value increases from left to right for a column, and from top to bottom for a row.

Return value

TBool

True, if resizing has begun; false otherwise.


UpdateLabelResize(TInt)

IMPORT_C TBool UpdateLabelResize(TInt aDelta);

Description

Changes the size of the row or column currently being resized.

Parameters

TInt aDelta

The amount, in pixels, by which the size of the row or column is being changed.

Return value

TBool

True, if a row or column is being resized; false, otherwise.


FinishLabelResizeL(TBool)

IMPORT_C void FinishLabelResizeL(TBool aResize);

Description

Completes the resizing of a row or column.

Parameters

TBool aResize

ETrue, to complete the resizing of the row or column; EFalse, if the row or column is to retain its original size.

[Top]


Member enumerations


Enum anonymous

n/a

Description

EIsWithSelect

Indicates that the selection state is to be maintained.

If a region of cells is selected, then this selection is to be kept.

Typically, this is set by a control when a drag operation is in progress and the shift modifier key is also pressed.

EIsWithControl

Indicates that the control modifier key has been pressed.

EIsWithDrag

Indicates that a drag operation is in progress.

EIsAtBoundary

Indicates that the cursor is the edge of the grid.

EIsAbsoluteMove

Indicates that a new cell is being selected, without dragging.

EIsRowSelected

Indicates that a whole row is selected.

EIsColumnSelected

Indicates that a whole column is selected.

This also means that the label cell for the column is included in the selection.


Enum anonymous

n/a

Description

EScaleOneToOne

Defines a scale value of 100.

Scale factor values are divided into this value to calculate drawing points, rectangles etc.


Enum TSelectType

TSelectType

Description

ESelectOverwrite

Indicates that an existing selected region is to be reset (i.e. emptied) before adding a new region.

ESelectAppend

Indicates that a new region is to be appended to any existing selected region.