Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: eikcmbut.h
Link against: eikcoctl.lib

Class CEikTwoPictureCommandButton

CEikTwoPictureCommandButton

Support

Supported from 6.0

Description

This class provides a command button which can hold two pictures in addition to label text.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCoeControlControl base class from which all other controls are derived
CEikBorderedControlA control which is drawn surrounded by a rectangular border
CEikButtonBaseThis is the base class from which concrete button controls (command buttons, option buttons and checkboxes) are derived
CEikCommandButtonBaseBase class for command buttons
CEikTwoPictureCommandButtonThis class provides a command button which can hold two pictures in addition to label text
MCoeControlContextInterface to allow sharing of graphics settings between controls

Defined in CEikTwoPictureCommandButton:
ActivateL, CEikTwoPictureCommandButton(), ConstructFromResourceL(), ConstructImagesFromResourceL(), EPictureOnly, EShare, ETextAndPicture, ETextBottomPictureTop, ETextLeftPictureRight, ETextOnly, ETextRightPictureLeft, ETextTopPictureBottom, EToPicture, EToText, IsSecondPictureOwnedExternally(), Picture(), SetPictureFromFileL(), SetSecondPicture(), SetSecondPictureFromFileL(), SetSecondPictureOwnedExternally(), SetTextL(), SetTwoPicturesL(), TDisplayContent, TExcess, TLayout, ~CEikTwoPictureCommandButton()

Inherited from CBase:
operator new()

Inherited from CCoeControl:
ActivateGc(), BackedUpWindow(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), ControlContext(), ControlEnv(), CopyControlContextFrom(), 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(), Observer(), OverrideColorL(), OwnsWindow(), Position(), PositionChanged(), PositionRelativeToScreen(), PrepareForFocusGainL(), PrepareForFocusLossL(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), ResetGc(), 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 CEikBorderedControl:
Border(), HasBorder(), SetAdjacent(), SetBorder(), iBorder

Inherited from CEikButtonBase:
Animate(), CopyDrawStateTo(), DrawState(), EClear, EDrawClear, EDrawClearPressed, EDrawIndeterminate, EDrawIndeterminatePressed, EDrawSet, EDrawSetPressed, EEikButtonLatches, EEikButtonReportsOnPointerDown, EEikButtonStaysClear, EEikButtonStaysSet, EIndeterminate, ESet, HandlePointerEventL(), InputCapabilities(), IsPressed(), SetAllowTristate(), SetBehavior(), SetBubbleHelpTextL(), SetCoordinator(), SetIgnoreNextPointerUp(), SetReportOnPointerDown(), SetState(), State(), TButtonBehavior, TDrawState, TState, iButFlags

Inherited from CEikCommandButtonBase:
ActivateL(), Behavior(), CheckCreateCommandStack(), ComponentControl(), ConstructImageFromResourceL(), ConstructLabelFromResourceL(), CountComponentControls(), Draw(), EBoth, EFirst, EFirstBottomSecondTop, EFirstLeftSecondRight, EFirstOnly, EFirstRightSecondLeft, EFirstTopSecondBottom, ESecond, ESecondOnly, EToFirst, EToSecond, FocusChanged(), GetColorUseListL(), HandleResourceChange(), LayoutComponents(), MinimumSize(), OfferKeyEventL(), SetButtonLayout(), SetContainerWindowL(), SetDefault(), SetDimmed(), SetDisplayContent(), SetExcessSpace(), SetPictureL(), StartConstructFromResourceL(), StateChanged(), TWhichComponent, UpdateComponentAlignment(), iCmdFlags, iComponents[2]

Inherited from MCoeControlContext:
ActivateContext(), PrepareContext(), ResetContext()


Construction and destruction


CEikTwoPictureCommandButton()

CEikTwoPictureCommandButton();

Description

Constructor.


ConstructFromResourceL()

void ConstructFromResourceL(TResourceReader& aReader);

Description

Constructs the command button, complete with a label and two images, from resource.

Parameters

TResourceReader& aReader

The resource reader to use.


~CEikTwoPictureCommandButton()

~CEikTwoPictureCommandButton();

Description

Destructor.

[Top]


Set the button as ready to be drawn


ActivateL

void ActivateL();

Description

Sets the button as ready to be drawn. An application should call this function on all command buttons that are not components in a compound control.

This function will panic if the second bitmap is not present.

[Top]


Button pictures


ConstructImagesFromResourceL()

void ConstructImagesFromResourceL(TResourceReader& aReader,TWhichComponent aWhich);

Description

Constructs the button’s images from resource.

Parameters

TResourceReader& aReader

The resource reader to use.

TWhichComponent aWhich

Not used.


IsSecondPictureOwnedExternally()

TBool IsSecondPictureOwnedExternally();

Description

Tests whether the bitmaps for the second button picture are owned externally.

Return value

TBool

ETrue if the bitmaps for the second button picture are owned externally.


Picture()

CEikImage* Picture() const;

Description

Gets the button’s image control component.

Return value

CEikImage*

The button’s image control component.


SetPictureFromFileL()

void SetPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask);

Description

Sets the button’s first picture from file. Loads the image bitmap identified by aMain and the mask bitmap identified by aMask from the bitmap file named aFilename.

Parameters

const TDesC& aFilename

The bitmap file.

TInt aMain

The image bitmap.

TInt aMask

The mask bitmap.


SetSecondPictureFromFileL()

void SetSecondPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask);

Description

Sets the button’s second picture from file. Loads the image bitmap identified by aMain and the mask bitmap identified by aMask from the bitmap file named aFilename.

Parameters

const TDesC& aFilename

The bitmap file.

TInt aMain

The image bitmap.

TInt aMask

The mask bitmap.


SetSecondPicture()

void SetSecondPicture(const CFbsBitmap* aSecondMain,const CFbsBitmap* aSecondMask);

Description

Sets the button’s second picture from bitmaps. Uses aSecondMain as the image bitmap and aSecondMask as the mask bitmap. Takes ownership of the bitmaps unless the second picture is already set as owned externally.

Parameters

const CFbsBitmap* aSecondMain

The image bitmap.

const CFbsBitmap* aSecondMask

The mask bitmap.


SetSecondPictureOwnedExternally()

void SetSecondPictureOwnedExternally(TBool aOwnership);

Description

Sets ownership of the bitmaps used for the button’s second picture.

Parameters

TBool aOwnership

If ETrue sets the bitmaps as owned externally. If EFalse sets the bitmaps as not owned externally.


SetTwoPicturesL()

void SetTwoPicturesL(const CFbsBitmap* aMain,const CFbsBitmap* aMask,const CFbsBitmap* aSecondMain,const CFbsBitmap* aSecondMask);

Description

Sets both pictures for the button. The first picture is created from the image bitmap aMain and the mask bitmap aMask. The second picture is created from the image bitmap aSecondMain and mask bitmap aSecondMask.

Parameters

const CFbsBitmap* aMain

The image bitmap for the first picture.

const CFbsBitmap* aMask

The mask bitmap first picture.

const CFbsBitmap* aSecondMain

The image bitmap for the second picture.

const CFbsBitmap* aSecondMask

The mask bitmap second picture.

[Top]


Button label


SetTextL()

void SetTextL(const TDesC& aText);

Description

Sets the button’s label.

Parameters

const TDesC& aText

The text to use for the button’s label.

[Top]


Member enumerations


Enum TExcess

TExcess

Description

Determines how excess space is allocated between the button’s label and pictures.

EShare

Excess space is shared equally between the button’s label and pictures.

EToText

Excess space is allocated to the button’s label.

EToPicture

Excess space is allocated to the button’s pictures.


Enum TLayout

TLayout

Description

Determines how the button’s label and pictures are layed out.

ETextRightPictureLeft

The label is placed on the right and the picture on the left of the button.

ETextLeftPictureRight

The label is placed on the left and the picture on the right of the button.

ETextBottomPictureTop

The label is placed at the bottom and the picture on the top of the button.

ETextTopPictureBottom

The label is placed at the top and the picture on the bottom of the button.


Enum TDisplayContent

TDisplayContent

Description

Determines which of the button’s label and pictures are displayed.

ETextOnly

Only the button’s label is displayed.

EPictureOnly

Only the button’s picture is displayed.

ETextAndPicture

The button’s label and picture are displayed.