AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzUIListBox Class Reference

#include <CzUIListBox.h>

Inheritance diagram for CzUIListBox:
CzUIBase CzActorImage CzActor IzXomlResource IzAnimTarget CzUITabs

List of all members.

Public Types

typedef CzVector
< CzUIListBoxItem * >
::iterator 
_Iterator

Public Member Functions

_Iterator begin ()
_Iterator end ()
void setOrientation (eCzOrientation o)
eCzOrientation getOrientation () const
void setAlignH (eCzAlignH align)
eCzAlignH getAlignH () const
void setAlignV (eCzAlignV align)
eCzAlignV getAlignV () const
int getItemCount () const
void addItem (CzUIListBoxItem *item)
void removeItem (CzUIListBoxItem *item)
CzUIListBoxItemgetItem (int index)
CzUIListBoxItemfindItem (CzUIBase *actor)
void setAllVisible (bool visible)
bool setItemsTemplate (const char *temp_name)
bool setItemsTemplate (CzTemplate *temp)
CzTemplategetItemsTemplate ()
bool setItemsData (const char *variable_name, CzXmlNode *node)
void setItemsData (CzXomlVariableArray *data, unsigned int type_hash)
bool setItemsData (CzXomlVariable *data)
CzXomlVariableArraygetItemsData ()
void setItemsTargetType (const char *type)
unsigned int getItemsTargetType () const
void setMultiSelect (bool enable)
bool isMultiSelect () const
void setSelectionIndex (int index, bool call_events=false)
int getSelectionIndex () const
CzUIBasegetSelection ()
void setSelectionVar (CzXomlVariable *var)
void setCaretIndex (int index)
int getCaretIndex () const
CzIRect getCaretColourOffset () const
void setCaretColourOffset (const CzIRect &offset)
bool setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta)
 Sets the named property of the UIListBox.
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.
 CzUIListBox ()
virtual ~CzUIListBox ()
virtual void InitListBox ()
bool Update (float dt)
 Updates this actors logic.
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)
void ClearAllToggles (CzUIBase *ignore)
void ScrollToIndex (int index)

Static Public Member Functions

static void InitClass ()
 Initialises the class.
static void ReleaseClass ()
static CzXomlProperty _getItemCount (IzXomlResource *target)
static bool _setOrientation (IzXomlResource *target, const CzXomlProperty &prop, bool add)
static CzXomlProperty _getOrientation (IzXomlResource *target)
static bool _setAlignH (IzXomlResource *target, const CzXomlProperty &prop, bool add)
static bool _setAlignV (IzXomlResource *target, const CzXomlProperty &prop, bool add)
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 _setCaretColourOffset (IzXomlResource *target, const CzXomlProperty &prop, bool add)
static CzXomlProperty _getCaretColourOffset (IzXomlResource *target)
static bool _setCaretIndex (IzXomlResource *target, const CzXomlProperty &prop, bool add)
static CzXomlProperty _getCaretIndex (IzXomlResource *target)

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)
bool UpdateLayout ()
 Updates the actors layout.
CzVec2 CalculateItemPosition (int item_index)
bool UpdateBinding (unsigned int property_name, CzXomlVariable *var)
 Updates an actor property from the supplied XOML variable.

Protected Attributes

eCzOrientation Orientation
eCzAlignH AlignH
eCzAlignV AlignV
CzTemplateItemsTemplate
CzXomlVariableArrayItemsData
unsigned int ItemsTargetTypeHash
bool MultiSelect
CzUIBaseSelection
int SelectionIndex
CzXomlVariableSelectionVar
int CaretIndex
CzIRect CaretColourOffset
int ItemsCount
 Total items.
CzVector< CzUIListBoxItem * > Children

Static Protected Attributes

static CzXomlClassDefUIListBoxClassDef = NULL

Member Typedef Documentation


Constructor & Destructor Documentation


Member Function Documentation

bool CzUIListBox::_setAlignH ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setAlignV ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setCaretColourOffset ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setCaretIndex ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setItemsData ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setItemsTargetType ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setItemsTemplate ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setMultiSelect ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setOnSelectionChanged ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setOrientation ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
bool CzUIListBox::_setSelectionIndex ( IzXomlResource target,
const CzXomlProperty prop,
bool  add 
) [static]
CzVec2 CzUIListBox::CalculateItemPosition ( int  item_index) [protected]
void CzUIListBox::CreateAllActors ( ) [protected]
eCzAlignH CzUIListBox::getAlignH ( ) const [inline]
eCzAlignV CzUIListBox::getAlignV ( ) const [inline]
int CzUIListBox::getCaretIndex ( ) const [inline]
CzUIListBoxItem* CzUIListBox::getItem ( int  index) [inline]
int CzUIListBox::getItemCount ( ) const [inline]
unsigned int CzUIListBox::getItemsTargetType ( ) const [inline]
bool CzUIListBox::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 CzUIListBox is derived from CzUIBase, all CzUIBase properties will also be checked against. UIListBox

Parameters:
property_nameName of the property.
[out]propThe property data that.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzUIBase.

int CzUIListBox::getSelectionIndex ( ) const [inline]
void CzUIListBox::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 CzUIListBox::InitListBox ( ) [virtual]
bool CzUIListBox::isMultiSelect ( ) const [inline]
void CzUIListBox::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 CzUIListBox::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 CzUIListBox is derived from CzUIBase, CzUIBase::LoadFromXoml() will also be called to load CzActor specific properties.

Parameters:
[in]parentIf non-null, the parent.
load_childrentrue to load child nodes.
[in]nodeIf non-null, the XOML markup node that defines this object
Returns:
negative value for error. if 0 then processing of further XOML will stop.

Reimplemented from CzUIBase.

Reimplemented in CzUITabs.

void CzUIListBox::NotifySelectionChanged ( int  old_index,
int  new_index 
) [virtual]
void CzUIListBox::ReleaseClass ( ) [static]

Reimplemented from CzUIBase.

void CzUIListBox::RemoveActor ( CzActor actor) [protected]
void CzUIListBox::RemoveAllActors ( ) [protected]
void CzUIListBox::ScrollToIndex ( int  index)
void CzUIListBox::setAlignH ( eCzAlignH  align) [inline]
void CzUIListBox::setAlignV ( eCzAlignV  align) [inline]
void CzUIListBox::setAllVisible ( bool  visible)
void CzUIListBox::setCaretColourOffset ( const CzIRect offset) [inline]
void CzUIListBox::setCaretIndex ( int  index)
bool CzUIListBox::setItemsData ( const char *  variable_name,
CzXmlNode node 
)
void CzUIListBox::setItemsData ( CzXomlVariableArray data,
unsigned int  type_hash 
)
void CzUIListBox::setItemsTargetType ( const char *  type)
bool CzUIListBox::setItemsTemplate ( const char *  temp_name)
void CzUIListBox::setMultiSelect ( bool  enable) [inline]
bool CzUIListBox::setProperty ( unsigned int  property_name,
const CzXomlProperty data,
bool  delta 
) [virtual]

Sets the named property of the UIListBox.

Sets the named property of this UIListBox. 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.

Parameters:
property_nameName of the property as a string hash (faster searching).
[in]dataThe property data.
deltatrue if property should be added to instead of replaced.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzUIBase.

bool CzUIListBox::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 CzUIListBox is derived from CzUIBase, all CzUIBase properties will also be checked against.

Parameters:
property_nameName of the property as a string hash (faster searching).
[in]dataThe property data.
deltatrue to property should be added to instead of replaced.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzUIBase.

void CzUIListBox::setSelectionIndex ( int  index,
bool  call_events = false 
)
void CzUIListBox::setSelectionVar ( CzXomlVariable var) [inline]
bool CzUIListBox::Update ( float  dt) [virtual]

Updates this actors logic.

Updates the UI actors logic, including:

  • Processing event actions
  • Processing any attached modifiers
  • Updating dragging state
  • Updating physics
  • Updating the attached timeline
  • Updating any show / hide timelines
  • Updating the scroller
  • Checking for an updating layout if dirty

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.

Parameters:
dtThe number of seconds since the app was last updated
Returns:
true if it succeeds, false if it fails.

Reimplemented from CzUIBase.

void CzUIListBox::UpdateAllActors ( bool  force_update) [protected]
bool CzUIListBox::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 CzUIListBox is derived from CzUIBase, all CzUIBase properties will also be checked against.

Parameters:
property_nameName of the property.
[in,out]varIf non-null, the variable.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzUIBase.

bool CzUIListBox::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 CzUIListBox is derived from CzUIBase, all CzUIBase properties will also be checked against.

Parameters:
[in]animationIf non-null, the animation.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzUIBase.

bool CzUIListBox::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.

Returns:
true if it succeeds, false if it fails.

Reimplemented from CzUIBase.


Member Data Documentation

int CzUIListBox::CaretIndex [protected]
int CzUIListBox::ItemsCount [protected]

Total items.

unsigned int CzUIListBox::ItemsTargetTypeHash [protected]
bool CzUIListBox::MultiSelect [protected]
int CzUIListBox::SelectionIndex [protected]

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