Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: eikmenup.h
Link against: eikcoctl.lib

Class CEikMenuPaneItem

CEikMenuPaneItem

Support

Supported from 6.0

Description

A menu item in a menu pane.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CEikMenuPaneItemA menu item in a menu pane

Defined in CEikMenuPaneItem:
CEikMenuPaneItem(), ConstructFromResourceL(), CreateIconL(), DrawItemIcon(), IconBitmap(), IconMask(), NewL(), NewLC(), SData, SetBitmapsOwnedExternally(), SetIcon(), SetIconBitmapL(), SetIconMaskL(), iData, iHotKeyCode, iPos, ~CEikMenuPaneItem()

Inherited from CBase:
operator new()


Construction and destruction


CEikMenuPaneItem()

CEikMenuPaneItem();

Description

Default constructor.


NewL()

static CEikMenuPaneItem* NewL(TInt aResourceId);

Support

Supported from 6.1

Description

Allocates and constructs a new menu pane item from a MENU_ITEM resource with ID aResourceId.

Returns a pointer to the menu pane item and transfers ownership.

Parameters

TInt aResourceId

The ID of the MENU_ITEM resource used to construct the menu pane item.

Return value

CEikMenuPaneItem*

Pointer to the new menu pane item.


NewLC()

static CEikMenuPaneItem* NewLC(TInt aResourceId);

Support

Supported from 6.1

Description

Allocates and constructs a new menu pane item from a MENU_ITEM resource with ID aResourceId.

Returns a pointer to the menu pane item and transfers ownership, leaving the pointer on the cleanup stack.

Parameters

TInt aResourceId

The ID of the MENU_ITEM resource used to construct the menu pane item.

Return value

CEikMenuPaneItem*

Pointer to the new menu pane item.


ConstructFromResourceL()

void ConstructFromResourceL(TResourceReader& aReader);

Support

Supported from 6.1

Description

Completes construction of the menu pane item from a resource. This function is called by NewL() and NewLC().

Parameters

TResourceReader& aReader

The resource file reader.


~CEikMenuPaneItem()

~CEikMenuPaneItem();

Description

Destructor.

[Top]


Member functions


CreateIconL()

void CreateIconL(CFbsBitmap* aBitmap, CFbsBitmap* aMask);

Description

Construct an icon from bitmaps.

Constructs a new icon for the menu item, taking ownership of the picture bitmap aBitmap and the mask bitmap aMask unless the bitmaps are externally owned.

Parameters

CFbsBitmap* aBitmap

Picture bitmap.

CFbsBitmap* aMask

Mask bitmap.


DrawItemIcon()

void DrawItemIcon(CWindowGc& aGc, TRect aRect, TBool aDimmed, TInt aBitmapSpaceRequired) const;

Description

Draws the menu item icon.

Parameters

CWindowGc& aGc

Graphics context to which the icon is drawn.

TRect aRect

Rectangle in which the icon is drawn.

TBool aDimmed

If ETrue the icon is drawn dimmed.

TInt aBitmapSpaceRequired

Length of one side of the square required to contain the bitmap.


IconBitmap()

CFbsBitmap* IconBitmap() const;

Description

Gets a pointer to the menu item's icon picture bitmap.

This does not imply transfer of ownership.

Return value

CFbsBitmap*

Picture bitmap.


IconMask()

CFbsBitmap* IconMask() const;

Description

Returns a pointer to the menu item's icon mask bitmap.

This does not imply transfer of ownership.

Return value

CFbsBitmap*

Mask bitmap.


SetBitmapsOwnedExternally()

void SetBitmapsOwnedExternally(TBool aOwnedExternally);

Description

Sets icon bitmap ownership.

Sets the menu item's icon bitmaps as externally owned if aOwnedExternally is ETrue.

Parameters

TBool aOwnedExternally

If ETrue bitmaps are set as externally owned. If EFalse bitmaps are set as not being externally owned.


SetIcon()

void SetIcon(CGulIcon* aIcon);

Description

Sets a menu item icon.

This replaces any icon already set for the menu item.

Parameters

CGulIcon* aIcon

Menu item icon consisting of a picture bitmap and a mask bitmap.


SetIconBitmapL()

void SetIconBitmapL(CFbsBitmap* aBitmap);

Description

Sets the picture bitmap.

Transfers ownership unless the bitmaps are already owned externally.

Parameters

CFbsBitmap* aBitmap

Picture bitmap.


SetIconMaskL()

void SetIconMaskL(CFbsBitmap* aMask);

Description

Sets the mask bitmap.

Transfers ownership unless the bitmaps are already owned externally.

Parameters

CFbsBitmap* aMask

Mask bitmap.

[Top]


Structs


Struct SData

struct SData

Description

Structure passed as an argument to CEikMenuPane::AddMenuItem() when dynamically adding a menu item to a pane.

See also MEikMenuObserver::DynInitMenuPaneL().

See also the MENU_ITEM resource for details of the resource interface to menu items.

Defined in CEikMenuPaneItem::SData:
Anonymous, ENominalTextLength, iCascadeId, iCommandId, iExtraText, iFlags, iText

Enum Anonymous


N/A

Description

Nominal text length.

ENominalTextLength

Nominal text length (see iText below).

iCommandId


TInt iCommandId;

Description

ID of the command to issue when the menu item using this SData is selected.

iCascadeId


TInt iCascadeId;

Description

Resource ID of a menu pane to cascade from this item.

iFlags


TInt iFlags;

Description

Flags used internally by CEikMenuPane and accessible through functions such as CEikMenuPane::SetItemDimmed().

iText


TBuf<ENominalTextLength> iText;

Description

The text buffer displayed in the main area of the menu item.

iExtraText


TBuf<ENominalTextLength> iExtraText;

Description

Additional descriptive text about the item. This is used by CEikMenuPane to display hotkey names.

[Top]


Public data members


iData

SData iData

Description

Information from an SData struct.


iHotKeyCode

TInt iHotKeyCode

Description

The menu pane item's hotkey text.


iPos

TInt iPos

Description

The y position of the menu pane item.