CEikCommandButton Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib avkon.lib

Capability Information

Required Capabilities

None


#include <eikcmbut.h>

Inherits CEikCommandButtonBase.

Inherited by CEikInverterCommandButton, and CEikMenuButton.


Detailed Description

Command button with a text and/or an image.

This class in S60 does not function without derivation This class does NOT implement S60 look-and-feel and is not skinned.


Public Types

enum   TLayout { ETextRightPictureLeft = 0x000, ETextBottomPictureTop = 0x001, ETextTopPictureBottom = 0x002, ETextLeftPictureRight = 0x003 }
  Layout options for a command button. More...
enum   TExcess { EShare = 0x0000, EToText = 0x0010, EToPicture = 0x0020 }
  Where to put excess space in the layout. More...
enum   TDisplayContent { ETextOnly = 0x0100, EPictureOnly = 0x0200, ETextAndPicture = 0x0300 }
  Content to diplay for this button. More...

Public Member Functions

IMPORT_C  CEikCommandButton ()
  Constructor.
IMPORT_C  ~CEikCommandButton ()
  C++ destructor.
IMPORT_C void  SetTextL (const TDesC &aText)
  Sets the label text for the button.
IMPORT_C void  SetPictureL (const CFbsBitmap *aMain, const CFbsBitmap *aMask=NULL)
  Sets the bitmap and optional mask for the button.
IMPORT_C void  SetPictureFromFileL (const TDesC &aFilename, TInt aMain, TInt aMask=-1)
  Set bitmap and mask from file.
IMPORT_C CEikLabel Label () const
  Access the label control that implements the text label of the button.
IMPORT_C CEikImage Picture () const
  Access the CEikImage that implements the picture component of the button.
IMPORT_C void  SetButtonLayout (TLayout aLayout)
  Set the layout of the button.
IMPORT_C void  SetExcessSpace (TExcess aExcess)
  Sets where the excess space in the layout is to be distributed.
IMPORT_C void  SetDisplayContent (TDisplayContent aContent)
  Set what content is to be displayed in the button.
IMPORT_C void  SetCommandL (TInt aCommandId, const TDesC *aText, const CFbsBitmap *aBitmap, const CFbsBitmap *aMask)
  Sets the command button's text, bitmap and bitmap mask.
IMPORT_C void  AddCommandToStackL (TInt aCommandId, const TDesC *aText, const CFbsBitmap *aBitmap, const CFbsBitmap *aMask)
  Push a command ID + text + image binding onto the command stack.
IMPORT_C TBool  RemoveCommandFromStack (TInt aCommandId)
  Find the stacked command with a given command ID and remove it from the stack.
IMPORT_C TInt  PopCommandFromStack ()
  Remove the top (most recently added) command binding from the command stack.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C void  UpdateComponentAlignment ()
  From CEikCommandButtonBase.

Member Enumeration Documentation

enum CEikCommandButton::TDisplayContent
 

Content to diplay for this button.

Enumerator:
ETextOnly 
EPictureOnly 
ETextAndPicture 

Reimplemented from CEikCommandButtonBase.

enum CEikCommandButton::TExcess
 

Where to put excess space in the layout.

Enumerator:
EShare 
EToText 
EToPicture 

Reimplemented from CEikCommandButtonBase.

enum CEikCommandButton::TLayout
 

Layout options for a command button.

Enumerator:
ETextRightPictureLeft 
ETextBottomPictureTop 
ETextTopPictureBottom 
ETextLeftPictureRight 

Reimplemented from CEikCommandButtonBase.


Constructor & Destructor Documentation

IMPORT_C CEikCommandButton::CEikCommandButton  ) 
 

Constructor.

IMPORT_C CEikCommandButton::~CEikCommandButton  ) 
 

C++ destructor.


Member Function Documentation

IMPORT_C void CEikCommandButton::AddCommandToStackL TInt  aCommandId,
const TDesC *  aText,
const CFbsBitmap *  aBitmap,
const CFbsBitmap *  aMask
 

Push a command ID + text + image binding onto the command stack.

Parameters:
aCommandId  Command ID to be generated by pressing this button
aText  Text to display on the button
aBitmap  Bitmap to display on the button
aMask  Mask to use. May be Null
IMPORT_C void CEikCommandButton::ConstructFromResourceL TResourceReader &  aReader  ) 
 

From CCoeControl.

Construct the object from resource

Parameters:
aReader  Fully constructed resource reader

Reimplemented in CEikMenuButton.

IMPORT_C void CEikCommandButton::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handle a pointer event coming from the CONE framework

Parameters:
aPointerEvent  Event to handle

Reimplemented from CEikCommandButtonBase.

Reimplemented in CEikInverterCommandButton, and CEikMenuButton.

IMPORT_C CEikLabel* CEikCommandButton::Label  )  const
 

Access the label control that implements the text label of the button.

Ownership is not transferred.

Returns:
A pointer to the CEikLabel control used to implement the text display
IMPORT_C CEikImage* CEikCommandButton::Picture  )  const
 

Access the CEikImage that implements the picture component of the button.

Ownership is not transferred.

Returns:
A pointer to the CEikImage used to implement the image display.
IMPORT_C TInt CEikCommandButton::PopCommandFromStack  ) 
 

Remove the top (most recently added) command binding from the command stack.

Returns:
the number of commands left on the stack.
IMPORT_C TBool CEikCommandButton::RemoveCommandFromStack TInt  aCommandId  ) 
 

Find the stacked command with a given command ID and remove it from the stack.

Parameters:
aCommandId  ID of the command to be removed
Returns:
EFalse iff the comand is not found
IMPORT_C void CEikCommandButton::SetButtonLayout TLayout  aLayout  ) 
 

Set the layout of the button.

Parameters:
aLayout  Layout to be used
IMPORT_C void CEikCommandButton::SetCommandL TInt  aCommandId,
const TDesC *  aText,
const CFbsBitmap *  aBitmap,
const CFbsBitmap *  aMask
 

Sets the command button's text, bitmap and bitmap mask.

Parameters:
aCommandId  Command ID to be generated by pressing this button
aText  Text to display on the button
aBitmap  Bitmap to display on the button
aMask  Mask to use. May be Null
IMPORT_C void CEikCommandButton::SetDisplayContent TDisplayContent  aContent  ) 
 

Set what content is to be displayed in the button.

Parameters:
aContent  Enum value saying what content to display
IMPORT_C void CEikCommandButton::SetExcessSpace TExcess  aExcess  ) 
 

Sets where the excess space in the layout is to be distributed.

Parameters:
aExcess  Enum value to say where the excess space is to go
IMPORT_C void CEikCommandButton::SetPictureFromFileL const TDesC &  aFilename,
TInt  aMain,
TInt  aMask = -1
 

Set bitmap and mask from file.

IMPORT_C void CEikCommandButton::SetPictureL const CFbsBitmap *  aMain,
const CFbsBitmap *  aMask = NULL
 

Sets the bitmap and optional mask for the button.

Parameters:
aMain  The bitmap to use
aMask  The mask. If null, then no mask will be used
IMPORT_C void CEikCommandButton::SetTextL const TDesC &  aText  ) 
 

Sets the label text for the button.

Parameters:
aText  The text to set
IMPORT_C void CEikCommandButton::UpdateComponentAlignment  )  [virtual]
 

From CEikCommandButtonBase.

Cause a recalculation of the components alignment

Reimplemented from CEikCommandButtonBase.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top