AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
An image based actor that acts as a grid, allowing other actors to be arranged into a grid. More...
#include <CzUIGrid.h>
Public Member Functions | |
int | getRowCount () const |
int | getColumnCount () const |
CzUIGridColumn * | AddColumn (const char *name, int width, eCzAlignH align, bool visible) |
CzUIGridRow * | AddRow (const char *name, int height, eCzAlignV align, bool visible) |
CzUIGridRow * | getRow (int index) |
CzUIGridColumn * | getColumn (int index) |
void | setRowVisible (int index, bool visible) |
bool | isRowVisible (int index) const |
void | setColumnVisible (int index, bool visible) |
bool | isColumnVisible (int index) const |
void | setAllVisible (bool visible) |
CzTemplate * | getItemsTemplate () const |
bool | setItemsTemplate (const char *temp_name) |
bool | setItemsTemplate (CzTemplate *temp) |
bool | setItemsData (const char *variable_name, CzXmlNode *node=NULL) |
void | setItemsData (CzXomlVariableArray *data, unsigned int type_hash) |
bool | setItemsData (CzXomlVariable *data) |
CzXomlVariableArray * | getItemsData () |
void | setItemsTargetType (const char *type) |
unsigned int | setItemsTargetType () const |
void | setMultiSelect (bool enable) |
bool | isMultiSelect () const |
void | setSelectionIndex (int index) |
int | getSelectionIndex () const |
CzUIBase * | getSelection () |
void | setSelectionVar (CzXomlVariable *var) |
bool | setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta) |
Sets the named property of the UIGrid. | |
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. | |
CzUIGrid () | |
virtual | ~CzUIGrid () |
virtual void | InitGrid (int row_count, int column_count) |
bool | Update (float dt) |
Updates this actors logic. | |
void | NotifyOrientationChange (CzScene::eOrientation old_orientation, CzScene::eOrientation new_orientation) |
Handles the orientation change event. | |
virtual void | NotifySelectionChanged (int old_index, int new_index) |
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. | |
void | ClearAllSelections (CzUIBase *ignore) |
Static Public Member Functions | |
static void | InitClass () |
Initialises the class. | |
static void | ReleaseClass () |
static CzXomlProperty | _getColumnCount (IzXomlResource *target) |
static CzXomlProperty | _getRowCount (IzXomlResource *target) |
static bool | _setItemsTemplate (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getItemsTemplate (IzXomlResource *target) |
static bool | _setItemsData (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getItemsData (IzXomlResource *target) |
static bool | _setItemsTargetType (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setOnSelectionChanged (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setMultiSelect (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getMultiSelect (IzXomlResource *target) |
static CzXomlProperty | _getSelection (IzXomlResource *target) |
static bool | _setSelectionIndex (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getSelectionIndex (IzXomlResource *target) |
static bool | _setShowRow (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setShowColumn (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
Protected Member Functions | |
void | LinkChanged (CzActor *child, bool remove) |
Called from an actor when an actor that links to this actor unlinks itself. | |
void | RemoveActor (CzActor *actor) |
void | RemoveAllActors () |
void | CreateAllActors () |
void | UpdateAllActors (bool force_update) |
void | RemoveColumnActors (int column) |
void | CreateColumnActors (int column) |
void | CreateAllColumnActors () |
void | UpdateColumnActors (int column, bool force_update) |
void | UpdateAllColumnActors (bool force_update) |
bool | UpdateLayout () |
Updates the actors layout. | |
void | CheckForColumnChanges () |
bool | UpdateBinding (unsigned int property_name, CzXomlVariable *var) |
Updates an actor property from the supplied XOML variable. | |
Protected Attributes | |
int | RowCount |
int | ColumnCount |
CzVector< CzUIGridColumn * > | ColumnDefinitions |
CzVector< CzUIGridRow * > | RowDefinitions |
CzTemplate * | ItemsTemplate |
CzXomlVariableArray * | ItemsData |
unsigned int | ItemsTargetTypeHash |
bool | MultiSelect |
CzUIBase * | Selection |
int | SelectionIndex |
CzXomlVariable * | SelectionVar |
CzSlotArray< CzUIBase * > | Children |
Static Protected Attributes | |
static CzXomlClassDef * | UIGridClassDef = NULL |
An image based actor that acts as a grid, allowing other actors to be arranged into a grid.
CzUIGrid::CzUIGrid | ( | ) | [inline] |
CzUIGrid::~CzUIGrid | ( | ) | [virtual] |
CzXomlProperty CzUIGrid::_getColumnCount | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getItemsData | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getItemsTemplate | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getMultiSelect | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getRowCount | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getSelection | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIGrid::_getSelectionIndex | ( | IzXomlResource * | target | ) | [static] |
bool CzUIGrid::_setItemsData | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setItemsTargetType | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setItemsTemplate | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setMultiSelect | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setOnSelectionChanged | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setSelectionIndex | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setShowColumn | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIGrid::_setShowRow | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
CzUIGridColumn * CzUIGrid::AddColumn | ( | const char * | name, |
int | width, | ||
eCzAlignH | align, | ||
bool | visible | ||
) |
CzUIGridRow * CzUIGrid::AddRow | ( | const char * | name, |
int | height, | ||
eCzAlignV | align, | ||
bool | visible | ||
) |
void CzUIGrid::CheckForColumnChanges | ( | ) | [protected] |
void CzUIGrid::ClearAllSelections | ( | CzUIBase * | ignore | ) |
void CzUIGrid::CreateAllActors | ( | ) | [protected] |
void CzUIGrid::CreateAllColumnActors | ( | ) | [protected] |
void CzUIGrid::CreateColumnActors | ( | int | column | ) | [protected] |
CzUIGridColumn* CzUIGrid::getColumn | ( | int | index | ) | [inline] |
int CzUIGrid::getColumnCount | ( | ) | const [inline] |
CzXomlVariableArray* CzUIGrid::getItemsData | ( | ) | [inline] |
CzTemplate* CzUIGrid::getItemsTemplate | ( | ) | const [inline] |
bool CzUIGrid::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 CzUIGrid 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.
CzUIGridRow* CzUIGrid::getRow | ( | int | index | ) | [inline] |
int CzUIGrid::getRowCount | ( | ) | const [inline] |
CzUIBase* CzUIGrid::getSelection | ( | ) | [inline] |
int CzUIGrid::getSelectionIndex | ( | ) | const [inline] |
void CzUIGrid::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.
void CzUIGrid::InitGrid | ( | int | row_count, |
int | column_count | ||
) | [virtual] |
bool CzUIGrid::isColumnVisible | ( | int | index | ) | const |
bool CzUIGrid::isMultiSelect | ( | ) | const [inline] |
bool CzUIGrid::isRowVisible | ( | int | index | ) | const |
void CzUIGrid::LinkChanged | ( | CzActor * | child, |
bool | remove | ||
) | [protected, virtual] |
Called from an actor when an actor that links to this actor unlinks itself.
Reimplemented from CzActor.
int CzUIGrid::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 CzUIGrid is derived from CzUIBase, CzUIBase::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.
void CzUIGrid::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 CzUIBase.
void CzUIGrid::NotifySelectionChanged | ( | int | old_index, |
int | new_index | ||
) | [virtual] |
void CzUIGrid::ReleaseClass | ( | ) | [static] |
Reimplemented from CzUIBase.
void CzUIGrid::RemoveActor | ( | CzActor * | actor | ) | [protected] |
void CzUIGrid::RemoveAllActors | ( | ) | [protected] |
void CzUIGrid::RemoveColumnActors | ( | int | column | ) | [protected] |
void CzUIGrid::setAllVisible | ( | bool | visible | ) |
void CzUIGrid::setColumnVisible | ( | int | index, |
bool | visible | ||
) |
bool CzUIGrid::setItemsData | ( | const char * | variable_name, |
CzXmlNode * | node = NULL |
||
) |
void CzUIGrid::setItemsData | ( | CzXomlVariableArray * | data, |
unsigned int | type_hash | ||
) |
bool CzUIGrid::setItemsData | ( | CzXomlVariable * | data | ) |
void CzUIGrid::setItemsTargetType | ( | const char * | type | ) |
unsigned int CzUIGrid::setItemsTargetType | ( | ) | const [inline] |
bool CzUIGrid::setItemsTemplate | ( | const char * | temp_name | ) |
bool CzUIGrid::setItemsTemplate | ( | CzTemplate * | temp | ) |
void CzUIGrid::setMultiSelect | ( | bool | enable | ) | [inline] |
bool CzUIGrid::setProperty | ( | unsigned int | property_name, |
const CzXomlProperty & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the UIGrid.
Sets the named property of this UIGrid. 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.
bool CzUIGrid::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 CzUIGrid 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.
void CzUIGrid::setRowVisible | ( | int | index, |
bool | visible | ||
) |
void CzUIGrid::setSelectionIndex | ( | int | index | ) |
void CzUIGrid::setSelectionVar | ( | CzXomlVariable * | var | ) | [inline] |
bool CzUIGrid::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.
void CzUIGrid::UpdateAllActors | ( | bool | force_update | ) | [protected] |
void CzUIGrid::UpdateAllColumnActors | ( | bool | force_update | ) | [protected] |
bool CzUIGrid::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 CzUIGrid 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.
void CzUIGrid::UpdateColumnActors | ( | int | column, |
bool | force_update | ||
) | [protected] |
bool CzUIGrid::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 CzUIGrid is derived from CzUIBase, all CzUIBase properties will also be checked against.
[in] | animation | If non-null, the animation. |
Reimplemented from CzUIBase.
bool CzUIGrid::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 from CzUIBase.
CzSlotArray<CzUIBase*> CzUIGrid::Children [protected] |
int CzUIGrid::ColumnCount [protected] |
CzVector<CzUIGridColumn*> CzUIGrid::ColumnDefinitions [protected] |
CzXomlVariableArray* CzUIGrid::ItemsData [protected] |
unsigned int CzUIGrid::ItemsTargetTypeHash [protected] |
CzTemplate* CzUIGrid::ItemsTemplate [protected] |
bool CzUIGrid::MultiSelect [protected] |
int CzUIGrid::RowCount [protected] |
CzVector<CzUIGridRow*> CzUIGrid::RowDefinitions [protected] |
CzUIBase* CzUIGrid::Selection [protected] |
int CzUIGrid::SelectionIndex [protected] |
CzXomlVariable* CzUIGrid::SelectionVar [protected] |
CzXomlClassDef * CzUIGrid::UIGridClassDef = NULL [static, protected] |