Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: eiklbbut.h
Link against: eikcoctl.lib

Class CEikLabeledButton

CEikLabeledButton

Support

Supported from 6.0

Description

A command button with a label. A labelled button has no picture associated with it: it displays text only.

You can also assign a hotkey code to the button and choose whether the code is displayed on the button.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCoeControlControl base class from which all other controls are derived
CEikLabeledButtonA command button with a label
MCoeControlObserverInterface for a control to send events to another control, its observer

Defined in CEikLabeledButton:
Animate(), Button(), CEikLabeledButton(), ConstructFromResourceL(), ConstructL(), EPlainHotKey, EShowHotKey, GetColorUseListL(), HandleResourceChange(), HotKeyCode(), InputCapabilities(), Label(), MinimumSize(), OfferKeyEventL(), PlainHotKey(), SetContainerWindowL(), SetDimmed(), ShowsHotKey(), TFlags, UpdateHotKey(), ~CEikLabeledButton()

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(), FocusChanged(), GetColor(), GetHelpContext(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandlePointerBufferReadyL(), HandlePointerEventL(), HandleRedrawEvent(), HasBorder(), IgnoreEventsUntilNextPointerUp(), Index(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), MakeVisible(), Observer(), OverrideColorL(), OwnsWindow(), Position(), PositionChanged(), PositionRelativeToScreen(), PrepareForFocusGainL(), PrepareForFocusLossL(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), ResetGc(), SetAdjacent(), SetAllowStrayPointers(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetContainerWindow(), SetControlContext(), SetCornerAndSize(), SetCornerAndSizeL(), 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 MCoeControlObserver:
EEventInteractionRefused, EEventPrepareFocusTransition, EEventRequestCancel, EEventRequestExit, EEventRequestFocus, EEventStateChanged, HandleControlEventL(), TCoeEvent


Construction and destruction


CEikLabeledButton()

CEikLabeledButton();

Description

Begins construction. Sets the button to inherit the visibility of its owner.


ConstructFromResourceL()

void ConstructFromResourceL(TResourceReader& aReader);

Description

Constructs a labelled button from resource. zz ? what type of resource?

Parameters

TResourceReader& aReader

The resource reader to use to construct the labelled button.


ConstructL()

void ConstructL(CEikCommandButtonBase* aButton,TInt aHotKeyCode,TInt aFlags);

Description

Completes construction.

Parameters

CEikCommandButtonBase* aButton

The button for which construction is completed.

TInt aHotKeyCode

The hotkey code for the button.

TInt aFlags

Flags for the button that determine whether the hotkey code is displayed.


~CEikLabeledButton()

~CEikLabeledButton();

Description

Destructor. Removes the button and its label.

[Top]


Accessing the button, its label and input capabilities


Button()

CEikCommandButtonBase* Button() const;

Description

Gets a pointer to the button.

Return value

CEikCommandButtonBase*

Pointer to the button.


Label()

CEikLabel* Label() const;

Description

Gets the button's label.

Return value

CEikLabel*

The button's label.


InputCapabilities()

TCoeInputCapabilities InputCapabilities() const;

Description

Gets the button's input capabilities. These are the key event types that the button will accept.

Return value

TCoeInputCapabilities

The button's input capabilities.

[Top]


Hotkeys


HotKeyCode()

TInt HotKeyCode() const;

Description

Gets the button's hotkey code.

Return value

TInt

The button's hotkey code.


PlainHotKey()

TBool PlainHotKey() const;

Description

Tests whether the button is set so that hotkeys for commands are not shown.

Return value

TBool

ETrue if the button is set so that hotkeys for commands are not shown. EFalse otherwise.


ShowsHotKey()

TBool ShowsHotKey() const;

Description

Tests whether the button is set so that hotkeys for commands are shown.

Return value

TBool

ETrue if the button is set so that hotkeys for commands are shown. EFalse otherwise.


UpdateHotKey()

void UpdateHotKey(TInt aKeyCode,TFlags aFlags);

Description

Sets the button's hotkey code and flags to determine whether the hotkey code is displayed.

Parameters

TInt aKeyCode

The button's new hotkey code.

TFlags aFlags

Flags to determine whether the hotkey code is displayed.

See also:

[Top]


Animation, dim state, size and colour use


Animate()

void Animate();

Description

Animates the button so that it appears to be pressed.


SetDimmed()

void SetDimmed(TBool aDimmed);

Description

Sets the button's dimmed state. Dimming usually indicates user input is not accepted.

Parameters

TBool aDimmed

ETrue to set the button as dimmed. EFalse to set the button as not dimmed.


MinimumSize()

TSize MinimumSize();

Description

Gets the minimum size required to display the button. This includes the space required to display the button's margins and label.

Return value

TSize

The minimum size required to display the button.


GetColorUseListL()

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

Description

Gets a list of logical colors used to draw the button, paired with an explanation of how they are used. Appends the list to aColorUseList.

Parameters

CArrayFix<TCoeColorUse>& aColorUseList

List of logical colours with an explanation of how they are used.

[Top]


Handling key events and resource changes


OfferKeyEventL()

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

Description

Offers a key event to the button.

Parameters

const TKeyEvent& aKeyEvent

The key event passed to the button.

TEventCode aType

The type of key event.

Return value

TKeyResponse

The button's response to the key event. This indicates whether or not the key event was used by the button.


HandleResourceChange()

void HandleResourceChange(TInt aType);

Description

Handles a change in the button's resources which are shared across the environment. Colours or fonts for example.

Parameters

TInt aType

The type of resource that has changed.

[Top]


Container window


SetContainerWindowL()

void SetContainerWindowL(const CCoeControl& aContainer);

Description

Sets the button's containing window. Copies the containing window and control context from aContainer.

Parameters

const CCoeControl& aContainer

The control from which the containing window and control context are copied.

[Top]


Enumerations


Enum TFlags

TFlags

Description

Flags to control whether hotkeys are displayed on the button.

EShowHotKey

Hotkeys for commands are displayed.

EPlainHotKey

Hotkeys for commands are not displayed.