32 #ifndef _MGUI_NCSCTRL_ABSTRACTBUTTONPIECEPIECE_H 33 #define _MGUI_NCSCTRL_ABSTRACTBUTTONPIECEPIECE_H 39 typedef struct _mAbstractButtonPieceClass mAbstractButtonPieceClass;
40 typedef struct _mAbstractButtonPiece mAbstractButtonPiece;
42 #define mAbstractButtonPieceClassHeader(clss, superCls) \ 43 mContainerPieceClassHeader(clss, superCls) 45 struct _mAbstractButtonPieceClass
47 mAbstractButtonPieceClassHeader(mAbstractButtonPiece, mContainerPiece)
50 MGNCS_EXPORT
extern mAbstractButtonPieceClass g_stmAbstractButtonPieceCls;
52 #define mAbstractButtonPieceHeader(clss) \ 53 mContainerPieceHeader(clss) \ 54 unsigned char flags; \ 55 unsigned char state; \ 56 unsigned char check_state; \ 59 struct _mAbstractButtonPiece
61 mAbstractButtonPieceHeader(mAbstractButtonPiece)
64 enum mAbstractButtonPieceStates{
72 enum mAbstractButtonPieceCheckStates {
73 NCS_ABP_UNCHECKED = 0,
78 #define NCSS_ABP_CHECKABLE 0x01 79 #define NCSS_ABP_AUTOCHECK 0x02 80 #define NCSS_ABP_3DCHECK 0x04 81 #define NCSS_ABP_DISABLE 0x08 82 #define NCSS_ABP_FLAT 0x10 // show button's as flat 83 #define NCSS_ABP_NOREPEATMSG 0x20 // disbale the auto repeat message 86 #define mAbstractButtonPiece_isCheckable(self) \ 87 IS_BIT_SET((self)->flags, NCSS_ABP_CHECKABLE) 88 #define mAbstractButtonPiece_setCheckable(self, bcheckable) \ 89 ((bcheckable)?SET_BIT((self)->flags, NCSS_ABP_CHECKABLE):CLEAR_BIT((self)->flags, NCSS_ABP_CHECKABLE)) 91 #define mAbstractButtonPiece_isAutoCheck(self) \ 92 IS_BIT_SET((self)->flags, NCSS_ABP_AUTOCHECK) 93 #define mAbstractButtonPiece_setAutoCheck(self, bautocheck) \ 94 ((bautocheck)?SET_BIT((self)->flags, NCSS_ABP_AUTOCHECK):CLEAR_BIT((self)->flags, NCSS_ABP_AUTOCHECK)) 96 #define mAbstractButtonPiece_is3DCheck(self) \ 97 IS_BIT_SET((self)->flags, NCSS_ABP_3DCHECK) 98 #define mAbstractButtonPiece_set3DCheck(self, b3dcheck) \ 99 ((b3dcheck)?SET_BIT((self)->flags, NCSS_ABP_3DCHECK):CLEAR_BIT((self)->flags, NCSS_ABP_3DCHECK)) 101 #define mAbstractButtonPiece_needRepeatMsg(self) \ 102 !(IS_BIT_SET((self)->flags, NCSS_ABP_NOREPEATMSG)) 103 #define mAbstractButtonPiece_setNoRepeatMsg(self, norepeat) \ 104 ((norepeat)?SET_BIT((self)->flags, NCSS_ABP_NOREPEATMSG):CLEAR_BIT((self)->flags, NCSS_ABP_NOREPEATMSG)) 106 #define mAbstractButtonPiece_isEnableFlag(self) \ 107 (!IS_BIT_SET((self)->flags, NCSS_ABP_DISABLE)) 109 #define mAbstractButtonPiece_setEnable(self, benable) \ 110 ((benable)?CLEAR_BIT((self)->flags,NCSS_ABP_DISABLE):SET_BIT((self)->flags, NCSS_ABP_DISABLE)) 112 enum mAbstractButtonPieceProps{
113 NCSP_ABP_CHECKABLE = ABP_PROP_BEGIN,
120 NCSP_ABP_NOREPEATMSG,
123 enum mAbstractButtonPieceEvent {
124 NCSN_ABP_CLICKED = ABP_EVENT_BEGIN,
125 NCSN_ABP_STATE_CHANGED,