ZFFramework
 
Loading...
Searching...
No Matches
ZFUIScrollThumb.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUIScrollThumb_h_
7#define _ZFI_ZFUIScrollThumb_h_
8
9#include "ZFUIScrollView.h"
11
12// ============================================================
13// ZFUIScrollThumb
17zfinterface ZFLIB_ZFUIKit ZFUIScrollThumb : zfextend ZFInterface {
18 ZFINTERFACE_DECLARE(ZFUIScrollThumb, ZFInterface)
19
20public:
26 ZFEVENT(ScrollThumbOnUpdate)
27
28public:
35 ZF_OUT zffloat &scrollThumbResultPos
36 , ZF_OUT zffloat &scrollThumbResultSize
37 , ZF_IN zffloat scrollThumbRange
38 , ZF_IN zffloat scrollViewSize
39 , ZF_IN zffloat scrollContentOffset
40 , ZF_IN zffloat scrollContentSize
41 , ZF_IN zffloat scrollThumbMinSize
42 , ZF_IN_OPT zffloat headMargin = 0
43 , ZF_IN_OPT zffloat tailMargin = 0
44 );
49 ZF_OUT zffloat &scrollContentOffset
50 , ZF_IN zffloat scrollViewSize
51 , ZF_IN zffloat scrollContentSize
52 , ZF_IN zffloat scrollThumbPos
53 , ZF_IN zffloat scrollThumbSize
54 , ZF_IN zffloat scrollThumbRange
55 , ZF_IN_OPT zffloat headMargin = 0
56 , ZF_IN_OPT zffloat tailMargin = 0
57 );
58
59public:
64 return this->_scrollView;
65 }
66
70 return this->_horizontal;
71 }
72
73public:
77 virtual void scrollThumbInit(void) zfpurevirtual;
82
88 virtual void scrollThumbUpdate(void) zfpurevirtual;
89
90private:
91 zfanyT<ZFUIScrollView> _scrollView;
92 zfbool _horizontal;
93 friend zfclassFwd ZFUIScrollView;
94};
95
96// ============================================================
103 , ZFMP_IN(const ZFClass *, cls)
115 , ZFMP_IN(const ZFClass *, cls)
121
123#endif // #ifndef _ZFI_ZFUIScrollThumb_h_
124
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfpurevirtual
dummy macro shows that a method is pure virtual method
Definition ZFCoreTypeDef_ClassType.h:68
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_FUNC_DECLARE_0(ZFLIB_, ReturnType, MethodName)
declare function type of ZFMethod
Definition ZFMethodFuncDeclare.h:493
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfinterface
shows the type is an interface, see ZFInterface
Definition ZFObjectInterface.h:20
#define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface,...)
see ZFInterface
Definition ZFObjectInterface.h:100
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:328
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
void ZFUIScrollThumbHorizontalClass(const ZFClass *cls)
change default scroll thumb class
void ZFUIScrollThumbVerticalClass(const ZFClass *cls)
change default scroll thumb class
scroll view
ZFObject's class info.
Definition ZFClass.h:67
static void scrollThumbPosToViewPos(zffloat &scrollContentOffset, zffloat scrollViewSize, zffloat scrollContentSize, zffloat scrollThumbPos, zffloat scrollThumbSize, zffloat scrollThumbRange, zffloat headMargin=0, zffloat tailMargin=0)
util method to calculate view's position according to scroll thumb's position
virtual void scrollThumbDealloc(void)=0
destroy the scroll thumb
zfbool scrollThumbHorizontal(void)
this thumb is horizontal or not
Definition ZFUIScrollThumb.h:69
virtual void scrollThumbUpdate(void)=0
update the scroll thumb, this method may be called repeatly
zfanyT< ZFUIScrollView > const & scrollView(void)
owner scroll view
Definition ZFUIScrollThumb.h:63
virtual void scrollThumbInit(void)=0
init the scroll thumb
static void scrollThumbPosFromViewPos(zffloat &scrollThumbResultPos, zffloat &scrollThumbResultSize, zffloat scrollThumbRange, zffloat scrollViewSize, zffloat scrollContentOffset, zffloat scrollContentSize, zffloat scrollThumbMinSize, zffloat headMargin=0, zffloat tailMargin=0)
util method to calculate scroll thumb's position according to view's position
see zfany
Definition zfany.h:106