Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIButton Class Reference

Button specialization that uses images for graphical representation. More...

#include <GUIButton.h>

Inheritance diagram for CGUIButton:

Public Types

enum  BlitType_t { BBT_CENTER , BBT_MANUAL_LAYOUT , BBT_STRETCH , BBT_TILED }
 enum for blitting-type More...
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT , FOCUS_RIGHT , FOCUS_UP , FOCUS_DOWN }
 

Public Member Functions

 CGUIButton ()
 
 CGUIButton (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const eC_String &rkText, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIButton (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const TextResource_t &eTextID, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIButton (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, CGUICommandPtr pkCommandObject, const ImageResource_t &eBtnStandard, const ImageResource_t &eBtnPressed=DUMMY_IMAGE, const ImageResource_t &eBtnHighlighted=DUMMY_IMAGE, const ImageResource_t &eBtnGrayedOut=DUMMY_IMAGE, const ImageResource_t &eBtnFocused=DUMMY_IMAGE, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIButton (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_String &rkText, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIButton (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const TextResource_t &eTextID, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIButton (const CGUIButton &kSource)
 
virtual ~CGUIButton ()
 
eC_Bool DoDraw ()
 
CGUIRect GetBlitRect () const
 
BlitType_t GetBlitType () const
 
void GetImages (ImageResource_t &eBtnStandard, ImageResource_t &eBtnPressed, ImageResource_t &eBtnHighlighted, ImageResource_t &eBtnGrayedOut, ImageResource_t &eBtnFocused)
 
CGUINinePatchGetNinePatch ()
 
CGUIButtonoperator= (const CGUIButton &kSource)
 
virtual void ReadFromStream ()
 
void SetBlitRect (const CGUIRect &kBlitRect)
 
void SetBlitType (const BlitType_t &eBlitType)
 
void SetImages (const ImageResource_t &eBtnStandard, const ImageResource_t &eBtnPressed, const ImageResource_t &eBtnHighlighted, const ImageResource_t &eBtnGrayedOut, const ImageResource_t &eBtnFocused)
 
void SetStandardImages ()
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIBaseButton
 CGUIBaseButton ()
 
 CGUIBaseButton (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const eC_String &kText, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIBaseButton (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const TextResource_t &eTextID, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIBaseButton (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_String &kText, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIBaseButton (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const TextResource_t &eTextID, CGUICommandPtr pkCommandObject, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIBaseButton (const CGUIBaseButton &kSource)
 
virtual ~CGUIBaseButton (void)
 
virtual eC_Bool DoButtonDown (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDraw ()
 
CGUICommandPtr GetCommand () const
 
CGUITextGetLabel () const
 
CGUIBaseButtonoperator= (const CGUIBaseButton &kSource)
 
virtual void ReadFromStream ()
 
void SetCommand (CGUICommandPtr pkCommand)
 
virtual void SetHeight (const eC_Value &vNewHeight)
 
void SetLabel (const eC_String &kString)
 
void SetLabel (const TextResource_t &eTextID)
 
void SetText (CGUIText *pkText)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual void SetWidth (const eC_Value &vNewWidth)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIObject
 CGUIObject ()
 
 CGUIObject (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (const CGUIObject &kSource)
 
virtual ~CGUIObject ()
 
void AddValueObserver (CGUIObserver *pkObserver)
 
eC_Bool CalculateInvalidatedRect (CGUIRect &rRect) const
 
virtual eC_Bool ClaimFocus ()
 
virtual void CreateSnapshot (eC_UInt uiBackColor=0x00)
 
eC_Bool DataPoolConnectorExists () const
 
void DeleteSnapshot ()
 
virtual void DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true)
 
virtual eC_Bool DoDraw ()
 
virtual eC_Bool DoDrawSnapshot ()
 
virtual void EnableSnapshotDrawing ()
 
virtual CGUIObjectFindObject (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool FocusAny ()
 
virtual eC_Bool FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
virtual eC_Bool FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
CGUIRect GetAbsRect () const
 
eC_Value GetAbsXPos () const
 
eC_Value GetAbsXPosCenter () const
 
eC_Value GetAbsXPosREdge () const
 
eC_Value GetAbsYPos () const
 
eC_Value GetAbsYPosBEdge () const
 
eC_Value GetAbsYPosCenter () const
 
eC_UByte GetAlpha () const
 
CGUIBehaviourDecoratorGetBehaviour ()
 
const CGUIBehaviourDecoratorGetBehaviour () const
 
GUIBitmapPlaneID_t GetBitmapID () const
 
CGUIBitmapPlaneGetBitmapPlane () const
 
CGUIRect GetCurrentAbsRect () const
 
eC_Value GetCurrentAbsXPos () const
 
eC_Value GetCurrentAbsXPosCenter () const
 
eC_Value GetCurrentAbsXPosREdge () const
 
eC_Value GetCurrentAbsYPos () const
 
eC_Value GetCurrentAbsYPosBEdge () const
 
eC_Value GetCurrentAbsYPosCenter () const
 
CDataPoolConnectorGetDataPoolConnector ()
 
eC_Value GetDistanceBottom () const
 
eC_Value GetDistanceRight () const
 
eC_Value GetHalfHeight () const
 
eC_Value GetHalfWidth () const
 
eC_Value GetHeight () const
 
ObjectHandle_t GetID () const
 
CGUILayouterGetLayouter ()
 
const CGUILayouterGetLayouter () const
 
ObjectHandle_t GetNeighborBottomID () const
 
ObjectHandle_t GetNeighborLeftID () const
 
ObjectHandle_t GetNeighborRightID () const
 
ObjectHandle_t GetNeighborTopID () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
CGUIRect GetOriginRect () const
 
CGUICompositeObjectGetParent ()
 
const CGUICompositeObjectGetParent () const
 
CGUIRect GetRelRect () const
 
eC_Value GetRelXPos () const
 
eC_Value GetRelXPosCenter () const
 
eC_Value GetRelXPosREdge () const
 
eC_Value GetRelYPos () const
 
eC_Value GetRelYPosBEdge () const
 
eC_Value GetRelYPosCenter () const
 
UUID_t GetUUID () const
 
eC_Value GetWidth () const
 
void InvalidateArea ()
 
eC_Bool IsClickable () const
 
eC_Bool IsClickThrough () const
 
virtual eC_Bool IsCompositeObject () const
 
eC_Bool IsDescendantOf (const CGUIObject *const pAncestor) const
 
eC_Bool IsDisabled () const
 
eC_Bool IsDragable () const
 
eC_Bool IsDragged () const
 
eC_Bool IsDrawingSnapshot () const
 
eC_Bool IsFocussable () const
 
eC_Bool IsFocussed () const
 
eC_Bool IsGrayedOut () const
 
virtual eC_Bool IsHighlightable () const
 
eC_Bool IsHighlighted () const
 
eC_Bool IsInvisible () const
 
eC_Bool IsPressed () const
 
eC_Bool IsStopFocus () const
 
void NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
CGUIObjectoperator= (const CGUIObject &kSource)
 
virtual void ReadFromStream ()
 
virtual void RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const
 
void RemoveValueObserver (CGUIObserver *pkObserver)
 
void RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0))
 
eC_Bool RequestFocus ()
 
void SetAlpha (eC_UByte ubAlpha)
 
void SetBehaviour (CGUIBehaviourDecorator *pkBehaviour)
 
void SetClickThrough (const eC_Bool &bClickThrough)
 
virtual void SetDisabled (const eC_Bool &bDisabled)
 
virtual void SetFocussable (const eC_Bool &bFocussable)
 
virtual void SetGrayedOut (const eC_Bool &bGrayOut)
 
virtual void SetHeight (const eC_Value &vY)
 
void SetID (const ObjectHandle_t &eID)
 
virtual void SetInvisible (const eC_Bool &bInvisible)
 
void SetLayouter (CGUILayouter *pLayouter)
 
void SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID)
 
void SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID)
 
void SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID)
 
virtual void SetParent (CGUICompositeObject *const pkParent)
 
void SetRelRect (const CGUIRect &kNewRect)
 
virtual void SetRelXPos (const eC_Value &vX)
 
void SetRelXPosCenter (const eC_Value &vXCenter)
 
void SetRelXPosREdge (const eC_Value &vX)
 
virtual void SetRelYPos (const eC_Value &vY)
 
void SetRelYPosBEdge (const eC_Value &vY)
 
void SetRelYPosCenter (const eC_Value &vYCenter)
 
void SetStopFocus (const eC_Bool &bDontFocusToParent)
 
void SetUUID (const UUID_t &kUUID)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual void SetWidth (const eC_Value &vX)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoScale (const eC_Value &vDelta)
 
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual void OnCreate ()
 
virtual void OnDataPool (const DataPoolResource_t &eID)
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
virtual eC_Bool DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual void GetFocus ()
 
virtual void LoseFocus ()
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoScroll (const eC_Value &vAbsX, const eC_Value &vAbsY, const eC_Value &vDelta, const eC_Bool &bModifierActive)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
virtual void ReadFromStream ()
 
void SetXMLTag (const eC_String &kXMLTag)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 

Protected Attributes

BlitType_t m_eBlitType
 used blitting-type
 
ImageResource_t m_eBtnFocused
 the focused image
 
ImageResource_t m_eBtnGrayedOut
 the grayed out image
 
ImageResource_t m_eBtnHighlighted
 the highlighted image
 
ImageResource_t m_eBtnNormal
 the standard image
 
ImageResource_t m_eBtnPressed
 the pressed image
 
CGUIRect m_kBlitRect
 used blitting-rect for manual-layout
 
CGUINinePatch m_kNinePatch
 the nine patch
 
- Protected Attributes inherited from CGUIBaseButton
CGUICommandPtr m_pkCommandObject
 Holds the attached command.
 
CGUITextm_pkLabel
 Holds the label.
 
- Protected Attributes inherited from CGUIObject
UUID_t m_kUUID
 UUID of object.
 

Additional Inherited Members

- Static Public Member Functions inherited from CGUIStreamableObject
static UUID_t GenerateUUID ()
 
- Static Public Attributes inherited from CGUIObject
static const eC_Char XMLTAG_ALPHA []
 XML tag to be used writing alpha-value into a stream.
 
static const eC_Char XMLTAG_CLICKTHROUGH []
 XML tag to be used writing clickthrough-state into a stream.
 
static const eC_Char XMLTAG_CONTROLCLASSID []
 XML tag to be used when writing a control class ID into a stream.
 
static const eC_Char XMLTAG_DISABLED []
 XML tag to be used writing disabled-state into a stream.
 
static const eC_Char XMLTAG_FOCUSSABLE []
 XML tag to be used writing focussable-state into a stream.
 
static const eC_Char XMLTAG_GRAYEDOUT []
 XML tag to be used writing grayedout-state into a stream.
 
static const eC_Char XMLTAG_HEIGHT []
 XML tag to be used writing height into a stream.
 
static const eC_Char XMLTAG_INVISIBLE []
 XML tag to be used writing invisible-state into a stream.
 
static const eC_Char XMLTAG_OBJECTID []
 XML tag to be used writing object id into a stream.
 
static const eC_Char XMLTAG_OVERRIDDENNEIGHBORS []
 XML tag to be used writing overridden neighbors into a stream.
 
static const eC_Char XMLTAG_UUID []
 XML tag to be used when writing a UUID into a stream.
 
static const eC_Char XMLTAG_WIDTH []
 XML tag to be used writing width into a stream.
 
static const eC_Char XMLTAG_XPOS []
 XML tag to be used writing x-position into a stream.
 
static const eC_Char XMLTAG_YPOS []
 XML tag to be used writing y-position into a stream.
 
- Static Public Attributes inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID []
 XML tag to be used when writing a behaviour class ID into a stream.
 
static const eC_Char XMLTAG_BEHAVIOURCOUNT []
 XML tag for count.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION []
 
- Protected Member Functions inherited from CGUIObject
virtual eC_Bool CreateBitmapPlane ()
 
virtual eC_Bool FourWayNext (FourWayFocus_t eFocusDirection)
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 

Detailed Description

Button specialization that uses images for graphical representation.

The "button" control is used to trigger commands. The individual states of the button are visualized by different images. Five different states are supported: Normal, highlighted, pressed, grayed out and focused. The "button" control is one of the central elements of a touchscreen based application (Class: CGUIButton). The "button" control is offering comfortable means to zoom a button with only minimal impact on the button borders. The button can be divided into fully user-defined areas (Top, Bottom, Left, Right). The corner areas will remain completely untouched, while the border patches will be stretched in one direction only. Only the center area will be stretched in two dimensions (CGUINinePatch).

Please refer to the base class (GUIBaseButton) for a general explanation of the button object. This specialization differs from its base class by visualizing itself using images. You may assign one image to each of the button's states using the SetImages() method. Note that the supplied images will be stretched to the Button's size, which may result in reduced visual quality if the image's size and the button's size differ significantly. If you need to stretch your button, consider using its Nine Patch functionality. (see CGUINinePatch)

Example:

// Create a button.
CGUIButton* pkButton = new CGUIButton(this,
eC_FromInt(0), eC_FromInt(0),
eC_FromInt(15), eC_FromInt(15),
"OK",
NULL, // Replace the NULL with your command.
OBJ_BUTTON);
// Set the images of the button.
// Before calling this method, please add image IDs to UserImageResource.h.
// After that call GETRESMANAGER.RegisterImageResource() method to register images for the IDs.
pkButton->SetImages(
IMG_BT_STANDARD,
IMG_BT_PRESSED,
IMG_BT_HIGHLIGHTED,
IMG_BT_GRAYEDOUT,
IMG_BT_FOCUSED);
Button specialization that uses images for graphical representation.
Definition: GUIButton.h:69
void SetImages(const ImageResource_t &eBtnStandard, const ImageResource_t &eBtnPressed, const ImageResource_t &eBtnHighlighted, const ImageResource_t &eBtnGrayedOut, const ImageResource_t &eBtnFocused)

Member Enumeration Documentation

◆ BlitType_t

enum for blitting-type

Enumerator
BBT_MANUAL_LAYOUT 

blit image centered

BBT_STRETCH 

blit image according to manual layout

BBT_TILED 

stretch image to fit

tile image to fit

Constructor & Destructor Documentation

◆ CGUIButton() [1/7]

CGUIButton::CGUIButton ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const eC_String &  rkText,
CGUICommandPtr  pkCommandObject,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIButton constructor.

Parameters
pkParentPointer to the designated parent object
vXX-position relative to its parent object
vYY-position relative to its parent object
vWidthWidth of the button
vHeightHeight of the button
rkTextText string that will be displayed on the Button
pkCommandObjectPointer to command object which will be executed in reaction to a click
eIDObject Identifier of this button

◆ CGUIButton() [2/7]

CGUIButton::CGUIButton ( CGUICompositeObject *const  pkParent,
const CGUIRect kRect,
const eC_String &  rkText,
CGUICommandPtr  pkCommandObject,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIButton constructor.

Parameters
pkParentPointer to the designated parent object
kRectBoundary rectangle of the button relative to the parent.
rkTextText string that will be displayed on the Button
pkCommandObjectPointer to command object which will be executed in reaction to a click
eIDObject Identifier of this button

◆ CGUIButton() [3/7]

CGUIButton::CGUIButton ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const TextResource_t eTextID,
CGUICommandPtr  pkCommandObject,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIButton constructor.

Parameters
pkParentPointer to the designated parent object
vXX-position relative to its parent object
vYY-position relative to its parent object
vWidthWidth of the button
vHeightHeight of the button
eTextIDID of text string to be displayed on the Button
pkCommandObjectPointer to command object which will be executed in reaction to a click
eIDObject Identifier of this button (choose NO_HANDLE if none is required)

◆ CGUIButton() [4/7]

CGUIButton::CGUIButton ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
CGUICommandPtr  pkCommandObject,
const ImageResource_t eBtnStandard,
const ImageResource_t eBtnPressed = DUMMY_IMAGE,
const ImageResource_t eBtnHighlighted = DUMMY_IMAGE,
const ImageResource_t eBtnGrayedOut = DUMMY_IMAGE,
const ImageResource_t eBtnFocused = DUMMY_IMAGE,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIButton constructor which sets width and height depending on the size of the given standard image.

Parameters
pkParentPointer to the designated parent object
vXX-position relative to its parent object
vYY-position relative to its parent object
pkCommandObjectPointer to command object which will be executed in reaction to a click
eBtnStandardImageID for button in standard state
eBtnPressedImageID for button in pressed state
eBtnHighlightedImageID for button in highlight state
eBtnGrayedOutImageID for button in grayed out state
eBtnFocusedImageID for button in focused state
eIDObject Identifier of this button.

◆ CGUIButton() [5/7]

CGUIButton::CGUIButton ( CGUICompositeObject *const  pkParent,
const CGUIRect kRect,
const TextResource_t eTextID,
CGUICommandPtr  pkCommandObject,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIButton constructor.

Parameters
pkParentPointer to the designated parent object
kRectBoundary rectangle of the button relative to the parent.
eTextIDID of text string to be displayed on the Button
pkCommandObjectPointer to command object which will be executed in reaction to a click
eIDObject Identifier of this button (choose NO_HANDLE if none is required)

◆ CGUIButton() [6/7]

CGUIButton::CGUIButton ( const CGUIButton kSource)

CGUIButton copy-constructor.

Parameters
kSourceSource object to be copied

◆ CGUIButton() [7/7]

CGUIButton::CGUIButton ( )

Standard constructor

See also
CGUIObject().

◆ ~CGUIButton()

virtual CGUIButton::~CGUIButton ( )
virtual

CGUIButton destructor

Member Function Documentation

◆ DoDraw()

eC_Bool CGUIButton::DoDraw ( )
virtual

Visualizes the object. It is forbidden to call SetRelXPos, SetRelYPos, SetWidth or SetHeight in DoDraw, i.e., it is not allowed to change the layout.

Returns
True if anything was drawn, False otherwise

Reimplemented from CGUIBaseButton.

Reimplemented in CGUIIconButton.

◆ GetBlitRect()

CGUIRect CGUIButton::GetBlitRect ( ) const

Returns the currently set rectangle for manual layout

Returns
rectangle

◆ GetBlitType()

BlitType_t CGUIButton::GetBlitType ( ) const

Returns the currently used blitting-type

Returns
blitting-type

◆ GetImages()

void CGUIButton::GetImages ( ImageResource_t eBtnStandard,
ImageResource_t eBtnPressed,
ImageResource_t eBtnHighlighted,
ImageResource_t eBtnGrayedOut,
ImageResource_t eBtnFocused 
)

Retrieves currently set images

Parameters
eBtnStandardImageID for button in standard state
eBtnPressedImageID for button in pressed state
eBtnHighlightedImageID for button in highlight state
eBtnGrayedOutImageID for button in grayed out state
eBtnFocusedImageID for button in focused state

◆ GetNinePatch()

CGUINinePatch & CGUIButton::GetNinePatch ( )
inline

Grants access to the object's nine patch.

Returns
Nine patch used to display the object

◆ operator=()

CGUIButton & CGUIButton::operator= ( const CGUIButton kSource)

CGUIButton operator= to copy the whole CGUIButton.

Parameters
kSourceSource object to be copied
Returns
Copied object

◆ ReadFromStream()

virtual void CGUIButton::ReadFromStream ( )
virtual

Reads all object attributes from streaming file. Only for use with GUIFactory. GUIStreamingFileReader has to be set in CGUI::Init().

See also
CGUIFactory

Reimplemented from CGUIBaseButton.

Reimplemented in CGUIBlendButton, and CGUIIconButton.

◆ SetBlitRect()

void CGUIButton::SetBlitRect ( const CGUIRect kBlitRect)

Sets the Rectangle which is used for manual layout

Parameters
kBlitRectrectangle for manual layout

◆ SetBlitType()

void CGUIButton::SetBlitType ( const BlitType_t eBlitType)

Sets the blitting-type to be used

Parameters
eBlitTypeblitting-type

◆ SetImages()

void CGUIButton::SetImages ( const ImageResource_t eBtnStandard,
const ImageResource_t eBtnPressed,
const ImageResource_t eBtnHighlighted,
const ImageResource_t eBtnGrayedOut,
const ImageResource_t eBtnFocused 
)

With this function images which will be drawn for representation can be set. Five images for the five supported states of an image button.

Parameters
eBtnStandardImageID for button in standard state
eBtnPressedImageID for button in pressed state
eBtnHighlightedImageID for button in highlight state
eBtnGrayedOutImageID for button in grayed out state
eBtnFocusedImageID for button in focused state

◆ SetStandardImages()

void CGUIButton::SetStandardImages ( )

Sets all images to the framework's standard images.

◆ WriteToStream()

virtual void CGUIButton::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.

Parameters
bWriteClassIDThis flag is used to select if writing of ControlID, leading and trailing tags is performed. Only GUIStreamWriter and GUICompositeObject have to set this flag true.
See also
CGUIStreamWriter

Reimplemented from CGUIBaseButton.

Reimplemented in CGUIBlendButton, and CGUIIconButton.


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