Location:
eikmenup.h
Link against: eikcoctl.lib
CEikMenuPane
Supported from 6.0
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.
|
Defined in CEikMenuPane
:
AddMenuItemL()
, CEikMenuPane()
, CItemArray
, Close()
, CloseCascadeMenu()
, ConstructFromResourceL()
, ConstructL()
, DeleteMenuItem()
, Draw()
, FocusChanged()
, GetColorUseListL()
, HandlePointerEventL()
, HandleResourceChange()
, InputCapabilities()
, InsertMenuItemAtL()
, ItemAndPos()
, ItemData()
, MenuButtons()
, MenuItemCommandId()
, MenuItemIndex()
, MoveHighlightTo()
, NumberOfItemsInPane()
, OfferKeyEventL()
, Reset()
, SelectedItem()
, SetArrowHeadScrollBar()
, SetItemArray()
, SetItemArrayOwnedExternally()
, SetItemButtonState()
, SetItemDimmed()
, SetItemTextL()
, SetLaunchingButton()
, SetScrollBarOnLeft()
, SetSelectedItem()
, StartDisplayingMenuPane()
, THotKeyDisplayText
, ~CEikMenuPane()
Inherited from CBase
:
operator new()
Inherited from CCoeControl
:
ActivateGc()
,
ActivateL()
,
BackedUpWindow()
,
CapturesPointer()
,
ClaimPointerGrab()
,
CloseWindow()
,
ComponentControl()
,
ControlContext()
,
ControlEnv()
,
CopyControlContextFrom()
,
CountComponentControls()
,
CreateBackedUpWindowL()
,
CreateWindowL()
,
DeactivateGc()
,
DrawDeferred()
,
DrawNow()
,
DrawableWindow()
,
EnableDragEvents()
,
GetColor()
,
GetHelpContext()
,
GrabbingComponent()
,
HandleComponentControlsResourceChange()
,
HandlePointerBufferReadyL()
,
HandleRedrawEvent()
,
IgnoreEventsUntilNextPointerUp()
,
Index()
,
IsActivated()
,
IsBackedUp()
,
IsBeingDestroyed()
,
IsBlank()
,
IsDimmed()
,
IsFocused()
,
IsNonFocusing()
,
IsReadyToDraw()
,
IsVisible()
,
MakeVisible()
,
MinimumSize()
,
Observer()
,
OverrideColorL()
,
OwnsWindow()
,
Position()
,
PositionChanged()
,
PositionRelativeToScreen()
,
PrepareForFocusGainL()
,
PrepareForFocusLossL()
,
Rect()
,
RecursivelyMergedInputCapabilities()
,
ReportEventL()
,
ResetGc()
,
SetAllowStrayPointers()
,
SetBlank()
,
SetCanDrawOutsideRect()
,
SetComponentsToInheritVisibility()
,
SetContainerWindow()
,
SetContainerWindowL()
,
SetControlContext()
,
SetCornerAndSize()
,
SetCornerAndSizeL()
,
SetDimmed()
,
SetExtent()
,
SetExtentL()
,
SetExtentToWholeScreen()
,
SetExtentToWholeScreenL()
,
SetFocus()
,
SetFocusing()
,
SetGloballyCapturing()
,
SetNeighbor()
,
SetNonFocusing()
,
SetObserver()
,
SetPointerCapture()
,
SetPosition()
,
SetRect()
,
SetRectL()
,
SetSize()
,
SetSizeL()
,
SetSizeWithoutNotification()
,
SetSizeWithoutNotificationL()
,
Size()
,
SizeChanged()
,
SizeChangedL()
,
SystemGc()
,
Window()
Inherited from CEikBorderedControl
:
Border()
,
HasBorder()
,
SetAdjacent()
,
SetBorder()
,
iBorder
CEikMenuPane(MEikMenuObserver* aMenuObserver);
Constructs a menu pane object with the specified observer.
|
void ConstructL(CEikMenuPane* aOwner);
Completes construction of a menu pane object.
This is where a
menu is the owner of a cascade menu. See also
ConstructFromResourceL()
.
|
~CEikMenuPane();
Destructs the menu pane and any associated resources, unless they are externally owned.
void SetItemTextL(TInt aCommandId, TInt aRid);
Sets the text in a menu item from resource.
|
void SetItemTextL(TInt aCommandId, const TDesC& aDes);
Sets the text in a menu item.
|
void SetItemDimmed(TInt aCommandId,TBool aDimmed);
Dims (greys out) or undims a menu item.
Dimming indicates that user input is not accepted.
|
void SetItemButtonState(TInt aCommandId,TInt aButtonState);
Sets the state of the specified menu item.
|
void AddMenuItemL(const TItem::SData& aMenuItem);
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.
|
void AddMenuItemL(CEikMenuPaneItem* aMenuItem);
Supported from 6.1
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()
.
|
void DeleteMenuItem(TInt aCommandId);
Deletes the specified item in the menu pane.
|
void SetSelectedItem(TInt aSelectedItem);
Sets the selected menu item.
|
void StartDisplayingMenuPane (const CEikHotKeyTable* aHotKeyTable,const TPoint& aTargetPos, const CEikMenuPaneTitle* aMenuPaneTitle,TInt aMinTitleWidth, TPopupTargetPosType aTargetType);
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.
|
void Close();
Closes the menu pane.
Destroys the command button area container if one exists, closes the window if the menu pane owns one.
void CloseCascadeMenu();
Closes and destroys any current cascade menu and takes focus back.
Does nothing if no cascade menu exists.
void InsertMenuItemAtL(const CEikMenuPaneItem::SData& aMenuItemData, TInt aIndex);
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.
|
void InsertMenuItemAtL(CEikMenuPaneItem* aMenuItem, TInt aIndex);
Supported from 6.1
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.
|
void MoveHighlightTo(TInt aNewSelectedItem);
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.
|
void SetArrowHeadScrollBar(TBool aArrowHead);
Sets whether the menu pane uses an arrow head scroll bar.
|
void SetItemArray(CItemArray* aItemArray);
Sets the array containing the list of menu items for the current menu pane.
|
void SetItemArrayOwnedExternally(TBool aOwnedExternally);
Set menu item array ownership.
|
void SetLaunchingButton(CEikButtonBase* aButton);
Sets the specified button to launch the menu pane.
|
void SetScrollBarOnLeft(TBool aOnLeft);
Sets whether the scroll bar occupies the left side of the menu pane.
|
void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
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
.
|
TCoeInputCapabilities InputCapabilities() const;
Gets the input capabilities of the menu pane which accepts all text.
|
CEikMenuPaneItem* ItemAndPos(TInt aCommandId,TInt& aPos);
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.
|
|
CEikMenuPaneItem::SData& ItemData(TInt aCommandId);
Gets a reference to the data in the specified menu item.
|
|
TInt MenuItemCommandId(TInt aIndex);
Gets the CommandId
of the specified menu item.
This function panics if aIndex
does not exist. Panics if the index
is out of range.
|
|
TInt MenuItemIndex(TInt aCommandId);
Gets the index of the menu item with a command ID of
aCommandId
.
This function panics if aCommandId
does
not exist.
|
|
TInt NumberOfItemsInPane() const;
Gets the number of menu items within the menu pane.
|
TInt SelectedItem() const;
Gets the position of the selected menu item.
|
CEikButtonGroupContainer* MenuButtons() const;
Gets a pointer to the associated button group.
Ownership is not transferred.
|
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
Handles a pointer event on the menu.
|
void HandleResourceChange(TInt aType);
Handles a change to the menu's resources of the specified type, which are shared across the environment, colours or fonts for example.
|
TKeyResponse OfferKeyEventL (const TKeyEvent& aKeyEvent,TEventCode aType);
Handles key events offered to the menu by the control
environment and provides an appropriate implementation of
CCoeControl::OfferKeyEventL()
.
|
|
TKeyResponse OfferKeyEventL (const TKeyEvent& aKeyEvent,TEventCode aType,TBool aConsumeAllKeys);
Handles key events offered to the menu by the control environment.
Provides an appropriate implementation of
CCoeControl::OfferKeyEventL()
.
|
|
protected: void ConstructFromResourceL(TResourceReader& aReader);
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.
|
protected: void Draw(const TRect& aRect) const; protected
Redraws an area of the menu pane.
|
protected: void FocusChanged(TDrawNow aDrawNow);
Takes any action required when the menu pane gains or loses focus, to change its appearance for example.
|
CItemArray
This class provides a constructor to create an array of menu pane items and a destructor to destroy an array of menu pane items.
|
Defined in CEikMenuPane::CItemArray
:
CItemArray()
, ~CItemArray()
Inherited from CArrayFix
:
AppendL()
,
AppendL()Append
,
Array()
,
At()
,
Back()
,
End()
,
ExpandL()
,
ExtendL()
,
Find()
,
FindIsq()
,
InsertIsqAllowDuplicatesL()
,
InsertIsqL()
,
InsertL()
,
ResizeL()
,
operator[]
Inherited from CArrayFixBase
:
Compress()
,
Count()
,
Delete()
,
Length()
,
Reset()
,
Sort()
Inherited from CArrayPtr
:
ResetAndDestroy()
Inherited from CArrayPtrFlat
:
SetReserveL()
Inherited from CBase
:
operator new()
typedef TBuf<20> CEikMenuPane::THotKeyDisplayText;
The text to be displayed for a hotkey.