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
CzUIWrapPanel.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CCZ_UI_WRAPPANEL_H_)
00015 #define _CCZ_UI_WRAPPANEL_H_
00016 
00017 #include "CzUIPanel.h"
00018 
00019 //
00020 //
00021 //
00022 //
00023 // CzUIWrapPanel - A panel that stacks content horizontally until no space left then moves down to the next line
00024 //
00025 //
00026 //
00027 //
00028 class CzUIWrapPanel : public CzUIPanel
00029 {
00030     // Properties
00031 protected:
00032     eCzOrientation          Orientation;            ///< Stacking orientation
00033 public:
00034     void                    setOrientation(eCzOrientation o)        { Orientation = o; setLayoutDirty(true); }
00035     eCzOrientation          getOrientation() const                  { return Orientation; }
00036     bool                    setProperty(unsigned int property_name, const CzXomlProperty& data, bool delta);
00037     bool                    setProperty(unsigned int property_name, const CzString& data, bool delta);
00038     bool                    getProperty(unsigned int property_name, CzXomlProperty& prop);
00039     // Properties end
00040 protected:
00041     bool                    UpdateLayout();         // Updates the layout of the child items
00042     bool                    UpdateBinding(unsigned int property_name, CzXomlVariable* var);
00043 public:
00044     CzUIWrapPanel() : CzUIPanel(), Orientation(Orientation_Horizontal)  { setActualClassType("wrappanel"); }
00045     virtual ~CzUIWrapPanel();
00046 
00047     bool                    Update(float dt);
00048 
00049     // Implementation of IzXomlClass interface
00050     int                     LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node);
00051 
00052     // Implementation of IzAnimTarget interface
00053     bool                    UpdateFromAnimation(CzAnimInstance *animation);
00054 
00055     // Internal (used by XOML system to setup and cleanup the XOML class properties system
00056 protected:
00057     static CzXomlClassDef*  UIWrapPanelClassDef;                                // XOML class definition
00058 public:
00059     static void             InitClass();
00060     static void             ReleaseClass();
00061 
00062     static bool             _setOrientation(IzXomlResource* target, const CzXomlProperty& prop, bool add);
00063     static CzXomlProperty   _getOrientation(IzXomlResource* target);
00064 };
00065 
00066 //
00067 //  CzUIWrapPanelCreator - Creates an instance of a wrap panel actor object
00068 //
00069 class CzUIWrapPanelCreator : public IzXomlClassCreator
00070 {
00071 public:
00072     CzUIWrapPanelCreator()
00073     {
00074         setClassName("wrappanel");
00075     }
00076     IzXomlResource* CreateInstance(IzXomlResource* parent)  { return new CzUIWrapPanel(); }
00077 };
00078 
00079 
00080 
00081 #endif  // _CCZ_UI_WRAPPANEL_H_