cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RelativeLayoutParameter Class Reference

Relative layout parameter. More...

#include <UILayoutParameter.h>

Inheritance diagram for RelativeLayoutParameter:
LayoutParameter Ref

Public Types

enum  RelativeAlign {
  NONE, PARENT_TOP_LEFT, PARENT_TOP_CENTER_HORIZONTAL, PARENT_TOP_RIGHT,
  PARENT_LEFT_CENTER_VERTICAL, CENTER_IN_PARENT, PARENT_RIGHT_CENTER_VERTICAL, PARENT_LEFT_BOTTOM,
  PARENT_BOTTOM_CENTER_HORIZONTAL, PARENT_RIGHT_BOTTOM, LOCATION_ABOVE_LEFTALIGN, LOCATION_ABOVE_CENTER,
  LOCATION_ABOVE_RIGHTALIGN, LOCATION_LEFT_OF_TOPALIGN, LOCATION_LEFT_OF_CENTER, LOCATION_LEFT_OF_BOTTOMALIGN,
  LOCATION_RIGHT_OF_TOPALIGN, LOCATION_RIGHT_OF_CENTER, LOCATION_RIGHT_OF_BOTTOMALIGN, LOCATION_BELOW_LEFTALIGN,
  LOCATION_BELOW_CENTER, LOCATION_BELOW_RIGHTALIGN
}
 Relative Alignment type. More...
 
- Public Types inherited from LayoutParameter
enum  Type { NONE = 0, LINEAR, RELATIVE }
 Layout parameter type. More...
 

Public Member Functions

 RelativeLayoutParameter ()
 Default constructor. More...
 
virtual ~RelativeLayoutParameter ()
 Default destructor. More...
 
void setAlign (RelativeAlign align)
 Sets RelativeAlign parameter for LayoutParameter. More...
 
RelativeAlign getAlign () const
 Get RelativeAlign parameter for LayoutParameter. More...
 
void setRelativeToWidgetName (const std::string &name)
 Set widget name your widget want to relative to. More...
 
const std::string & getRelativeToWidgetName () const
 Get the relative widget name. More...
 
void setRelativeName (const std::string &name)
 Set a name for LayoutParameter in Relative Layout. More...
 
const std::string & getRelativeName () const
 Get a name of LayoutParameter in Relative Layout. More...
 
virtual LayoutParametercreateCloneInstance () override
 Create a cloned instance of LayoutParameter. More...
 
virtual void copyProperties (LayoutParameter *model) override
 Copy all the member field from argument LayoutParameter to self. More...
 
- Public Member Functions inherited from LayoutParameter
 LayoutParameter ()
 Default constructor. More...
 
virtual ~LayoutParameter ()
 Default destructor. More...
 
void setMargin (const Margin &margin)
 Set margin parameter for LayoutParameter. More...
 
const MargingetMargin () const
 Gets margin parameter of LayoutParameter. More...
 
Type getLayoutType () const
 Gets LayoutParameterType of LayoutParameter. More...
 
LayoutParameterclone ()
 Create a copy of original LayoutParameter. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static RelativeLayoutParametercreate ()
 Create a RelativeLayoutParameter instance. More...
 
- Static Public Member Functions inherited from LayoutParameter
static LayoutParametercreate ()
 Create a empty LayoutParameter. More...
 

Protected Attributes

RelativeAlign _relativeAlign
std::string _relativeWidgetName
std::string _relativeLayoutName
bool _put
- Protected Attributes inherited from LayoutParameter
Margin _margin
Type _layoutParameterType
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Friends

class RelativeLayoutManager

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Detailed Description

Relative layout parameter.

It is mainly used by RelativeLayoutManager.

Constructor & Destructor Documentation

Default constructor.

virtual ~RelativeLayoutParameter ( )
inlinevirtual

Default destructor.

Member Function Documentation

virtual void copyProperties ( LayoutParameter model)
overridevirtual

Copy all the member field from argument LayoutParameter to self.

Parameters
modelA LayoutParameter instance.

Reimplemented from LayoutParameter.

static RelativeLayoutParameter*
create
( )
static

Create a RelativeLayoutParameter instance.

Returns
A initialized LayoutParameter which is marked as "autorelease".
virtual LayoutParameter*
createCloneInstance
( )
overridevirtual

Create a cloned instance of LayoutParameter.

Returns
A LayoutParameter pointer.

Reimplemented from LayoutParameter.

RelativeAlign getAlign ( ) const

Get RelativeAlign parameter for LayoutParameter.

See also
RelativeAlign
Returns
A RelativeAlign variable.
const std::string& getRelativeName ( ) const

Get a name of LayoutParameter in Relative Layout.

Returns
name Relative name in string.
const std::string&
getRelativeToWidgetName
( ) const

Get the relative widget name.

Returns
name A relative widget name in string.
void setAlign ( RelativeAlign  align)

Sets RelativeAlign parameter for LayoutParameter.

See also
RelativeAlign
Parameters
alignRelative align in RelativeAlign.
void setRelativeName ( const std::string &  name)

Set a name for LayoutParameter in Relative Layout.

Parameters
nameA string name.
void setRelativeToWidgetName ( const std::string &  name)

Set widget name your widget want to relative to.

Parameters
nameRelative widget name.

Friends And Related Function Documentation

friend class RelativeLayoutManager
friend

Member Data Documentation

bool _put
protected
RelativeAlign _relativeAlign
protected
std::string _relativeLayoutName
protected
std::string _relativeWidgetName
protected

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