Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: GRDSTD.H
Link against: grid.lib

Class CGridImg

class CGridImg : public CBase;

Description

Draws the contents of the grid.

Derivation

Members

Defined in CGridImg:
AddColToSelectedL(), AddRangeToSelectedL(), AddRegionToSelectedL(), AddRowToSelectedL(), AnchorPos(), CheckSideLabelWidth(), CheckSideLabelWidthAndScrollL(), ClearTitleLineRegionL(), CursorPos(), DrawCellL(), DrawL(), DrawL(), DrawRangeL(), DrawSelectedL(), DrawTitleLines(), EIsAbsoluteMove, EIsAtBoundary, EIsColumnSelected, EIsRowSelected, EIsWithControl, EIsWithDrag, EIsWithSelect, EScaleOneToOne, ESelectAppend, ESelectOverwrite, FinishLabelDragL(), FinishLabelResizeL(), GridLabelImg(), GridRect(), MainPoint(), MainRect(), MaxSideLabelWidthInPixels(), MoveCursorL(), NewCursorPos(), NewL(), NewL(), NotifyGridRangeResize(), PrintGridLinesAndCellsInRangeL(), ResetReferencePoints(), ResetSelectedL(), ScrollL(), Selected(), SetAnchorPosL(), SetCursorMoveCallBack(), SetCursorPosL(), SetCursorWithPointerL(), SetGridLabelImg(), SetGridLay(), SetGridRect(), SetPrintGridRect(), SetWindow(), SideLabelWidthInPixels(), StartLabelDrag(), StartLabelResize(), TSelectType, TitlePoint(), TopLabelHeightInPixels(), UpdateLabelDrag(), UpdateLabelResize(), anonymous, anonymous, ~CGridImg()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CGridImg()

virtual IMPORT_C ~CGridImg();

Description

Destructor.

Frees resources before destruction of the object.


NewL()

static IMPORT_C 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()

static IMPORT_C 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()

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

inline void SetWindow(RWindow *aWin);

Description

Sets the specified window.

Parameters

RWindow *aWin

A pointer to the currently active window.


SetGridLabelImg()

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

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

inline const CGridCellRegion *Selected() const;

Description

Gets the currently selected region.

Return value

const CGridCellRegion *

A pointer to the selected region object.


GridLabelImg()

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

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

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

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

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.

TSelectType aType

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


AddRegionToSelectedL()

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.

TSelectType aType

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


AddRowToSelectedL()

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.

TSelectType aType

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


AddColToSelectedL()

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.

TSelectType aType

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


DrawL()

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

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

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

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

IMPORT_C void DrawSelectedL() const;

Description

Draws the currently selected region.


DrawTitleLines()

IMPORT_C void DrawTitleLines() const;

Description

Draws the title lines.


ClearTitleLineRegionL()

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

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

inline TCellRef CursorPos() const;

Description

Gets the current position of the cursor.

Return value

TCellRef

The cell reference of the current cursor position.


SetCursorPosL()

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

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

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

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

inline TRect GridRect() const;

Description

Gets the rectangle containing the grid.

Return value

TRect

The rectangle containing the grid.


SetGridRect()

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

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

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

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

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

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

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

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

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

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

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

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

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.