My Project
SallyAPI::GUI::CButton Class Reference

Button. More...

#include <Button.h>

Inheritance diagram for SallyAPI::GUI::CButton:
SallyAPI::GUI::CControl SallyAPI::GUI::CGUIBaseObject SallyAPI::Core::CBaseObject SallyAPI::GUI::CButtonBarButton SallyAPI::GUI::CListViewButton SallyAPI::GUI::CRoundButton SallyAPI::GUI::CSideMenuButton SallyAPI::GUI::CTabcontrolButton

List of all members.

Public Member Functions

 CButton (SallyAPI::GUI::CGUIBaseObject *parent, int x, int y, int width, int height, int controlId=0, ButtonType type=BUTTON_TYPE_NORMAL)
 Constructor.
virtual ~CButton ()
 Destructor.
virtual void Timer (float timeDelta)
 Timers.
bool GetCheckStatus ()
 Gets the check status.
void SetCheckStatus (bool value)
 Sets a check status.
void SetActive (bool set)
 Sets the button active flag.
bool GetActive ()
 Gets the active flag.
void SetDefaultButton (bool value)
 Sets a default button. Set this flag to true to make it a default button. A default button is displayed eye-catching.
bool GetDefaultButton ()
 Gets the default button.
void SetImageLeft ()
 Sets draw the image on the left side of the button.
void SetImageRight ()
 Sets draw the image on the right side of the button.
void SetImageId (int image)
 Sets an image identifier. If you wan't to remove the image set GUI_NO_IMAGE.
bool IsUseHoleWidth ()
 Query if this object is use hole width.
void UseHoleWidth (bool use)
 Set use hole width for text draw. Usually a button has a border on the left and on the right. The thickness of the border depends on the theme used. If you set this value to true there will be no border. This flag should be used with align center.
void SetFourTexts (int i, const std::string &text)
 Sets text if the button is from the type BUTTON_TYPE_FOUR_TEXTS.
std::string GetFourTexts (int i)
 Gets a four texts.
void SetFourTextActive (int i)
 Sets a four text active.
virtual void SetImageText (const std::string &text)
 Sets the text which is printed over the image.
virtual std::string GetImageText ()
 Gets the text which is printed over the image.
virtual void SetImageTextColor (D3DCOLOR rgbFontColour)
 Sets the font color of the image text.
virtual bool IsImageTextLocalised ()
 Query if this object is image text localised.
virtual void SetImageTextLocalised (bool localised)
 Sets an image text localised.

Protected Member Functions

void DrawImageText (int x, int y, int width, int height)
 Draw the text ovver the image set to the control.
void DrawFourTextItem (RECT r, const std::string &text, bool active, int itemNumber=-1, bool pressed=false)
 Draw four text item.
virtual void RenderControl ()
 Renders a control.
virtual bool ProcessMouseUp (int x, int y)
 Process a mouse up. The button sends a GUI_BUTTON_CLICKED message to his parent.
virtual bool ProcessMouseMove (int x, int y)
 Process a mouse move.

Protected Attributes

int m_iImage
std::string m_strImageText
bool m_bImageTextLocalised
D3DCOLOR m_rgbImageFontColour
ButtonType m_eType
int m_iImageSize
 Not valide for BUTTON_TYPE_ONLY_IMAGE.
bool m_bImageLeft
 Not valide for BUTTON_TYPE_ONLY_IMAGE.
bool m_bChecked
 Not valide for BUTTON_TYPE_ONLY_IMAGE.
bool m_bActive
 Not valide for BUTTON_TYPE_ONLY_IMAGE.
bool m_bDefaultButton
 Not valide for BUTTON_TYPE_ONLY_IMAGE.
float m_fDeltaStart
bool m_bUseHoleWidth
 Only valide for BUTTON_TYPE_NORMAL.
std::string m_strFourTexts [4]
 Only valide for BUTTON_TYPE_FOUR_TEXTS.
int m_iFourTextsActive
 Only valide for BUTTON_TYPE_FOUR_TEXTS.

Detailed Description

Button.

Author:
Christian Knobloch
Date:
19.04.2010

Constructor & Destructor Documentation

CButton::CButton ( SallyAPI::GUI::CGUIBaseObject parent,
int  x,
int  y,
int  width,
int  height,
int  controlId = 0,
ButtonType  type = BUTTON_TYPE_NORMAL 
)

Constructor.

m_iImageSize(ICON_SIZE), m_bChecked(false), m_bActive(false), m_fDeltaStart(0), m_bDefaultButton(false), m_bUseHoleWidth(false)

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
[in,out]parentIf non-null, the parent.
xThe x coordinate.
yThe y coordinate.
widthThe width.
heightThe height.
controlIdIdentifier for the control.
typeThe type.
CButton::~CButton ( ) [virtual]

Destructor.

Author:
Christian Knobloch
Date:
19.04.2010

Member Function Documentation

void CButton::DrawFourTextItem ( RECT  r,
const std::string &  text,
bool  active,
int  itemNumber = -1,
bool  pressed = false 
) [protected]

Draw four text item.

Author:
Christian Knobloch
Date:
15.02.2011
Parameters:
rThe.
textThe text.
activetrue to active.
itemNumberThe item number.
pressedtrue to pressed.
void CButton::DrawImageText ( int  x,
int  y,
int  width,
int  height 
) [protected]

Draw the text ovver the image set to the control.

Author:
Christian Knobloch
Date:
29.06.2011
Parameters:
xThe x coordinate.
yThe y coordinate.
widthThe width.
heightThe height.

Gets the active flag.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.

Gets the check status.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.

Gets the default button.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
std::string CButton::GetFourTexts ( int  i)

Gets a four texts.

Author:
Christian Knobloch
Date:
26.09.2010
Parameters:
iThe index.
Returns:
The four texts.
std::string CButton::GetImageText ( ) [virtual]

Gets the text which is printed over the image.

Author:
Christian Knobloch
Date:
29.06.2011
Returns:
The icon text.
bool CButton::IsImageTextLocalised ( ) [virtual]

Query if this object is image text localised.

Author:
Christian Knobloch
Date:
29.06.2011
Returns:
true if image text localised, false if not.

Query if this object is use hole width.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if use hole width, false if not.
bool CButton::ProcessMouseMove ( int  x,
int  y 
) [protected, virtual]

Process a mouse move.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
xThe x coordinate.
yThe y coordinate.
Returns:
true if it succeeds, false if it fails.

Reimplemented from SallyAPI::GUI::CControl.

bool CButton::ProcessMouseUp ( int  x,
int  y 
) [protected, virtual]

Process a mouse up. The button sends a GUI_BUTTON_CLICKED message to his parent.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
xThe x coordinate.
yThe y coordinate.
Returns:
true if it succeeds, false if it fails.

Reimplemented from SallyAPI::GUI::CControl.

void CButton::RenderControl ( ) [protected, virtual]

Renders a control.

Author:
Christian Knobloch
Date:
19.04.2010

Implements SallyAPI::GUI::CGUIBaseObject.

Reimplemented in SallyAPI::GUI::CSideMenuButton, and SallyAPI::GUI::CButtonBarButton.

void CButton::SetActive ( bool  set)

Sets the button active flag.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
settrue to set.
void CButton::SetCheckStatus ( bool  value)

Sets a check status.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
valuetrue to value.
void CButton::SetDefaultButton ( bool  value)

Sets a default button. Set this flag to true to make it a default button. A default button is displayed eye-catching.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
valuetrue to value.
void CButton::SetFourTextActive ( int  i)

Sets a four text active.

Author:
Christian Knobloch
Date:
26.09.2010
Parameters:
iThe index.
void CButton::SetFourTexts ( int  i,
const std::string &  text 
)

Sets text if the button is from the type BUTTON_TYPE_FOUR_TEXTS.

Author:
Christian Knobloch
Date:
21.09.2010
Parameters:
iThe index from 0 to 3
textThe text.
void CButton::SetImageId ( int  image)

Sets an image identifier. If you wan't to remove the image set GUI_NO_IMAGE.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
imageThe image.

Sets draw the image on the left side of the button.

Author:
Christian Knobloch
Date:
19.04.2010

Sets draw the image on the right side of the button.

Author:
Christian Knobloch
Date:
19.04.2010
void CButton::SetImageText ( const std::string &  text) [virtual]

Sets the text which is printed over the image.

Author:
Christian Knobloch
Date:
29.06.2011
Parameters:
textThe text.
void CButton::SetImageTextColor ( D3DCOLOR  rgbFontColour) [virtual]

Sets the font color of the image text.

Author:
Christian Knobloch
Date:
29.06.2011
Parameters:
rgbFontColourThe rgb font colour.
void CButton::SetImageTextLocalised ( bool  localised) [virtual]

Sets an image text localised.

Author:
Christian Knobloch
Date:
29.06.2011
Parameters:
localisedtrue to localised.
void CButton::Timer ( float  timeDelta) [virtual]

Timers.

Author:
Christian Knobloch
Date:
26.05.2011
Parameters:
timeDeltaThe time delta.

Reimplemented from SallyAPI::GUI::CControl.

Reimplemented in SallyAPI::GUI::CListViewButton.

void CButton::UseHoleWidth ( bool  use)

Set use hole width for text draw. Usually a button has a border on the left and on the right. The thickness of the border depends on the theme used. If you set this value to true there will be no border. This flag should be used with align center.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
usetrue to use.

Member Data Documentation

Not valide for BUTTON_TYPE_ONLY_IMAGE.

Not valide for BUTTON_TYPE_ONLY_IMAGE.

Not valide for BUTTON_TYPE_ONLY_IMAGE.

Not valide for BUTTON_TYPE_ONLY_IMAGE.

Only valide for BUTTON_TYPE_NORMAL.

Only valide for BUTTON_TYPE_FOUR_TEXTS.

Not valide for BUTTON_TYPE_ONLY_IMAGE.

std::string SallyAPI::GUI::CButton::m_strFourTexts[4] [protected]

Only valide for BUTTON_TYPE_FOUR_TEXTS.

std::string SallyAPI::GUI::CButton::m_strImageText [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines