ZFFramework
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | List of all members
ZFUIButton Class Reference

abstract button More...

#include <ZFUIButton.h>

Inheritance diagram for ZFUIButton:
ZFUIView ZFStyleableObject ZFObject ZFStyleable ZFSerializable ZFCopyable ZFInterface ZFInterface ZFInterface ZFUIButtonBasic ZFUIButtonCheckBox ZFUIButtonRatio ZFUIHintContentBasic

Public Types

enum  
 
- Public Types inherited from ZFUIView
enum  
 
- Public Types inherited from ZFStyleableObject
enum  
 
- Public Types inherited from ZFObject
enum  
 

Public Member Functions

virtual const ZFClassclassData (void)
 get instance's class info
 
virtual zfbool const & enable ()
 true if the button is enabled, true by default
 
virtual void enable (zfbool const &propertyValue)
 see enable

 
virtual zfbool const & checkable ()
 true if the button is checkable button, false by default
 
virtual void checkable (zfbool const &propertyValue)
 see checkable

 
virtual zfbool const & checked ()
 true if the button is checked, valid only if checkable, false by default
 
virtual void checked (zfbool const &propertyValue)
 see checked

 
virtual ZFUIMargin const & buttonClickTolerance ()
 mouse up tolerance to detect as click, (0 - ZFUIGlobalStyle::itemMargin) by default
 
virtual void buttonClickTolerance (ZFUIMargin const &propertyValue)
 see buttonClickTolerance

 
virtual zftimet const & buttonClickInterval ()
 if two click event's interval smaller than this value, the second one would be ignored, 100 by default
 
virtual void buttonClickInterval (zftimet const &propertyValue)
 see buttonClickInterval

 
virtual void buttonClickIntervalReset ()
 reset buttonClickInterval so that next click event would be ensured to be fired
 
virtual void simulateClick (ZFUIEvent *event=(0))
 util method to simulate click button
 
virtual void onClick (const ZFListener &observer, ZFLevel observerLevel=(ZFLevelAppNormal))
 util to observe EventButtonOnClick
 
virtual void onClickForOnce (const ZFListener &observer, ZFLevel observerLevel=(ZFLevelAppNormal))
 util to observe EventButtonOnClick
 
virtual ZFUIButtonStateEnum buttonState ()
 current button state
 
- Public Member Functions inherited from ZFUIView
virtual void serializableRefLayoutParam (ZFUILayoutParam *serializableRefLayoutParam)
 store ref layout param for this view for reducing serialization output size
 
virtual ZFUILayoutParamserializableRefLayoutParam (void)
 see serializableRefLayoutParam
 
virtual zfstring const & viewId ()
 used to identify a view, empty by default
 
virtual void viewId (zfstring const &propertyValue)
 see viewId

 
virtual zfbool const & viewVisible ()
 visible or not, zftrue by default
 
virtual void viewVisible (zfbool const &propertyValue)
 see viewVisible

 
virtual zffloat const & viewAlpha ()
 view's alpha, 1 by default
 
virtual void viewAlpha (zffloat const &propertyValue)
 see viewAlpha

 
virtual zfbool const & viewUIEnable ()
 whether the view should receive user interaction (doesn't affect children, see viewUIEnableTree)
 
virtual void viewUIEnable (zfbool const &propertyValue)
 see viewUIEnable

 
virtual zfbool const & viewUIEnableTree ()
 whether the view as well as all its children should receive user interaction, see viewUIEnable
 
virtual void viewUIEnableTree (zfbool const &propertyValue)
 see viewUIEnableTree

 
virtual zfbool const & viewMouseHoverEventEnable ()
 whether enable mouse hover event, see ZFUIView::viewEventOnMouseEvent, false by default
 
virtual void viewMouseHoverEventEnable (zfbool const &propertyValue)
 see viewMouseHoverEventEnable

 
virtual zfbool const & viewFocusable ()
 whether the view can be focused, false by default
 
virtual void viewFocusable (zfbool const &propertyValue)
 see viewFocusable

 
virtual zfbool const & viewFocusObtainWhenClick ()
 whether try to obtain focus when clicked down, true by default
 
virtual void viewFocusObtainWhenClick (zfbool const &propertyValue)
 see viewFocusObtainWhenClick

 
virtual ZFUIRect const & viewFrame ()
 the view's frame
 
virtual void viewFrame (ZFUIRect const &viewFrame)
 see viewFrame
 
virtual const ZFUIRectviewFramePrev ()
 previous viewFrame
 
virtual void viewFrameReset ()
 see viewFrame
 
virtual zffloat const & viewX ()
 see viewFrame
 
virtual void viewX (zffloat const &propertyValue)
 see viewFrame
 
virtual zffloat const & viewY ()
 see viewFrame
 
virtual void viewY (zffloat const &propertyValue)
 see viewFrame
 
virtual zffloat const & viewWidth ()
 see viewFrame
 
virtual void viewWidth (zffloat const &propertyValue)
 see viewFrame
 
virtual zffloat const & viewHeight ()
 see viewFrame
 
virtual void viewHeight (zffloat const &propertyValue)
 see viewFrame
 
virtual zffloat const & viewCenterX ()
 see viewFrame
 
virtual void viewCenterX (zffloat const &propertyValue)
 see viewFrame
 
virtual zffloat const & viewCenterY ()
 see viewFrame
 
virtual void viewCenterY (zffloat const &propertyValue)
 see viewFrame
 
virtual ZFUISize const & viewSizePrefer ()
 prefered size, ZFUISizeInvalid by default
 
virtual void viewSizePrefer (ZFUISize const &propertyValue)
 see viewSizePrefer

 
virtual ZFUISize const & viewSizeMin ()
 min size, ZFUISizeZero by default
 
virtual void viewSizeMin (ZFUISize const &propertyValue)
 see viewSizeMin

 
virtual ZFUISize const & viewSizeMax ()
 max size, negative value means not set, ZFUISizeInvalid by default
 
virtual void viewSizeMax (ZFUISize const &propertyValue)
 see viewSizeMax

 
virtual ZFUIColor const & viewBackgroundColor ()
 background color, ZFUIColorZero by default
 
virtual void viewBackgroundColor (ZFUIColor const &propertyValue)
 see viewBackgroundColor

 
virtual zffloat const & viewTranslateX ()
 see viewTransformAvailable
 
virtual void viewTranslateX (zffloat const &propertyValue)
 see viewTranslateX

 
virtual zffloat const & viewTranslateY ()
 see viewTransformAvailable
 
virtual void viewTranslateY (zffloat const &propertyValue)
 see viewTranslateY

 
virtual zffloat const & viewTranslateZ ()
 see viewTransformAvailable
 
virtual void viewTranslateZ (zffloat const &propertyValue)
 see viewTranslateZ

 
virtual zffloat const & viewScaleX ()
 see viewTransformAvailable
 
virtual void viewScaleX (zffloat const &propertyValue)
 see viewScaleX

 
virtual zffloat const & viewScaleY ()
 see viewTransformAvailable
 
virtual void viewScaleY (zffloat const &propertyValue)
 see viewScaleY

 
virtual zffloat const & viewScaleZ ()
 see viewTransformAvailable
 
virtual void viewScaleZ (zffloat const &propertyValue)
 see viewScaleZ

 
virtual zffloat const & viewRotateX ()
 see viewTransformAvailable
 
virtual void viewRotateX (zffloat const &propertyValue)
 see viewRotateX

 
virtual zffloat const & viewRotateY ()
 see viewTransformAvailable
 
virtual void viewRotateY (zffloat const &propertyValue)
 see viewRotateY

 
virtual zffloat const & viewRotateZ ()
 see viewTransformAvailable
 
virtual void viewRotateZ (zffloat const &propertyValue)
 see viewRotateZ

 
virtual zfidentity objectHash (void)
 get hash of this object
 
virtual ZFCompareResult objectCompare (ZFObject *anotherObj)
 compare with anotherObj
 
virtual void * nativeImplView ()
 native implementation view
 
virtual zfbool nativeImplViewRequireVirtualIndex ()
 whether the nativeImplView cost one virtualIndex
 
virtual const ZFUIMarginnativeImplViewMargin ()
 inner margin between ZFUIView and the internal nativeImplView
 
virtual void nativeImplViewMarginUpdate ()
 see nativeImplViewMargin, layoutRequest if the final value actually changed
 
virtual const ZFUIRectnativeImplViewFrame ()
 frame of nativeImplView
 
virtual ZFUIMargin const & nativeImplViewMarginCustom ()
 see nativeImplViewMargin, ZFUIMarginZero by default
 
virtual void nativeImplViewMarginCustom (ZFUIMargin const &propertyValue)
 see nativeImplViewMarginCustom

 
virtual void * nativeView ()
 native container view
 
virtual zfbool viewFocused ()
 whether the view currently focused
 
virtual void viewFocusRequest (zfbool viewFocus)
 request to obtain or resign focus, result can be checked by viewFocused
 
virtual zfanyT< ZFUIViewviewFocusFind ()
 recursively to find focused child, take care of performance
 
virtual zfanyT< ZFUIViewviewParent ()
 parent view or null if none
 
virtual void viewRemoveFromParent ()
 remove this view from parent or do nothing if no parent
 
virtual zffloat const & UIScale ()
 UI scale for view tree.
 
virtual void UIScale (zffloat const &propertyValue)
 see UIScale

 
virtual zffloat UIScaleInherited ()
 see UIScale
 
virtual zffloat UIScaleForImpl ()
 see UIScale
 
virtual zffloat UIScaleForPixel ()
 see UIScale
 
virtual zffloat UIScaleFixed ()
 see UIScale
 
virtual zfautoT< ZFUILayoutParamlayoutParamCreate ()
 create layout param, calling layoutParamClass to create instance and layoutParamOnUpdate to update
 
virtual void layoutParam (ZFUILayoutParam *layoutParam)
 manually set layout param
 
virtual zfanyT< ZFUILayoutParamlayoutParam ()
 get self's layout param, valid only while the view has parent
 
virtual void layoutRequest ()
 set need layout
 
virtual zfbool layoutRequested ()
 true if need layout
 
virtual zfbool layouting ()
 true if currently being layouted
 
virtual const ZFUISizelayoutMeasure (const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
 measure the view
 
virtual const ZFUISizelayoutMeasuredSize ()
 get measured size, invalid if not measured
 
virtual void layoutIfNeed ()
 force to layout if need
 
virtual ZFUIPoint layoutChildOffset ()
 get child offset to this view
 
virtual zfanyT< ZFUIViewchildFindById (const zfchar *viewId, zfbool findRecursively=(_ZFT_t_zftrue), zfbool includeInternalViews=(_ZFT_t_zffalse))
 find view by viewId, return the view or null if not found
 
virtual zfanyT< ZFUILayoutParamchildAddWithParam (ZFUIView *view, ZFUILayoutParam *layoutParam, zfindex atIndex=(((zfindex) -1)))
 add view with layout param, param must be created by layoutParamCreate
 
zfanyT< ZFUILayoutParamchildAdd (ZFUIView *view, zfindex atIndex=((zfindex) -1))
 util method for childAddWithParam
 
virtual void childRemove (ZFUIView *view)
 remove view or do nothing if view isn't added to this view
 
virtual void childRemoveAt (zfindex index)
 remove view at index or assert fail if index out of range
 
virtual void childRemoveAll ()
 remove all child view
 
virtual void childMove (zfindex fromIndex, zfindex toIndexOrIndexMax)
 move view, make toIndexOrIndexMax as zfindexMax() to move to top most, and 0 to bottom most, do nothing if index invalid or have no change
 
virtual void childMove (ZFUIView *child, zfindex toIndexOrIndexMax)
 see childMove
 
virtual void childReplaceAt (zfindex atIndex, ZFUIView *toReplace)
 replace child at index, assert fail if index out of range or view to replace already has parent
 
virtual zfindex childCount ()
 get child view count
 
virtual zfanyT< ZFUIViewchildAt (zfindex index)
 get child view at index or assert fail if out of range
 
virtual zfindex childFind (ZFUIView *view)
 return index of view or zfindexMax() if not child of this view
 
virtual ZFCoreArray< zfautoT< ZFUIView > > childArray ()
 get the child view array
 
virtual ZFUIViewChildLayerEnum viewLayer ()
 this view belongs to which layer of parent, valid only if viewParent is not null
 
virtual ZFCoreArray< zfautoT< ZFUIView > > childRawArray ()
 return all children including internal views, see childArray
 
virtual zfanyT< ZFUILayoutParaminternalImplViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(0), zfbool addAsTopMost=(_ZFT_t_zftrue))
 see internalBgViewAdd
 
virtual void internalImplViewRemove (ZFUIView *view)
 see internalBgViewAdd
 
virtual ZFCoreArray< zfautoT< ZFUIView > > internalImplViewArray ()
 see internalBgViewAdd
 
virtual zfanyT< ZFUILayoutParaminternalBgViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(0), zfbool addAsTopMost=(_ZFT_t_zftrue))
 internal view which is independent from normal view
 
virtual void internalBgViewRemove (ZFUIView *view)
 see internalBgViewAdd
 
virtual ZFCoreArray< zfautoT< ZFUIView > > internalBgViewArray ()
 usually for debug use only, try to avoid use this in your app for other purpose
 
virtual zfanyT< ZFUILayoutParaminternalFgViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(0), zfbool addAsTopMost=(_ZFT_t_zftrue))
 see internalBgViewAdd
 
virtual void internalFgViewRemove (ZFUIView *view)
 see internalBgViewAdd
 
virtual ZFCoreArray< zfautoT< ZFUIView > > internalFgViewArray ()
 see internalBgViewAdd
 
virtual void internalViewAutoSerializeTagAdd (const zfchar *tag)
 used to apply auto serialize logic to internal views
 
virtual void internalViewAutoSerializeTagRemove (const zfchar *tag)
 see internalViewAutoSerializeTagAdd
 
virtual void internalViewAutoSerializeTagRemoveAll ()
 see internalViewAutoSerializeTagAdd
 
virtual void internalViewAutoSerializeTagGetAllT (ZFCoreArray< zfstring > &ret)
 see internalViewAutoSerializeTagAdd
 
virtual ZFCoreArray< zfstringinternalViewAutoSerializeTagGetAll ()
 see internalViewAutoSerializeTagAdd
 
virtual void viewEventSend (ZFUIEvent *event)
 directly send a event, use with caution
 
- Public Member Functions inherited from ZFObject
zfindex objectRetainCount (void)
 return the object's retain count
 
ZFObjectHolderobjectHolder (void)
 return an object holder that hold this object without affecting retain count
 
virtual void objectInfoOfInstanceT (zfstring &ret)
 see objectInfoOfInstance
 
virtual zfstring objectInfoOfInstance (void)
 return a short string describe the object instance
 
virtual void objectInfoT (zfstring &ret)
 see objectInfo
 
virtual zfstring objectInfo (void)
 return object info
 
virtual zfbool equalTo (ZFObject *anotherObj)
 util to objectCompare
 
virtual zfauto invoke (const zfchar *methodName)
 util method to perform ZFDI_invoke, do nothing if fail
 
virtual zfauto invoke (const zfchar *methodName, ZFObject *param0, ZFObject *param1=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param2=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param3=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param4=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param5=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param6=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef), ZFObject *param7=((ZFObject *const &) _ZFP_ZFMethodGenericInvokerDefaultParamRef))
 util method to perform ZFDI_invoke, do nothing if fail
 
virtual zfauto invokeDetail (const zfchar *methodName, const ZFCoreArray< zfauto > &params, zfbool *success=0, zfstring *errorHint=0)
 util method to perform ZFDI_invoke, do nothing if fail
 
zfbool objectTagExist (void)
 see objectTag, true if this object has tag, and tag can be checked by objectTagGetAllKeyValue
 
void objectTag (const zfchar *key, ZFObject *tag)
 used to hold a object for app's use, auto retained
 
zfany objectTag (const zfchar *key)
 see objectTag
 
void objectTagGetAllKeyValue (ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue)
 get all key value
 
void objectTagRemove (const zfchar *key)
 remove tag, same as set tag to null
 
zfauto objectTagRemoveAndGet (const zfchar *key)
 remove tag, return removed tag or null if not exist
 
void objectTagRemoveAll (void)
 remove all tag
 
void observerAdd (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
 
void observerAddForOnce (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
 
void observerRemove (zfidentity eventId, const ZFListener &callback)
 see observerNotify
 
void observerRemoveAll (zfidentity eventId)
 see observerNotify
 
void observerRemoveAll (void)
 see observerNotify
 
zfbool observerHasAdd (void)
 true if any observer has been added
 
zfbool observerHasAdd (zfidentity eventId)
 true if any observer with eventId has been added
 
void observerNotify (zfidentity eventId, ZFObject *param0=0, ZFObject *param1=0)
 notify the observer with eventId
 
void observerNotifyWithSender (ZFObject *customSender, zfidentity eventId, ZFObject *param0=0, ZFObject *param1=0)
 see observerNotify
 
ZFObserverobserverHolder (void)
 access the internal observer holder
 
ZFObjectInstanceState objectInstanceState (void)
 object instance's state
 
virtual zfbool objectIsInternal (void)
 whether this object is internal object or its class is ZFClass::classIsInternal
 
virtual zfbool objectIsInternalPrivate (void)
 whether this object is internal private object or its class is ZFClass::classIsInternalPrivate
 
ZFV zfv (void)
 see ZFV
 
- Public Member Functions inherited from ZFStyleable
virtual zfanyT< ZFStyleabledefaultStyle (void)
 return default style of this instance
 
void styleableCopyFrom (ZFStyleable *anotherStyleable)
 copy style from another styleable, see ZFStyleable
 
virtual zfbool styleableIsDefaultStyle (void)
 true if this object is defaultStyle
 
void styleKey (const zfchar *styleKey)
 see ZFStyleSet
 
const zfcharstyleKey (void)
 see ZFStyleSet
 
void styleKeyForProperty (const zfchar *propertyName, const zfchar *styleKey)
 see ZFStyleSet
 
const zfcharstyleKeyForProperty (const zfchar *propertyName)
 see ZFStyleSet
 
void styleKeyForProperty (const ZFProperty *property, const zfchar *styleKey)
 see ZFStyleSet
 
const zfcharstyleKeyForProperty (const ZFProperty *property)
 see ZFStyleSet
 
- Public Member Functions inherited from ZFInterface
virtual ZFObjecttoObject (void)=0
 convert to ZFObject type
 
- Public Member Functions inherited from ZFSerializable
zfbool serializable (void)
 true if object is currently serializable, see ZFSerializable
 
zfbool serializeFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=0, ZFSerializableData *outErrorPos=0)
 serialize from data, see ZFSerializable
 
zfbool serializeToData (ZFSerializableData &serializableData, zfstring *outErrorHint=0, ZFSerializable *referencedOwnerOrNull=0)
 serialize to data, see ZFSerializable
 
zfbool serializeFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=0)
 serialize from string, return false by default
 
zfbool serializeToString (zfstring &ret, zfstring *errorHint=0)
 see serializeFromString
 
void serializableGetAllSerializablePropertyT (ZFCoreArray< const ZFProperty * > &ret)
 see serializableGetAllSerializableProperty
 
ZFCoreArray< const ZFProperty * > serializableGetAllSerializableProperty (void)
 get all serializable property, usually for debug only, see serializableOnCheckPropertyType
 
void serializableGetAllSerializableEmbededPropertyT (ZFCoreArray< const ZFProperty * > &ret)
 see serializableGetAllSerializableEmbededProperty
 
ZFCoreArray< const ZFProperty * > serializableGetAllSerializableEmbededProperty (void)
 get all serializable embeded property, usually for debug only, see serializableOnCheckPropertyType
 
virtual void serializableInfoT (zfstring &ret)
 get info as a serializable
 
virtual zfstring serializableInfo (void)
 see serializableInfoT
 
- Public Member Functions inherited from ZFCopyable
zfautoT< ZFCopyablecopy (void)
 return a copy of this object
 
void copyFrom (ZFObject *anotherObj)
 see copy, anotherObj must be same type as this object (by classData), otherwise, do nothing
 

Static Public Member Functions

static const ZFClassClassData (void)
 get class info
 
static zfanyT< ZFUIButtonDefaultStyle (void)
 
static zfidentity EventButtonOnClick (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonStateOnUpdate (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnDown (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnMoveEnter (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnMoveExit (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnMoveInside (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnMoveOutside (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnUpInside (void)
 see ZFObject::observerNotify
 
static zfidentity EventButtonMouseOnUp (void)
 see ZFObject::observerNotify
 
- Static Public Member Functions inherited from ZFUIView
static const ZFClassClassData (void)
 get class info
 
static zfanyT< ZFUIViewDefaultStyle (void)
 
static zfidentity EventViewChildOnChange (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewChildOnAdd (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewChildOnRemove (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewOnAddToParent (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewOnRemoveFromParent (void)
 see ZFObject::observerNotify
 
static zfidentity EventUIScaleOnChange (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewFocusOnChange (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewOnEvent (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewLayoutOnLayoutRequest (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewLayoutOnMeasureFinish (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewLayoutOnLayoutPrepare (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewLayoutOnLayout (void)
 see ZFObject::observerNotify
 
static zfidentity EventViewLayoutOnLayoutFinish (void)
 see ZFObject::observerNotify
 
static zfidentity EventNativeImplViewMarginOnUpdate (void)
 see ZFObject::observerNotify
 
static ZFUITransformFlags viewTransformAvailable ()
 whether transform is supported
 
- Static Public Member Functions inherited from ZFStyleableObject
static const ZFClassClassData (void)
 get class info
 
- Static Public Member Functions inherited from ZFObject
static const ZFClassClassData (void)
 get class info
 
static zfidentity EventObjectBeforeAlloc (void)
 see ZFObject::observerNotify
 
static zfidentity EventObjectAfterAlloc (void)
 see ZFObject::observerNotify
 
static zfidentity EventObjectBeforeDealloc (void)
 see ZFObject::observerNotify
 
static zfidentity EventObjectPropertyValueOnUpdate (void)
 see ZFObject::observerNotify
 
- Static Public Member Functions inherited from ZFStyleable
static const ZFClassClassData (void)
 get class info
 
- Static Public Member Functions inherited from ZFInterface
static const ZFClassClassData (void)
 get class info
 
- Static Public Member Functions inherited from ZFSerializable
static const ZFClassClassData (void)
 get class info
 
- Static Public Member Functions inherited from ZFCopyable
static const ZFClassClassData (void)
 get class info
 

Protected Types

typedef ZFUIView zfsuper
 class ref to super
 
typedef ZFUIButton zfself
 class ref to self
 
- Protected Types inherited from ZFUIView
typedef ZFStyleableObject zfsuper
 class ref to super
 
typedef ZFUIView zfself
 class ref to self
 
- Protected Types inherited from ZFStyleableObject
typedef ZFObject zfsuper
 class ref to super
 
typedef ZFStyleableObject zfself
 class ref to self
 
- Protected Types inherited from ZFObject
typedef _ZFP_Obj_Base zfsuper
 class ref to super
 
typedef ZFObject zfself
 class ref to self
 
- Protected Types inherited from ZFStyleable
enum  PropertyType { PropertyTypeNotStyleable , PropertyTypeNormal , PropertyTypeStyleable , PropertyTypeCopyable }
 see ZFStyleable::styleableOnCheckPropertyType More...
 
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
 
typedef ZFStyleable zfself
 typedef for self
 
- Protected Types inherited from ZFInterface
typedef _ZFP_ObjI_Base zfsuper
 typedef for super (always ZFInterface for an interface type)
 
typedef ZFInterface zfself
 typedef for self
 
- Protected Types inherited from ZFSerializable
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
 
typedef ZFSerializable zfself
 typedef for self
 
- Protected Types inherited from ZFCopyable
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
 
typedef ZFCopyable zfself
 typedef for self
 

Protected Member Functions

virtual void objectOnInit (void)
 override this to init your object
 
virtual void objectOnInitFinish (void)
 called after objectOnInit, safe to call virtual functions here
 
virtual void objectOnDealloc (void)
 override this to destroy your object
 
virtual void viewEventOnMouseEvent (ZFUIMouseEvent *mouseEvent)
 called when mouse event occurred
 
virtual void viewEventOnKeyEvent (ZFUIKeyEvent *keyEvent)
 called when key occurred
 
virtual void buttonOnClick (ZFUIEvent *event)
 see EventButtonOnClick
 
virtual void buttonMouseOnDown (ZFUIMouseEvent *event)
 see EventButtonMouseOnDown
 
virtual void buttonMouseOnMoveEnter (ZFUIMouseEvent *event)
 see EventButtonMouseOnMoveEnter
 
virtual void buttonMouseOnMoveExit (ZFUIMouseEvent *event)
 see EventButtonMouseOnMoveExit
 
virtual void buttonMouseOnMoveInside (ZFUIMouseEvent *event)
 see EventButtonMouseOnMoveInside
 
virtual void buttonMouseOnMoveOutside (ZFUIMouseEvent *event)
 see EventButtonMouseOnMoveOutside
 
virtual void buttonMouseOnUpInside (ZFUIMouseEvent *event)
 see EventButtonMouseOnUpInside
 
virtual void buttonMouseOnUp (ZFUIMouseEvent *event)
 see EventButtonMouseOnUp
 
virtual void buttonStateOnUpdate (void)
 see EventButtonStateOnUpdate
 
- Protected Member Functions inherited from ZFUIView
virtual zfbool serializableOnSerializeFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=0, ZFSerializableData *outErrorPos=0)
 for serializable data that has "category" attribute, ZFSerializable would ignore it and leave it to subclass to resolve, see ZFSerializable
 
virtual zfbool serializableOnSerializeToData (ZFSerializableData &serializableData, ZFSerializable *referencedOwnerOrNull, zfstring *outErrorHint=0)
 corresponding to serializableOnSerializeFromData, return whether the task is success, see ZFSerializable
 
virtual zfbool serializableOnCheckNeedSerializeChildren (void)
 whether we should serialize all children
 
virtual void objectOnDeallocPrepare (void)
 called before objectOnDealloc, safe to call virtual functions here
 
virtual void objectInfoOnAppend (zfstring &ret)
 called by objectInfoT to append object info as a chain
 
virtual void nativeImplView (void *nativeImplView, ZFUIViewNativeImplViewDeleteCallback nativeImplViewDeleteCallback, zfbool nativeImplViewRequireVirtualIndex)
 see nativeImplView
 
virtual void nativeImplViewMarginImplUpdate (ZFUIMargin &nativeImplViewMargin)
 see nativeImplViewMargin, subclass must call super and "append" to existing margin
 
virtual void nativeImplViewMarginOnUpdate (void)
 see EventNativeImplViewMarginOnUpdate
 
virtual void nativeImplViewOnLayout (ZFUIRect &ret, const ZFUIRect &bounds, const ZFUIMargin &nativeImplViewMargin)
 called to layout nativeImplView
 
virtual void implChildOnAdd (ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayerEnum childLayer, zfindex childLayerIndex)
 called to add or remove view to impl
 
virtual void implChildOnRemove (ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayerEnum childLayer, zfindex childLayerIndex)
 see implChildOnAdd, implChildOnRemoveAllForDealloc
 
virtual void implChildOnRemoveAllForDealloc (void)
 called to remove all children during parent dealloc for performance
 
virtual void viewFocusOnChange (void)
 see EventViewFocusOnChange
 
virtual void UIScaleOnChange (void)
 see UIScale, ensured called only when scale value actually changed
 
virtual const ZFClasslayoutParamClass (void)
 see layoutParamCreate
 
virtual void layoutParamOnUpdate (ZFUILayoutParam *layoutParam)
 see layoutParamCreate
 
virtual void layoutOnLayoutRequest (void)
 called during layoutRequest
 
virtual void layoutOnMeasure (ZFUISize &ret, const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
 called by layoutMeasure to decide the view's size
 
virtual void layoutOnMeasureFinish (ZFUISize &measuredSize, const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
 see EventViewLayoutOnMeasureFinish
 
virtual void layoutOnLayoutPrepare (const ZFUIRect &bounds)
 see EventViewLayoutOnLayoutPrepare
 
virtual void layoutOnLayout (const ZFUIRect &bounds)
 called by viewFrame to layout the view and children
 
virtual void layoutOnLayoutFinish (const ZFUIRect &bounds)
 see EventViewLayoutOnLayoutFinish
 
virtual void layoutChildOffsetOnUpdate (ZFUIPoint &ret)
 see layoutChildOffset
 
virtual void viewChildOnChange (void)
 see EventViewChildOnChange
 
virtual void viewChildOnAdd (ZFUIView *child, ZFUIViewChildLayerEnum childLayer)
 see EventViewChildOnAdd
 
virtual void viewChildOnRemove (ZFUIView *child, ZFUIViewChildLayerEnum childLayer)
 see EventViewChildOnRemove
 
virtual void viewOnAddToParent (ZFUIView *parent)
 see EventViewOnAddToParent
 
virtual void viewOnRemoveFromParent (ZFUIView *parent)
 see EventViewOnRemoveFromParent
 
virtual zfbool internalViewShouldLayout (ZFUIView *internalView)
 called to check whether the internal view should be layouted using default layout logic, return true by default
 
virtual void internalViewOnLayout (const ZFUIRect &bounds)
 see internalBgViewAdd
 
virtual void viewEventOnEvent (ZFUIEvent *event)
 notified when a ZFUIEvent occurred
 
virtual void viewEventOnKeyEventResolveFocus (ZFUIKeyEvent *keyEvent)
 called by viewEventOnKeyEvent to resolve focus move key event
 
virtual void viewEventOnWheelEvent (ZFUIWheelEvent *wheelEvent)
 called when wheel event occurred
 
virtual void styleableOnCopyFrom (ZFStyleable *anotherStyleable)
 for a view, copy style would also copy all of it's children
 
virtual void observerOnAdd (zfidentity eventId)
 called when add first observer
 
virtual void observerOnRemove (zfidentity eventId)
 called when remove last observer
 
- Protected Member Functions inherited from ZFStyleableObject
virtual void copyableOnCopyFrom (ZFObject *anotherObj)
 called by copy to copy contents from anotherObj
 
- Protected Member Functions inherited from ZFObject
virtual void observerOnEvent (const ZFArgs &zfargs)
 notified when observerNotify
 
virtual void objectOnRetain (void)
 called to retain object
 
virtual void objectOnRelease (void)
 called to release object
 
virtual void objectPropertyValueOnUpdate (const ZFProperty *property, const void *oldValue)
 see EventObjectPropertyValueOnUpdate
 
- Protected Member Functions inherited from ZFStyleable
virtual ZFStyleable::PropertyType styleableOnCheckPropertyType (const ZFProperty *property)
 check property type
 
virtual void styleableOnCopyPropertyFrom (ZFStyleable *anotherStyleable, const ZFProperty *property, ZFStyleable::PropertyType propertyType)
 copy property with styleable logic
 
- Protected Member Functions inherited from ZFSerializable
virtual ZFSerializablePropertyType serializableOnCheckPropertyType (const ZFProperty *property)
 check the property type that serializable should do what while serializing
 
virtual zfbool serializableOnCheck (void)
 see serializable
 
virtual zfbool serializableOnSerializePropertyFromData (const ZFSerializableData &propertyData, const ZFProperty *property, zfstring *outErrorHint=0, ZFSerializableData *outErrorPos=0)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
 
virtual zfbool serializableOnSerializePropertyToData (ZFSerializableData &ownerData, const ZFProperty *property, ZFSerializable *referencedOwnerOrNull, zfstring *outErrorHint=0)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
 
virtual zfbool serializableOnSerializeEmbededPropertyFromData (const ZFSerializableData &propertyData, const ZFProperty *property, zfstring *outErrorHint=0, ZFSerializableData *outErrorPos=0)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
 
virtual zfbool serializableOnSerializeEmbededPropertyToData (ZFSerializableData &ownerData, const ZFProperty *property, ZFSerializable *referencedOwnerOrNull, zfstring *outErrorHint=0)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
 
virtual zfbool serializableOnSerializeFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=0)
 see serializeFromString
 
virtual zfbool serializableOnSerializeToString (zfstring &ret, zfstring *errorHint=0)
 see serializeFromString
 

Detailed Description

abstract button

use ZFUIButton::EventButtonOnClick to register button click listener, see ZFObject::observerNotify for more info
ZFUIButton is an abstract button, use its subclass to create

Member Function Documentation

◆ classData()

virtual const ZFClass * ZFUIButton::classData ( void )
inlinevirtual

get instance's class info

Reimplemented from ZFUIView.

Reimplemented in ZFUIButtonBasic, ZFUIButtonCheckBox, ZFUIButtonRatio, and ZFUIHintContentBasic.

◆ DefaultStyle()

static zfanyT< ZFUIButton > ZFUIButton::DefaultStyle ( void )
static


default style for ZFUIButton

◆ EventButtonOnClick()

static zfidentity ZFUIButton::EventButtonOnClick ( void )
inlinestatic

see ZFObject::observerNotify

called when button clicked (for both checkable and non-checkable button)
param0 is the ZFUIMouseEvent or ZFUIKeyEvent that cause the button click, or null for other clicked reason, such as simulateClick

◆ EventButtonStateOnUpdate()

static zfidentity ZFUIButton::EventButtonStateOnUpdate ( void )
inlinestatic

see ZFObject::observerNotify

called when button init finished and each time button state update

◆ EventButtonMouseOnDown()

static zfidentity ZFUIButton::EventButtonMouseOnDown ( void )
inlinestatic

see ZFObject::observerNotify

called when button mouse down, param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnMoveEnter()

static zfidentity ZFUIButton::EventButtonMouseOnMoveEnter ( void )
inlinestatic

see ZFObject::observerNotify

called when mouse move from outside to inside, param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnMoveExit()

static zfidentity ZFUIButton::EventButtonMouseOnMoveExit ( void )
inlinestatic

see ZFObject::observerNotify

called when mouse move from inside to outside, param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnMoveInside()

static zfidentity ZFUIButton::EventButtonMouseOnMoveInside ( void )
inlinestatic

see ZFObject::observerNotify

called when mouse move inside the button, param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnMoveOutside()

static zfidentity ZFUIButton::EventButtonMouseOnMoveOutside ( void )
inlinestatic

see ZFObject::observerNotify

called when mouse move outside the button, param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnUpInside()

static zfidentity ZFUIButton::EventButtonMouseOnUpInside ( void )
inlinestatic

see ZFObject::observerNotify

called when button mouse up inside (clicked), param0 is the ZFUIMouseEvent

◆ EventButtonMouseOnUp()

static zfidentity ZFUIButton::EventButtonMouseOnUp ( void )
inlinestatic

see ZFObject::observerNotify

called when button mouse up (outside or cancel), param0 is the ZFUIMouseEvent

◆ buttonClickTolerance()

virtual ZFUIMargin const & ZFUIButton::buttonClickTolerance ( )
inlinevirtual

mouse up tolerance to detect as click, (0 - ZFUIGlobalStyle::itemMargin) by default

a negative value would increase the button area while mouse up, so that button is easier to be clicked, and a positive value would reduce the button area

◆ objectOnInit()

virtual void ZFUIButton::objectOnInit ( void )
protectedvirtual

override this to init your object

subclass must call superclass's objectOnInit before any other code if override
you may also declare objectOnInit with params like this:

zfclass Parent : ... {
...
protected:
virtual void objectOnInit(void) {...};
};
zfclass Child : Parent {
protected:
// override all parent's objectOnInit is also required,
// because of function hiding of C++
virtual void objectOnInit(void) {
}
// custom init entry
virtual void objectOnInit(Params...) {
this->objectOnInit();
// your extra init steps
...
}
};
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
virtual void objectOnInit(void)
override this to init your object
virtual void objectOnInit(void)
override this to init your object
Warning
objectOnInit and objectOnDealloc is called as a virtual function, take good care of other virtual function call, use zfself::func() instead of this->func() if necessary, or use objectOnInitFinish/objectOnDeallocPrepare, or declare your own constructor with ZFOBJECT_DECLARE_WITH_CUSTOM_CTOR
Note
(ZFTAG_LIMITATION) due to limitations of C++, if your parent type declared objectOnInit with different params, and your child type want to override part of those objectOnInit, then your child type must also override all objectOnInit that parent declared, otherwise, some may be hidden
for objects that designed not to be allocated by user, you should use ZFOBJECT_PRIVATE_ALLOC, typically usage:
ZFOBJECT_PRIVATE_ALLOC("should be created by MyObject::instanceForXxx only")
public:
static zfauto instanceForXxx(xxx) {
// can only be allocated by reflection
}
};
static void func(void) {
// MyObject *obj = zfAlloc(MyObject); // would compile error
zfauto obj = MyObject::instanceForXxx(xxx); // OK
}
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFOBJECT_PRIVATE_ALLOC(...)
mark this object can not be allocated directly
Definition ZFObjectDeclare.h:240
zfauto newInstance(void) const
make a new instance of ZFObject dynamically, which is described by ZFClass
base class of all objects
Definition ZFObjectCore.h:209
static const ZFClass * ClassData(void)
get class info
Definition ZFUIButton.h:42
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34

Reimplemented from ZFUIView.

Reimplemented in ZFUIButtonBasic.

◆ objectOnInitFinish()

virtual void ZFUIButton::objectOnInitFinish ( void )
protectedvirtual

called after objectOnInit, safe to call virtual functions here

usually used to initialize independent resources other than self's internal resources

Reimplemented from ZFObject.

◆ objectOnDealloc()

virtual void ZFUIButton::objectOnDealloc ( void )
protectedvirtual

override this to destroy your object

subclass must call superclass's objectOnDealloc after any other code if override
see objectOnInit for more info

Reimplemented from ZFUIView.

Reimplemented in ZFUIButtonBasic.

◆ simulateClick()

virtual void ZFUIButton::simulateClick ( ZFUIEvent * event = (0))
virtual

util method to simulate click button

the optional event paran would be passed to EventButtonOnClick

◆ viewEventOnMouseEvent()

virtual void ZFUIButton::viewEventOnMouseEvent ( ZFUIMouseEvent * mouseEvent)
protectedvirtual

called when mouse event occurred

due to some limitations, we doesn't support intercept mouse event, event dispatch logic depends on implementation, you may use native view to achieve if necessary

mouse hover event would only be fired if viewMouseHoverEventEnable

by default, this method would simply resolve the event if this view is enabled, you may override without call super's method, to override the event

Reimplemented from ZFUIView.

◆ viewEventOnKeyEvent()

virtual void ZFUIButton::viewEventOnKeyEvent ( ZFUIKeyEvent * keyEvent)
protectedvirtual

called when key occurred

due to some limitations, we doesn't support intercept key event, event dispatch logic depends on implementation, you may use native view to achieve if necessary

by default, this method would call viewEventOnKeyEventResolveFocus to achieve focus move, you may override without call super's method, to override the event
the event would be dispatched from child to parent, util it's resolved

Reimplemented from ZFUIView.

◆ buttonStateOnUpdate()

virtual void ZFUIButton::buttonStateOnUpdate ( void )
inlineprotectedvirtual

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