![]() |
AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
#include <CzUILabel.h>
Public Member Functions | |
CzActorText * | getTextActor () |
void | setTextColour (const CzColour &colour) |
CzColour | getTextColour () const |
void | setText (const char *text) |
CzString & | getText () |
void | setSelectedTextColour (const CzColour &colour) |
CzColour | getSelectedTextColour () const |
void | setSelectedText (const char *text) |
CzString & | getSelectedText () |
void | setDisabledTextColour (const CzColour &colour) |
CzColour | getDisabledTextColour () const |
void | setDisabledText (const char *text) |
CzString & | getDisabledText () |
void | setEnabled (bool enabled) |
Enables or disables the actor. | |
bool | setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta) |
Sets the named property of the UILabel. | |
bool | setProperty (unsigned int property_name, const CzString &data, bool delta) |
Sets the named property of the actor. | |
bool | getProperty (unsigned int property_name, CzXomlProperty &prop) |
Gets the named property of the actor. | |
void | setIgnoreCamera (bool enable) |
CzUILabel () | |
virtual bool | InitTextActor (CzFont *font, const CzIRect &rect, const CzString &text, bool auto_height=false, bool text_use_parent_opacity=false, bool filter=true) |
virtual bool | InitTextActor (CzFont *font, const CzIRect &rect, const CzString &text, int flags, eCzAlignH align_h, eCzAlignV align_v, const CzVec4 &skew, const CzIRect &text_margin, bool auto_height, bool text_use_parent_opacity=false, bool filter=true) |
void | SetFromBrush (IzBrush *brush, bool resize=false) |
Sets the actirs brush. | |
bool | Update (float dt) |
Updates this actors logic. | |
int | LoadFromXoml (IzXomlResource *parent, bool load_children, CzXmlNode *node) |
Creates an instance of this class from XML. | |
bool | UpdateFromAnimation (CzAnimInstance *animation) |
Updates actor property from supplied animation. | |
Static Public Member Functions | |
static void | InitClass () |
Initialises the class. | |
static void | ReleaseClass () |
static bool | _setText (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getText (IzXomlResource *target) |
static bool | _setSelectedText (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectedText (IzXomlResource *target) |
static bool | _setDisabledText (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getDisabledText (IzXomlResource *target) |
static bool | _setTextColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getTextColour (IzXomlResource *target) |
static bool | _setSelectedTextColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectedTextColour (IzXomlResource *target) |
static bool | _setDisabledTextColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getDisabledTextColour (IzXomlResource *target) |
static bool | _setAlignH (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setAlignV (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setWrap (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setTextSkew (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getTextSkew (IzXomlResource *target) |
static bool | _setTextMargin (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getTextMargin (IzXomlResource *target) |
static bool | _setRect (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getRect (IzXomlResource *target) |
static bool | _setAutoHeight (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getAutoHeight (IzXomlResource *target) |
static bool | _setTextFilter (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getTextFilter (IzXomlResource *target) |
static CzXomlProperty | _getActorText (IzXomlResource *target) |
static CzXomlProperty | _getTextSize (IzXomlResource *target) |
Protected Member Functions | |
void | UpdateSizeFromText () |
bool | UpdateBinding (unsigned int property_name, CzXomlVariable *var) |
Updates an actor property from the supplied XOML variable. | |
Protected Attributes | |
CzActorText * | TextActor |
CzColour | TextColour |
CzString | Text |
CzColour | SelectedTextColour |
CzString | SelectedText |
CzColour | DisabledTextColour |
CzString | DisabledText |
Static Protected Attributes | |
static CzXomlClassDef * | LabelClassDef = NULL |
CzXomlProperty CzUILabel::_getActorText | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getAutoHeight | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getDisabledText | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getDisabledTextColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getRect | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getSelectedText | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getSelectedTextColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getText | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getTextColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getTextFilter | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getTextMargin | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getTextSize | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUILabel::_getTextSkew | ( | IzXomlResource * | target | ) | [static] |
bool CzUILabel::_setAlignH | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setAlignV | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setAutoHeight | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setDisabledText | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setDisabledTextColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setRect | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setSelectedText | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setSelectedTextColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setText | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setTextColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setTextFilter | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setTextMargin | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setTextSkew | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUILabel::_setWrap | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
CzString& CzUILabel::getDisabledText | ( | ) | [inline] |
CzColour CzUILabel::getDisabledTextColour | ( | ) | const [inline] |
bool CzUILabel::getProperty | ( | unsigned int | property_name, |
CzXomlProperty & | prop | ||
) | [virtual] |
Gets the named property of the actor.
Returns the named property of the actor. The properties value is returned in a CzXomlProperty which is a structure that contains a union of all possible property types. Note that as CzUILabel is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property. | |
[out] | prop | The property data that. |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
CzString& CzUILabel::getSelectedText | ( | ) | [inline] |
CzColour CzUILabel::getSelectedTextColour | ( | ) | const [inline] |
CzString& CzUILabel::getText | ( | ) | [inline] |
CzActorText* CzUILabel::getTextActor | ( | ) | [inline] |
CzColour CzUILabel::getTextColour | ( | ) | const [inline] |
void CzUILabel::InitClass | ( | ) | [static] |
Initialises the class.
Sets up the classes avaiiable properties. Used by the XOML system to find, set amd get class properties.
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
bool CzUILabel::InitTextActor | ( | CzFont * | font, |
const CzIRect & | rect, | ||
const CzString & | text, | ||
bool | auto_height = false , |
||
bool | text_use_parent_opacity = false , |
||
bool | filter = true |
||
) | [virtual] |
bool CzUILabel::InitTextActor | ( | CzFont * | font, |
const CzIRect & | rect, | ||
const CzString & | text, | ||
int | flags, | ||
eCzAlignH | align_h, | ||
eCzAlignV | align_v, | ||
const CzVec4 & | skew, | ||
const CzIRect & | text_margin, | ||
bool | auto_height, | ||
bool | text_use_parent_opacity = false , |
||
bool | filter = true |
||
) | [virtual] |
int CzUILabel::LoadFromXoml | ( | IzXomlResource * | parent, |
bool | load_children, | ||
CzXmlNode * | node | ||
) | [virtual] |
Creates an instance of this class from XML.
LoadFromXoml is the main method used by all classes that can be instantiated from XOML mark-up. This method creates an instance of this class from the supplied XML node structure specified by node. if parent is not NULL then the created instance will utilise the supplied parent to determine where it should live within the app. For example, if the parent is a scene then the actor will be placed in that scene. if the parent is another actor then this actor will be placed into the scene of the supplied actor and linked as a child to the parent actor. If load_chlldren is true then any child nodes contained within the actor will also be loaded. Note that as CzUIBase is derived from CzActorImage, CzActorImage::LoadFromXoml() will also be called to load CzActor specific properties.
[in] | parent | If non-null, the parent. |
load_children | true to load child nodes. | |
[in] | node | If non-null, the XOML markup node that defines this object |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
void CzUILabel::ReleaseClass | ( | ) | [static] |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
void CzUILabel::setDisabledText | ( | const char * | text | ) |
void CzUILabel::setDisabledTextColour | ( | const CzColour & | colour | ) |
void CzUILabel::setEnabled | ( | bool | enabled | ) | [virtual] |
Enables or disables the actor.
When the actor is in a disabled state it cannot be selected and it will not receive touch input.
setEnabled() is also used to set the correct current brush and colour by calling with the currently Enabled state.
enabled | true to enable, false to disable. |
Reimplemented from CzUIBase.
void CzUILabel::SetFromBrush | ( | IzBrush * | brush, |
bool | resize = false |
||
) | [virtual] |
Sets the actirs brush.
Sets the actors brush from the supplied brush. If resie is true then the actors visual size will be resized to the size of the new brush.
[in] | brush | If non-null, the brush. |
resize | true to resize. |
Reimplemented from CzActorImage.
void CzUILabel::setIgnoreCamera | ( | bool | enable | ) | [virtual] |
Reimplemented from CzActor.
bool CzUILabel::setProperty | ( | unsigned int | property_name, |
const CzXomlProperty & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the UILabel.
Sets the named property of this UILabel. The properties value supplied will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true if property should be added to instead of replaced. |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
bool CzUILabel::setProperty | ( | unsigned int | property_name, |
const CzString & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the actor.
Sets the named property of this actor. The properties value (data) is supplied as a string and will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced. Note that as CzUILabel is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true to property should be added to instead of replaced. |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
void CzUILabel::setSelectedText | ( | const char * | text | ) |
void CzUILabel::setSelectedTextColour | ( | const CzColour & | colour | ) |
void CzUILabel::setText | ( | const char * | text | ) |
void CzUILabel::setTextColour | ( | const CzColour & | colour | ) |
bool CzUILabel::Update | ( | float | dt | ) | [virtual] |
Updates this actors logic.
Updates the UI actors logic, including:
This method should be overriden by derived actors to provide the UI actor specific logic.
Note that dt is used to scale actor internals that rely on time. This value enables the actor run in an environment where time (the frame rate of the device) can vary allowing animation to keep up without slowing down or speeding up when the frame rate varies.
Note that if an actor returns false then it will automatically be removed from the scene.
dt | The number of seconds since the app was last updated |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView.
bool CzUILabel::UpdateBinding | ( | unsigned int | property_name, |
CzXomlVariable * | var | ||
) | [protected, virtual] |
Updates an actor property from the supplied XOML variable.
Updates a single property from the value of the bound XOML variable. Note that as CzUILabel is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property. | |
[in,out] | var | If non-null, the variable. |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
bool CzUILabel::UpdateFromAnimation | ( | CzAnimInstance * | animation | ) | [virtual] |
Updates actor property from supplied animation.
Updates the actors property that is specified by the supplied animation. When a timeline animation targets the property of an actor this method will be called by the animation to move the animations frame data into its target property. Note that as CzUILabel is derived from CzUIBase, all CzUIBase properties will also be checked against.
[in] | animation | If non-null, the animation. |
Reimplemented from CzUIBase.
Reimplemented in CzUITextView, CzUITab, and CzUITextBox.
void CzUILabel::UpdateSizeFromText | ( | ) | [protected] |
CzString CzUILabel::DisabledText [protected] |
CzColour CzUILabel::DisabledTextColour [protected] |
CzXomlClassDef * CzUILabel::LabelClassDef = NULL [static, protected] |
CzString CzUILabel::SelectedText [protected] |
CzColour CzUILabel::SelectedTextColour [protected] |
CzString CzUILabel::Text [protected] |
CzActorText* CzUILabel::TextActor [protected] |
CzColour CzUILabel::TextColour [protected] |