UIQ Technology
 Developer Library

UIQ 3 SDK

UIQ developer portal

FEEDBACK 

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



Location: EIKMENUP.H
Link against: eikcoctl.lib

Class CEikMenuPane

class CEikMenuPane : public CEikBorderedControl;

Description

A menu pane.

Menu panes are opened by activating the menu title (CEikMenuPaneTitle / MENU_TITLE ) which is displayed in the menu bar (CEikMenuBar / MENU_BAR ). They can also be cascaded from a menu item (CEikMenuPaneItem / MENU_ITEM ) or launched by a menu button (CEikMenuButton ).Menu panes may be defined using a MENU_PANE resource.

Derivation

Members

Defined in CEikMenuPane:
ActivateL(), AddMenuItemL(), AddMenuItemL(), CEikMenuPane(), CItemArray, Close(), CloseCascadeMenu(), ConstructFromResourceL(), ConstructL(), DeleteMenuItem(), Draw(), ENoSeparators, EUseGroupIdSeparator, EUseTypeSeparator, FocusChanged(), GetColorUseListL(), HandlePointerEventL(), HandleResourceChange(), InputCapabilities(), InsertMenuItemAtL(), InsertMenuItemAtL(), ItemAndPos(), ItemArray(), ItemData(), Margins(), MenuItemCascadeId(), MenuItemCommandId(), MenuItemIndex(), MinimumSize(), MoveHighlightTo(), NumberOfItemsInPane(), OfferKeyEventL(), OfferKeyEventL(), PopulateMenuPaneL(), Reset(), SelectedItem(), SetArrowHeadScrollBar(), SetItemArray(), SetItemArrayOwnedExternally(), SetItemButtonState(), SetItemDimmed(), SetItemTextL(), SetItemTextL(), SetLaunchingButton(), SetMargins(), SetMenuCascadeObserver(), SetScrollBarOnLeft(), SetSelectedItem(), StartDisplayingMenuPane(), THotKeyDisplayText, TItemAttributes, TPopulationFlags, ViewRect(), WriteInternalStateL(), ~CEikMenuPane()

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

Inherited from CCoeControl:
AccumulatedZoom(), ActivateGc(), BackedUpWindow(), Background(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), Components(), ControlContext(), ControlEnv(), CopyControlContextFrom(), CreateBackedUpWindowL(), CreateWindowL(), DeactivateGc(), DrawBackground(), DrawDeferred(), DrawForeground(), DrawNow(), DrawableWindow(), EAbsoluteZoom, ERelativeZoom, EnableDragEvents(), FindBackground(), FindFontProvider(), GetColor(), GetGc(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandleRedrawEvent(), HitTest(), IgnoreEventsUntilNextPointerUp(), Index(), InitComponentArrayL(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), LayoutManager(), MaximumWidth(), Observer(), OverrideColorL(), OwnsWindow(), Parent(), Position(), PositionRelativeToScreen(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), Reserved_CCoeControl_10(), Reserved_CCoeControl_11(), Reserved_CCoeControl_12(), Reserved_CCoeControl_13(), ResetGc(), ScreenFont(), SetAllowStrayPointers(), SetBackground(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetControlContext(), SetCornerAndSize(), SetExtent(), SetExtentToWholeScreen(), SetFocus(), SetFocusing(), SetFontProviderL(), SetGc(), SetGloballyCapturing(), SetHitTest(), SetMaximumWidth(), SetMopParent(), SetNonFocusing(), SetObserver(), SetPointerCapture(), SetPosition(), SetRect(), SetSize(), SetSizeWithoutNotification(), SetUniqueHandle(), SetZoomFactorL(), Size(), SystemGc(), TZoomType, TextDrawer(), UniqueHandle(), Window(), ZoomWithType(), iCoeEnv, iContext, iPosition, iSize

Inherited from CEikBorderedControl:
Border(), ComponentControl(), CountComponentControls(), GetHelpContext(), HandleControlArrayEventL(), HandlePointerBufferReadyL(), HasBorder(), MakeVisible(), MopSupplyObject(), PositionChanged(), PrepareForFocusGainL(), PrepareForFocusLossL(), RequestRelayout(), SetAdjacent(), SetBorder(), SetContainerWindowL(), SetDimmed(), SetLayoutManagerL(), SetNeighbor(), SetParent(), SetTextBaselineSpacing(), SizeChanged(), TextBaselineOffset(), iBorder

Inherited from MEikBorderedControl:
ETypeId, anonymous

Inherited from MObjectProvider:
MopGetObject(), MopGetObjectNoChaining()


Construction and destruction


~CEikMenuPane()

IMPORT_C ~CEikMenuPane();

Description

Destructs the menu pane and any associated resources, unless they are externally owned.


CEikMenuPane()

IMPORT_C CEikMenuPane(MEikMenuObserver *aMenuObserver);

Description

Constructs a menu pane object with the specified observer.

Parameters

MEikMenuObserver *aMenuObserver


ConstructL()

IMPORT_C void ConstructL(CEikMenuPane *aOwner, MEikMenuCascadeObserver *aMenuCascadeObserver=0);

Description

Completes construction of a menu pane object.

This is where a menu is the owner of a cascade menu. See also ConstructFromResourceL() .

Parameters

CEikMenuPane *aOwner

MEikMenuCascadeObserver *aMenuCascadeObserver

[Top]


Member functions


Reset()

IMPORT_C void Reset();

Description

Destroys the menu pane's item array.


ActivateL()

virtual IMPORT_C void ActivateL();

Description

Activates the menu pane control and makes sure that the selected item is visible. It may also activate and draw its relative menu pane title. This function won't leave since the menu pane and menu pane title don't use the backup window.


OfferKeyEventL()

virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);

Description

Handles key events offered to the menu by the control environment and provides an appropriate implementation of CCoeControl::OfferKeyEventL() .

Parameters

const TKeyEvent &aKeyEvent

TEventCode aType

Return value

TKeyResponse

" TKeyResponse " Indicates whether or not the key event was used.


HandlePointerEventL()

virtual IMPORT_C void HandlePointerEventL(const TPointerEvent &aPointerEvent);

Description

Handles a pointer event on the menu.

Parameters

const TPointerEvent &aPointerEvent


GetColorUseListL()

virtual IMPORT_C void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;

Description

Gets the list of logical colours employed in the drawing of the control, paired with an explanation of how they are used.

Appends the list into aColorUseList .

Parameters

CArrayFix< TCoeColorUse > &aColorUseList


HandleResourceChange()

virtual IMPORT_C void HandleResourceChange(TInt aType);

Description

Handles a change to the menu's resources of the specified type, which are shared across the environment, colours or fonts for example.

Parameters

TInt aType


InputCapabilities()

virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

Description

Gets the input capabilities of the menu pane which accepts all text.

Return value

TCoeInputCapabilities

" TCoeInputCapabilities " The menu's input capabilities.


WriteInternalStateL()

virtual IMPORT_C void WriteInternalStateL(RWriteStream &aWriteStream) const;

Description

Writes the internal state of the control and its components to aStream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

Parameters

RWriteStream &aWriteStream


Draw()

virtual IMPORT_C void Draw(const TRect &aRect) const;

Description

Redraws an area of the menu pane.

Parameters

const TRect &aRect


MinimumSize()

virtual IMPORT_C TSize MinimumSize();

Description

Gets the minimum size of this menu pane.

Return value

TSize

" TSize " Minimum size for the control.


ViewRect()

IMPORT_C TRect ViewRect() const;

Description

Return value

TRect


FocusChanged()

protected: virtual IMPORT_C void FocusChanged(TDrawNow aDrawNow);

Description

Takes any action required when the menu pane gains or loses focus, to change its appearance for example.

Parameters

TDrawNow aDrawNow


ConstructFromResourceL()

protected: virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

Description

Constructs the menu pane using the specified resource reader.

Fills the menu item array with the list of menu items provided by the resource file.

Parameters

TResourceReader &aReader


AddMenuItemL()

IMPORT_C void AddMenuItemL(const CEikMenuPaneItem::SData &aMenuItem);

Description

Adds a menu item dynamically by creating a new menu item, setting its data to aMenuItem and appending it to the pane's menu item array.

Updates the menu's scroll bar to take account of the new item.

Parameters

const CEikMenuPaneItem::SData &aMenuItem


AddMenuItemL()

IMPORT_C void AddMenuItemL(CEikMenuPaneItem *aMenuItem);

Description

Adds a new menu item to the menu pane.

Updates the menu's scroll bar to take account of the new item. Note that the item is appended after the existing items - see InsertMenuItemAtL() .

Parameters

CEikMenuPaneItem *aMenuItem


InsertMenuItemAtL()

IMPORT_C void InsertMenuItemAtL(const CEikMenuPaneItem::SData &aMenuItemData, TInt aIndex);

Description

Inserts a new menu item.

The item is inserted into the menu pane's array of menu items at the position identified by aIndex . This is done by creating a new menu item, setting its data to aMenuItemData and inserting it into the pane's menu item array. This function also updates the menu's scroll bar to take account of the new item. If the index is beyond the end of the array, the item is appended to it.

Parameters

const CEikMenuPaneItem::SData &aMenuItemData

TInt aIndex


InsertMenuItemAtL()

IMPORT_C void InsertMenuItemAtL(CEikMenuPaneItem *aMenuItem, TInt aIndex);

Description

Inserts a new menu item at index aIndex within the menu pane.

Updates the menu's scroll bar to take account of the new item. If the index is beyond the end of the menu pane's array of menu items, the item is appended to the array.

Parameters

CEikMenuPaneItem *aMenuItem

TInt aIndex


DeleteMenuItem()

IMPORT_C void DeleteMenuItem(TInt aCommandId);

Description

Deletes the specified item in the menu pane.

Parameters

TInt aCommandId


ItemData()

IMPORT_C CEikMenuPaneItem::SData &ItemData(TInt aCommandId);

Description

Gets a reference to the data in the specified menu item.

Parameters

TInt aCommandId

Return value

CEikMenuPaneItem::SData &

" CEikMenuPaneItem::SData& " The menu item's data.


ItemAndPos()

IMPORT_C CEikMenuPaneItem *ItemAndPos(TInt aCommandId, TInt &aPos);

Description

Gets a pointer to the specified menu item.

Also gets the position of the item within the menu pane. Panics if there are no menu items in the menu pane. Panics if the menu pane id does not identify any menu pane item in the array.

Parameters

TInt aCommandId

TInt &aPos

Return value

CEikMenuPaneItem *

" CEikMenuPaneItem* " Pointer to the menu item with an ID of aCommandId .


StartDisplayingMenuPane()

IMPORT_C void StartDisplayingMenuPane(const CEikHotKeyTable *aHotKeyTable, const TPoint &aTargetPos, const CEikMenuPaneTitle *aMenuPaneTitle, TInt aMinWidth, TPopupTargetPosType aTargetType=EPopupTargetTopLeft);

Description

Displays a menu pane.

Displays the menu pane with the corner identified by aTargetType in the position specified by aTargetPos . This function uses aMinTitleWidth to calculate the area required to display the menu pane, taking into account whether the menu is a cascading menu or popup menu.

Parameters

const CEikHotKeyTable *aHotKeyTable

const TPoint &aTargetPos

const CEikMenuPaneTitle *aMenuPaneTitle

TInt aMinWidth

TPopupTargetPosType aTargetType


SetItemTextL()

IMPORT_C void SetItemTextL(TInt aCommandId, const TDesC &aDes);

Description

Sets the text in a menu item.

Parameters

TInt aCommandId

const TDesC &aDes


SetItemTextL()

IMPORT_C void SetItemTextL(TInt aCommandId, TInt aRid);

Description

Sets the text in a menu item from resource.

Parameters

TInt aCommandId

TInt aRid


SetItemDimmed()

IMPORT_C void SetItemDimmed(TInt aCommandId, TBool aDimmed);

Description

Dims (greys out) or undims a menu item.

Dimming indicates that user input is not accepted.

Parameters

TInt aCommandId

TBool aDimmed


SetItemButtonState()

IMPORT_C void SetItemButtonState(TInt aCommandId, TInt aButtonState);

Description

Sets the state of the specified menu item.

Parameters

TInt aCommandId

TInt aButtonState


SetSelectedItem()

IMPORT_C void SetSelectedItem(TInt aSelectedItem);

Description

Sets the selected menu item.

Parameters

TInt aSelectedItem


SelectedItem()

IMPORT_C TInt SelectedItem() const;

Description

Gets the position of the selected menu item.

Return value

TInt

" TInt " The position of the selected menu item.


CloseCascadeMenu()

IMPORT_C void CloseCascadeMenu();

Description

Closes and destroys any current cascade menu and takes focus back.

Does nothing if no cascade menu exists.


SetItemArray()

IMPORT_C void SetItemArray(CItemArray *aItemArray);

Description

Sets the array containing the list of menu items for the current menu pane.

Parameters

CItemArray *aItemArray


SetItemArrayOwnedExternally()

IMPORT_C void SetItemArrayOwnedExternally(TBool aOwnedExternally);

Description

Set menu item array ownership.

Parameters

TBool aOwnedExternally


SetLaunchingButton()

IMPORT_C void SetLaunchingButton(CEikButtonBase *aButton);

Description

Sets the specified button to launch the menu pane. The HandlePointerEventL() of aButton should not leave for TPointerEvent::EButton1Up event, because this function is called by the menu pane destructor.

Parameters

CEikButtonBase *aButton


MoveHighlightTo()

IMPORT_C void MoveHighlightTo(TInt aNewSelectedItem);

Description

Moves the menu pane highlight.

Moves the menu pane highlight to a newly selected menu item identified by aNewSelectedItem . Scrolls the menu to show the new selected item if necessary and redraws only the newly selected item and the currently selected item if possible.

Parameters

TInt aNewSelectedItem


NumberOfItemsInPane()

IMPORT_C TInt NumberOfItemsInPane() const;

Description

Gets the number of menu items within the menu pane.

Return value

TInt

" TInt " The number of menu items within the menu pane.


Close()

IMPORT_C void Close();

Description

Closes the menu pane.

Destroys the command button area container if one exists, closes the window if the menu pane owns one.


OfferKeyEventL()

IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType, TBool aConsumeAllKeys);

Description

Handles key events offered to the menu by the control environment.

Provides an appropriate implementation of CCoeControl::OfferKeyEventL() .

Parameters

const TKeyEvent &aKeyEvent

TEventCode aType

TBool aConsumeAllKeys

Return value

TKeyResponse

" TKeyResponse " Indicates whether or not the key event was used. If aConsumeAllKeys is ETrue this will always be EKeyWasConsumed .


SetScrollBarOnLeft()

IMPORT_C void SetScrollBarOnLeft(TBool aOnLeft);

Description

Sets whether the scroll bar occupies the left side of the menu pane.

Parameters

TBool aOnLeft


SetArrowHeadScrollBar()

IMPORT_C void SetArrowHeadScrollBar(TBool aArrowHead);

Description

Sets whether the menu pane uses an arrow head scroll bar.

Parameters

TBool aArrowHead


MenuItemIndex()

IMPORT_C TInt MenuItemIndex(TInt aCommandId);

Description

Gets the index of the menu item with a command ID of aCommandId .

This function panics if aCommandId does not exist.

Parameters

TInt aCommandId

Return value

TInt

" TInt " The index of the menu item with a command ID of aCommandId .


MenuItemCommandId()

IMPORT_C TInt MenuItemCommandId(TInt aIndex);

Description

Gets the CommandId of the specified menu item.

This function panics if aIndex does not exist. Panics if the index is out of range.

Parameters

TInt aIndex

Return value

TInt

" TInt " The command ID of the menu item at aIndex .


MenuItemCascadeId()

IMPORT_C TInt MenuItemCascadeId(TInt aIndex);

Description

Gets the CascadeId of the specified menu item.

This function panics if aIndex does not exist. Panics if the index is out of range.

Parameters

TInt aIndex

Return value

TInt

" TInt " The cascade ID of the menu item at aIndex .


SetMargins()

IMPORT_C void SetMargins(TMargins8 aMargins);

Description

Sets margins in the menupane. Menuitems will be clipped against on these margins.

Parameters

TMargins8 aMargins

The margins to use.


Margins()

IMPORT_C TMargins8 Margins() const;

Description

Return value

TMargins8


PopulateMenuPaneL()

IMPORT_C TInt PopulateMenuPaneL(TInt aPaneId, const TArray< CQikCommand * > &aCommands, TInt aCascadeLevel, TInt aMaxCascadeLevel, TUint aFlags);

Description

Populates a menupane with menupane items corresponding to the commands in aCommands

Parameters

TInt aPaneId

the menu pane id

const TArray< CQikCommand * > &aCommands

a const TArray<CQikCommand>& containing commands

TInt aCascadeLevel

the current cascade level

TInt aMaxCascadeLevel

the maximum cascade level

TUint aFlags

menupane populating flags, see CEikMenuPane::TPopulationFlags .

Return value

TInt


SetMenuCascadeObserver()

IMPORT_C void SetMenuCascadeObserver(MEikMenuCascadeObserver *aMenuCascadeObserver);

Description

Set observer for cascading menupanes

Parameters

MEikMenuCascadeObserver *aMenuCascadeObserver

Pointer to the observer


ItemArray()

inline CItemArray *ItemArray();

Description

Return value

CItemArray *

[Top]


Member classes


Class CItemArray

class CItemArray : public CArrayPtrFlat< CEikMenuPaneItem >;

Description

This class provides a constructor to create an array of menu pane items and a destructor to destroy an array of menu pane items.

Derivation

Members

Defined in CEikMenuPane::CItemArray:
CItemArray(), ~CItemArray()

Construction and destruction


CItemArray()

IMPORT_C CItemArray();

Description

Creates a flat array of menu pane items.


~CItemArray()

IMPORT_C ~CItemArray();

Description

DestructorResets and destroys array of menu pane items.


Class TItemAttributes

class TItemAttributes;

Description

Internally used data type class holding draw attributes about each item.

Members

Defined in CEikMenuPane::TItemAttributes:
iBaseLine, iExtraText, iFlags, iHeight, iHighlightType, iHotKeysText, iHotkeyWidthAndGap, iIconWidth, iInternalFlags, iItemIndex, iSuperHotKeyOffset, iText, iVPosition

Member data


iBaseLine

TInt iBaseLine;

Description


iFlags

TInt iFlags;

Description


iInternalFlags

TInt iInternalFlags;

Description


iHeight

TInt iHeight;

Description


iHighlightType

SLafMenuPane::THighlightType iHighlightType;

Description


iVPosition

TInt iVPosition;

Description


iHotkeyWidthAndGap

TInt iHotkeyWidthAndGap;

Description


iIconWidth

TInt iIconWidth;

Description


iText

TPtrC iText;

Description


iExtraText

TPtrC iExtraText;

Description


iHotKeysText

TPtrC iHotKeysText;

Description


iItemIndex

TInt iItemIndex;

Description


iSuperHotKeyOffset

TInt iSuperHotKeyOffset;

Description

[Top]


Member enumerations


Enum TPopulationFlags

TPopulationFlags

Description

Flags for populating the menu pane

ENoSeparators

EUseGroupIdSeparator

EUseTypeSeparator

[Top]


Member type definitions


Typedef THotKeyDisplayText

typedef TBuf<20> CEikMenuPane::THotKeyDisplayText;

Description

The text to be displayed for a hotkey.

Terms and conditions of use of the material