AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
Base class of all UI components. More...
#include <CzUIBase.h>
Public Types | |
enum | eSelectType { SelectType_Normal, SelectType_Toggle, SelectType_Sticky } |
Values that represent different types of selection modes. More... | |
enum | eAxis { Axis_None, Axis_X, Axis_Y, Axis_XY } |
Values that represent horizonal, vertical and both axis. More... | |
Public Member Functions | |
void | setVisible (bool visible, bool force_set=false) |
Makes an actor visible. | |
void | setBackgroundBrush (IzBrush *brush) |
Sets background brush of the actor. | |
IzBrush * | getBackgroundBrush () const |
void | setBackgroundColour (const CzColour &colour) |
Sets background colour of the actor. | |
CzColour | getBackgroundColour () const |
void | setSelectedBackgroundBrush (IzBrush *brush) |
Sets selected background brush of the actor. | |
IzBrush * | getSelectedBackgroundBrush () const |
void | setSelectedBackgroundColour (const CzColour &colour) |
Sets selected background colour of the actor. | |
CzColour | getSelectedBackgroundColour () const |
void | setDisabledBackgroundBrush (IzBrush *brush) |
Sets disabled background brush of the actor. | |
IzBrush * | getDisabledBackgroundBrush () const |
void | setDisabledBackgroundColour (const CzColour &colour) |
Sets disabled background colour of the actor. | |
CzColour | getDisabledBackgroundColour () const |
void | setSelectType (eSelectType type) |
eSelectType | getSelectType () const |
void | setSelected (bool selected, bool force_select=false) |
Sets actors selected state. | |
bool | isSelected () const |
virtual void | setEnabled (bool enabled) |
Enables or disables the actor. | |
bool | isEnabled () const |
bool | setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta) |
Sets the named property of the actor. | |
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 | setLayoutDirty (bool dirty) |
Sets layout as dirty. | |
bool | isLayoutDirty () const |
void | setClippingMargin (int x, int y, int w, int h) |
CzIRect | getClippingMargin () |
void | setScrollPos (float x, float y) |
Sets scroll position. | |
CzVec2 | getScrollPos () const |
CzVec2 | getPreviousScrollPos () const |
void | setScrollVelocity (float x, float y) |
CzVec2 | getScrollVelocity () const |
void | setScrollRange (int x, int y, int w, int h) |
CzIRect | getScrollRange () const |
void | setToggledOn (bool toggled_on) |
Sets actores toggled state. | |
bool | isToggledOn () const |
void | setShowTimeline (CzAnimTimeline *timeline) |
Sets show timeline deleting any previously assigned none managed show timeline. | |
CzAnimTimeline * | getShowTimeline () const |
void | setHideTimeline (CzAnimTimeline *timeline) |
Sets hide timeline deleting any previously assigned none managed hide timeline. | |
CzAnimTimeline * | getHideTimeline () const |
void | setNeedsResize (bool resize) |
bool | getNeedsResize () const |
void | setSizeToContentAxis (eAxis axis) |
eAxis | getSizeToContentAxis () const |
void | NotifyParentsResize () |
Notifies the parent to resize its layout. | |
void | setColourOffset (const CzIRect &offset) |
void | resetColourOffset () |
CzIRect | getColourOffset () const |
void | setShowTimeline (const char *timeline_name) |
void | setHideTimeline (const char *timeline_name) |
Sets hide timeline to the named timeline. | |
void | setEnableSpring (bool enable) |
bool | getEnableSpring () const |
CzUIBase () | |
virtual | ~CzUIBase () |
bool | Init (IzBrush *brush, int width, int height) |
Initialises this UI actor. | |
bool | Update (float dt) |
Updates this actors logic. | |
virtual void | ResizeToContent () |
Resizes the actor to fit its content. | |
void | NotifyTapped (int index, int x, int y, bool allow_bubble) |
OnTapped event handler. | |
void | NotifyBeginTouch (int index, int x, int y, bool allow_bubble) |
OnBeginTouch event handler. | |
void | NotifyEndTouch (int index, int x, int y, bool allow_bubble) |
OnEndTouch event handler. | |
virtual void | NotifyToggledOn () |
Handles the toggled on event. | |
virtual void | NotifyToggledOff () |
Handles the toggled off event. | |
virtual void | NotifyBackKey () |
Handles the back key press evente. | |
virtual void | NotifyMenuKey () |
Handles the menu key press evente. | |
void | NotifyOrientationChange (CzScene::eOrientation old_orientation, CzScene::eOrientation new_orientation) |
Handles the orientation change event. | |
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 | InitPresetAnimations () |
Initialises the preset animations. | |
static void | ReleasePresetAnimations () |
Initialises the preset animations. | |
static void | UpdatePresetAnimations () |
Updates the preset animations. | |
static CzAnim * | FindPresetAnimation (unsigned int name_hash) |
Searches for the first preset animation. | |
static void | InitClass () |
Initialises the class. | |
static void | ReleaseClass () |
static bool | _setSize (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSize (IzXomlResource *target) |
static bool | _setBackground (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getBackground (IzXomlResource *target) |
static bool | _setSelectedBackground (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectedBackground (IzXomlResource *target) |
static bool | _setDisabledBackground (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getDisabledBackground (IzXomlResource *target) |
static bool | _setBackgroundColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getBackgroundColour (IzXomlResource *target) |
static bool | _setSelectedColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectedColour (IzXomlResource *target) |
static bool | _setDisabledColour (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getDisabledColour (IzXomlResource *target) |
static bool | _setEnabled (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getEnabled (IzXomlResource *target) |
static bool | _setSelected (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelected (IzXomlResource *target) |
static bool | _setScrollPos (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getScrollPos (IzXomlResource *target) |
static bool | _setSelectType (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectType (IzXomlResource *target) |
static bool | _setSpring (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSpring (IzXomlResource *target) |
static bool | _setOnToggledOn (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setOnToggledOff (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setOnBackKey (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setOnMenuKey (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setClipMargin (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getClipMargin (IzXomlResource *target) |
static bool | _setScrollRange (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getScrollRange (IzXomlResource *target) |
static bool | _setShowTimeline (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getShowTimeline (IzXomlResource *target) |
static bool | _setHideTimeline (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getHideTimeline (IzXomlResource *target) |
static bool | _setSizeToContentAxis (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSizeToContentAxis (IzXomlResource *target) |
static bool | _setKeyFocus (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getKeyFocus (IzXomlResource *target) |
static bool | _setToggledOn (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getToggledOn (IzXomlResource *target) |
static bool | _setColourOffset (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getColourOffset (IzXomlResource *target) |
Static Public Attributes | |
static CzList< CzAnim * > | PresetAnimations |
Protected Member Functions | |
bool | UpdateBinding (unsigned int property_name, CzXomlVariable *var) |
Updates an actor property from the supplied XOML variable. | |
virtual bool | UpdateLayout () |
Updates the actors layout. | |
bool | ScrollRangeCheck () |
Prevents scroll position from giong out of bounds. | |
Protected Attributes | |
bool | PrevSelected |
Previous Selected status. | |
bool | ToggledOn |
ToggledOn state. | |
bool | Selected |
Selected status. | |
IzBrush * | BackgroundBrush |
Default none selected brush. | |
CzColour | BackgroundColour |
Default none selected colour. | |
IzBrush * | SelectedBackgroundBrush |
Selected brush. | |
CzColour | SelectedBackgroundColour |
Selected colour. | |
IzBrush * | DisabledBackgroundBrush |
Disabled brush. | |
CzColour | DisabledBackgroundColour |
Disabled colour. | |
bool | Enabled |
Enabled state. | |
bool | LayoutDirty |
When true the layout of this element and any children is re-calculated. | |
eSelectType | SelectType |
Selection method used for this UI element. | |
CzIRect | OriginalClippingMargin |
Original margin that is used to adjust the clipping rectangle. | |
CzIRect | ClippingMargin |
Margin that is used to adjust the clipping rectangle. | |
CzVec2 | PreviousScrollPos |
Previous scroll position. | |
CzVec2 | ScrollPos |
Current scroll position. | |
CzVec2 | ScrollVelocity |
Current scroll velocity. | |
CzIRect | ScrollRange |
X and Y ranges of scroll. | |
bool | EnableSpring |
Enables drag release spring. | |
eAxis | SizeToContentAxis |
Determines if and how an element should size to its content. | |
CzAnimTimeline * | ShowTimeline |
Timeline to play when this UI element is made visible. | |
CzAnimTimeline * | HideTimeline |
Timeline to play when this UI element is made invisible. | |
bool | NeedsResize |
Set to true when child actors sizes have changed. | |
CzIRect | ColourOffset |
Amount to offset the current colour of the actor. | |
bool | Tapped |
CzVec2 | InitialScrollPos |
Static Protected Attributes | |
static CzXomlClassDef * | UIBaseClassDef = NULL |
Base class of all UI components.
CzUIBase is the basic class that all UI actors are derived from. CzUIBase appends additional functionality to the normal image actor such as:
All new user interface actors should be derived from this class or a derivative of this class.
The following UI classes are derived from this base class:
enum CzUIBase::eAxis |
Values that represent different types of selection modes.
CzUIBase::~CzUIBase | ( | ) | [virtual] |
CzXomlProperty CzUIBase::_getBackground | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getBackgroundColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getClipMargin | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getColourOffset | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getDisabledBackground | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getDisabledColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getEnabled | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getHideTimeline | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getKeyFocus | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getScrollPos | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getScrollRange | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getSelected | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getSelectedBackground | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getSelectedColour | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getSelectType | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getShowTimeline | ( | IzXomlResource * | target | ) | [static] |
static CzXomlProperty CzUIBase::_getSize | ( | IzXomlResource * | target | ) | [static] |
Reimplemented from CzActorImage.
CzXomlProperty CzUIBase::_getSizeToContentAxis | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getSpring | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIBase::_getToggledOn | ( | IzXomlResource * | target | ) | [static] |
bool CzUIBase::_setBackground | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setBackgroundColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setClipMargin | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setColourOffset | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setDisabledBackground | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setDisabledColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setEnabled | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setHideTimeline | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setKeyFocus | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setOnBackKey | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setOnMenuKey | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setOnToggledOff | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setOnToggledOn | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setScrollPos | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setScrollRange | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setSelected | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setSelectedBackground | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setSelectedColour | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setSelectType | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setShowTimeline | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
static bool CzUIBase::_setSize | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
Reimplemented from CzActorImage.
bool CzUIBase::_setSizeToContentAxis | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setSpring | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIBase::_setToggledOn | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
CzAnim * CzUIBase::FindPresetAnimation | ( | unsigned int | name_hash | ) | [static] |
Searches for the first preset animation.
name_hash | The animation name as a string hash. |
IzBrush* CzUIBase::getBackgroundBrush | ( | ) | const [inline] |
CzColour CzUIBase::getBackgroundColour | ( | ) | const [inline] |
CzIRect CzUIBase::getClippingMargin | ( | ) | [inline] |
CzIRect CzUIBase::getColourOffset | ( | ) | const [inline] |
IzBrush* CzUIBase::getDisabledBackgroundBrush | ( | ) | const [inline] |
CzColour CzUIBase::getDisabledBackgroundColour | ( | ) | const [inline] |
bool CzUIBase::getEnableSpring | ( | ) | const [inline] |
CzAnimTimeline* CzUIBase::getHideTimeline | ( | ) | const [inline] |
bool CzUIBase::getNeedsResize | ( | ) | const [inline] |
CzVec2 CzUIBase::getPreviousScrollPos | ( | ) | const [inline] |
bool CzUIBase::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 CzUIBase is derived from CzActorImage, all CzActorImage properties will also be checked against.
property_name | Name of the property. | |
[out] | prop | The property data that. |
Reimplemented from CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIImageView, CzUISlider, CzUILabel, CzUITextView, CzUIWebView, CzUITab, CzUITextBox, CzUIVideoOverlay, CzUIStackPanel, and CzUIWrapPanel.
CzVec2 CzUIBase::getScrollPos | ( | ) | const [inline] |
CzIRect CzUIBase::getScrollRange | ( | ) | const [inline] |
CzVec2 CzUIBase::getScrollVelocity | ( | ) | const [inline] |
IzBrush* CzUIBase::getSelectedBackgroundBrush | ( | ) | const [inline] |
CzColour CzUIBase::getSelectedBackgroundColour | ( | ) | const [inline] |
eSelectType CzUIBase::getSelectType | ( | ) | const [inline] |
CzAnimTimeline* CzUIBase::getShowTimeline | ( | ) | const [inline] |
eAxis CzUIBase::getSizeToContentAxis | ( | ) | const [inline] |
bool CzUIBase::Init | ( | IzBrush * | brush, |
int | width, | ||
int | height | ||
) | [virtual] |
Initialises this UI actor.
Carries out some basic UI actor initialisation. Also assigns a brush and render size to the actor.
[in] | brush | If non-null, the brush. |
width | The width of the UI actor. | |
height | The height of the UI actor. |
Reimplemented from CzActorImage.
void CzUIBase::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 CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIWebView, CzUIImageView, CzUISlider, CzUITextView, CzUILabel, CzUITab, CzUIVideoOverlay, CzUITextBox, CzUIStackPanel, and CzUIWrapPanel.
void CzUIBase::InitPresetAnimations | ( | ) | [static] |
Initialises the preset animations.
Static method that creates a group of preset animations.
bool CzUIBase::isEnabled | ( | ) | const [inline] |
bool CzUIBase::isLayoutDirty | ( | ) | const [inline] |
bool CzUIBase::isSelected | ( | ) | const [inline] |
bool CzUIBase::isToggledOn | ( | ) | const [inline] |
int CzUIBase::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 CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUITabs, CzUIWebView, CzUIImageView, CzUISlider, CzUITextView, CzUILabel, CzUITab, CzUITextBox, CzUIVideoOverlay, CzUIStackPanel, CzUIWrapPanel, and CzUICanvas.
void CzUIBase::NotifyBackKey | ( | ) | [virtual] |
Handles the back key press evente.
void CzUIBase::NotifyBeginTouch | ( | int | index, |
int | x, | ||
int | y, | ||
bool | allow_bubble | ||
) | [virtual] |
OnBeginTouch event handler.
The OnBeginTouch event handler is called whenever the user begins to touch the actor. Actors can process up to 5 simultaneous touch events OnBeginTouch to OnBeginTouch5. if event bubbling is enabled then the event will also be passed up to the parent.
This version of this method enables actors to utilise a selected state
index | Index of the touch. |
x | The touched x coordinate. |
y | The touched y coordinate. |
allow_bubble | true to allow event bubbling, false to deny event bubbling. |
Reimplemented from CzActor.
Reimplemented in CzUIImageView, CzUITextView, and CzUISlider.
void CzUIBase::NotifyEndTouch | ( | int | index, |
int | x, | ||
int | y, | ||
bool | allow_bubble | ||
) | [virtual] |
OnEndTouch event handler.
The OnEndTouch event handler is called whenever the user stops touching the actor. This can occur for a number fo reasons including:
Actors can process up to 5 simultaneous touch events OnEndTouch to OnEndTouch5. if event bubbling is enabled then the event will also be passed up to the parent.
This version of this method enables actors to utilise a selected state
index | Index of the touch. |
x | The touched x coordinate. |
y | The touched y coordinate. |
allow_bubble | true to allow event bubbling, false to deny event bubbling. |
Reimplemented from CzActor.
Reimplemented in CzUIImageView, CzUITextView, and CzUISlider.
void CzUIBase::NotifyMenuKey | ( | ) | [virtual] |
Handles the menu key press evente.
void CzUIBase::NotifyOrientationChange | ( | CzScene::eOrientation | old_orientation, |
CzScene::eOrientation | new_orientation | ||
) | [virtual] |
Handles the orientation change event.
When a screen orientation or size change occurs all actors will receive this event emabling them to modify themselves to take advantage of the new screen orientation / size. the default implementation for CzActorImage updates margin and visual sizes if they are precentage based. It also calls CzActor::NotifyOrientationChange() to update the position.
old_orientation | The old orientation. |
new_orientation | The new orientation. |
Reimplemented from CzActorImage.
Reimplemented in CzUIGrid, CzUIWebView, CzUISlider, and CzUITab.
void CzUIBase::NotifyParentsResize | ( | ) |
Notifies the parent to resize its layout.
Used when this actor changes in a way that could potentially change the parents layout.
void CzUIBase::NotifyTapped | ( | int | index, |
int | x, | ||
int | y, | ||
bool | allow_bubble | ||
) | [virtual] |
OnTapped event handler.
The OnTapped event handler is called whenever the actor is tapped on by the user. Actors can process up to 5 simultaneous touch events OnTapped to OnTapped5. if event bubbling is enabled then the event will also be passed up to the parent.
This version of this method enables actors to utilise a selected and toggled state
index | Index of the touch. |
x | The touched x coordinate. |
y | The touched y coordinate. |
allow_bubble | true to allow event bubbling, false to deny event bubbling. |
Reimplemented from CzActor.
Reimplemented in CzUITextBox.
void CzUIBase::NotifyToggledOff | ( | ) | [virtual] |
Handles the toggled off event.
Reimplemented in CzUITab.
void CzUIBase::NotifyToggledOn | ( | ) | [virtual] |
Handles the toggled on event.
Reimplemented in CzUITab.
void CzUIBase::ReleaseClass | ( | ) | [static] |
Reimplemented from CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIWebView, CzUIImageView, CzUISlider, CzUITextView, CzUILabel, CzUITab, CzUIVideoOverlay, CzUITextBox, CzUIStackPanel, and CzUIWrapPanel.
void CzUIBase::ReleasePresetAnimations | ( | ) | [static] |
Initialises the preset animations.
Static method that detroys a group of preset animations.
void CzUIBase::resetColourOffset | ( | ) | [inline] |
void CzUIBase::ResizeToContent | ( | ) | [virtual] |
Resizes the actor to fit its content.
Recalculates docking and dirties the layout. Used mainly by layout actors to resize themselves to fit their new content. This method is usually overridden by a derived class in order to calculate the new size based on the containers children. See CzUIStackPanel::ResizeToContent() for a simple example.
Reimplemented in CzUIStackPanel.
bool CzUIBase::ScrollRangeCheck | ( | ) | [protected] |
Prevents scroll position from giong out of bounds.
Checks to see if scroll position has gone out of the scroll range. If so then it is snapped back into place. If spring is enabled then the scroller will spring back into place instead of snapping back into place.
void CzUIBase::setBackgroundBrush | ( | IzBrush * | brush | ) |
Sets background brush of the actor.
The background brush is the normal background that will be displayed when the actor is not selected or disabled.
[in] | brush | If non-null, the brush. |
void CzUIBase::setBackgroundColour | ( | const CzColour & | colour | ) |
Sets background colour of the actor.
The background colour is the normal background colour that will be displayed when the actor is not selected or disabled. Note that the background colour will be used to tint the background brush.
colour | The colour. |
void CzUIBase::setClippingMargin | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) | [inline] |
void CzUIBase::setColourOffset | ( | const CzIRect & | offset | ) | [inline] |
void CzUIBase::setDisabledBackgroundBrush | ( | IzBrush * | brush | ) |
Sets disabled background brush of the actor.
The disabled background brush is the background that will be displayed when the actor is disabled.
[in] | brush | If non-null, the brush. |
void CzUIBase::setDisabledBackgroundColour | ( | const CzColour & | colour | ) |
Sets disabled background colour of the actor.
The disabled background colour is the background colour that will be displayed when the actor is disabled. Note that the background colour will be used to tint the disabled background brush.
colour | The colour. |
void CzUIBase::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 in CzUILabel.
void CzUIBase::setEnableSpring | ( | bool | enable | ) | [inline] |
void CzUIBase::setHideTimeline | ( | CzAnimTimeline * | timeline | ) |
Sets hide timeline deleting any previously assigned none managed hide timeline.
[in] | timeline | If non-null, the timeline. |
void CzUIBase::setHideTimeline | ( | const char * | timeline_name | ) |
Sets hide timeline to the named timeline.
Note that the timeline name can also include one of the preset timelines that are defined by PresetAnimations
timeline_name | Name of the timeline. |
void CzUIBase::setLayoutDirty | ( | bool | dirty | ) |
Sets layout as dirty.
Settinge the layout dirty focres contained actors to recalculate their layouts
dirty | true to dirty. |
void CzUIBase::setNeedsResize | ( | bool | resize | ) |
bool CzUIBase::setProperty | ( | unsigned int | property_name, |
const CzXomlProperty & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the actor.
Sets the named property of this actor. 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 CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIImageView, CzUISlider, CzUILabel, CzUITextView, CzUIWebView, CzUITab, CzUITextBox, CzUIVideoOverlay, CzUIStackPanel, and CzUIWrapPanel.
bool CzUIBase::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 CzUIBase is derived from CzActorImage, all CzActorImage 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 CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIImageView, CzUISlider, CzUILabel, CzUITextView, CzUIWebView, CzUITab, CzUITextBox, CzUIVideoOverlay, CzUIStackPanel, and CzUIWrapPanel.
void CzUIBase::setScrollPos | ( | float | x, |
float | y | ||
) |
Sets scroll position.
Sets the scroll position of the content within the actor. UI actors can scroll their content around, for example, when a grids data is larger than the available space assigned to the grid then scrolling can be used to enable the user to pan / scroll around the content.
x | The x coordinate. |
y | The y coordinate. |
void CzUIBase::setScrollRange | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) | [inline] |
void CzUIBase::setScrollVelocity | ( | float | x, |
float | y | ||
) | [inline] |
void CzUIBase::setSelected | ( | bool | selected, |
bool | force_select = false |
||
) |
Sets actors selected state.
selected | true if selected. |
force_select | true to force select. |
void CzUIBase::setSelectedBackgroundBrush | ( | IzBrush * | brush | ) |
Sets selected background brush of the actor.
The selected background brush is the background that will be displayed when the actor is selected.
[in] | brush | If non-null, the brush. |
void CzUIBase::setSelectedBackgroundColour | ( | const CzColour & | colour | ) |
Sets selected background colour of the actor.
The selected background colour is the background colour that will be displayed when the actor is selected. Note that the background colour will be used to tint the selected background brush.
colour | The colour. |
void CzUIBase::setSelectType | ( | eSelectType | type | ) | [inline] |
void CzUIBase::setShowTimeline | ( | CzAnimTimeline * | timeline | ) |
Sets show timeline deleting any previously assigned none managed show timeline.
Sets show timeline to the named timeline.
[in] | timeline | If non-null, the timeline. |
Note that the timeline name can also include one of the preset timelines that are defined by PresetAnimations
[in] | timeline | If non-null, the timeline. |
void CzUIBase::setShowTimeline | ( | const char * | timeline_name | ) |
void CzUIBase::setSizeToContentAxis | ( | eAxis | axis | ) | [inline] |
void CzUIBase::setToggledOn | ( | bool | toggled_on | ) |
Sets actores toggled state.
If the toggle state changes then the OnToggledOn or OnToggledOff events will be raised
toggled_on | true to toggle on, false to toggle off |
void CzUIBase::setVisible | ( | bool | visible, |
bool | force_set = false |
||
) | [virtual] |
Makes an actor visible.
Actors can be made visible / invisible by setting their visibility. An invisible actor will not be displayed but will still be processed if it is active.
CzUIBase augments the original CzActor::setVisible() method by adding support for starting and stopping show and hide timelines. Show and hide timelines are timelines that can if assigned to an actor will automatically call those timelines each time the actor is made visible or hidden. Any UI actor can be assigned show and hide timelines, for example:
<Label Font="serif" Background="Button1Brush" Text="Im a label" ShowTimeline="show_timeline" HideTimeline="hide_timeline" />
visible | true to show, false to hide. |
force_set | unused at this time |
Reimplemented from CzActor.
bool CzUIBase::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 CzActor.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIImageView, CzUITextView, CzUILabel, CzUISlider, CzUIVideoOverlay, CzUIWrapPanel, and CzUICanvas.
bool CzUIBase::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 CzUIBase is derived from CzActorImage, all CzActorImage properties will also be checked against.
property_name | Name of the property. | |
[in,out] | var | If non-null, the variable. |
Reimplemented from CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIImageView, CzUITextView, CzUISlider, CzUILabel, CzUIWebView, CzUITab, CzUITextBox, CzUIVideoOverlay, CzUIStackPanel, and CzUIWrapPanel.
bool CzUIBase::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 CzUIBase is derived from CzActorImage, all CzActorImage properties will also be checked against.
[in] | animation | If non-null, the animation. |
Reimplemented from CzActorImage.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIWebView, CzUIImageView, CzUISlider, CzUITextView, CzUILabel, CzUITab, CzUITextBox, CzUIStackPanel, CzUIVideoOverlay, and CzUIWrapPanel.
bool CzUIBase::UpdateLayout | ( | ) | [protected, virtual] |
Updates the actors layout.
Recalculates the actors layout. Used mainly by container actors to modify the layout of their child content. This method is usually overridden by a derived class in order to update the layout of its children.. See CzUIStackPanel::UpdateLayout() for a simple example.
Reimplemented in CzUITabBar, CzUIGrid, CzUIListBox, CzUIStackPanel, CzUIWrapPanel, and CzUICanvas.
void CzUIBase::UpdatePresetAnimations | ( | ) | [static] |
Updates the preset animations.
Static method that updates a group of preset animations.
IzBrush* CzUIBase::BackgroundBrush [protected] |
Default none selected brush.
CzColour CzUIBase::BackgroundColour [protected] |
Default none selected colour.
CzIRect CzUIBase::ClippingMargin [protected] |
Margin that is used to adjust the clipping rectangle.
CzIRect CzUIBase::ColourOffset [protected] |
Amount to offset the current colour of the actor.
IzBrush* CzUIBase::DisabledBackgroundBrush [protected] |
Disabled brush.
CzColour CzUIBase::DisabledBackgroundColour [protected] |
Disabled colour.
bool CzUIBase::Enabled [protected] |
Enabled state.
bool CzUIBase::EnableSpring [protected] |
Enables drag release spring.
CzAnimTimeline* CzUIBase::HideTimeline [protected] |
Timeline to play when this UI element is made invisible.
CzVec2 CzUIBase::InitialScrollPos [protected] |
bool CzUIBase::LayoutDirty [protected] |
When true the layout of this element and any children is re-calculated.
bool CzUIBase::NeedsResize [protected] |
Set to true when child actors sizes have changed.
CzIRect CzUIBase::OriginalClippingMargin [protected] |
Original margin that is used to adjust the clipping rectangle.
CzList< CzAnim * > CzUIBase::PresetAnimations [static] |
CzVec2 CzUIBase::PreviousScrollPos [protected] |
Previous scroll position.
bool CzUIBase::PrevSelected [protected] |
Previous Selected status.
CzVec2 CzUIBase::ScrollPos [protected] |
Current scroll position.
CzIRect CzUIBase::ScrollRange [protected] |
X and Y ranges of scroll.
CzVec2 CzUIBase::ScrollVelocity [protected] |
Current scroll velocity.
bool CzUIBase::Selected [protected] |
Selected status.
IzBrush* CzUIBase::SelectedBackgroundBrush [protected] |
Selected brush.
CzColour CzUIBase::SelectedBackgroundColour [protected] |
Selected colour.
eSelectType CzUIBase::SelectType [protected] |
Selection method used for this UI element.
CzAnimTimeline* CzUIBase::ShowTimeline [protected] |
Timeline to play when this UI element is made visible.
eAxis CzUIBase::SizeToContentAxis [protected] |
Determines if and how an element should size to its content.
bool CzUIBase::Tapped [protected] |
bool CzUIBase::ToggledOn [protected] |
ToggledOn state.
CzXomlClassDef * CzUIBase::UIBaseClassDef = NULL [static, protected] |