31 #if defined (_MGNCSCTRL_SCROLLBAR) || defined (_MGNCSCTRL_TRACKBAR) 33 #ifndef _MGUI_NCSCTRL_SLIDERPIECE_H 34 #define _MGUI_NCSCTRL_SLIDERPIECE_H 40 typedef struct _mSliderPieceClass mSliderPieceClass;
41 typedef struct _mSliderPiece mSliderPiece;
43 #define mSliderPieceClassHeader(clss, superCls) \ 44 mContainerPieceClassHeader(clss, superCls) \ 45 int (*stepLine)(clss*, BOOL forward); \ 46 int (*stepPage)(clss*, BOOL forward); 48 struct _mSliderPieceClass
50 mSliderPieceClassHeader(mSliderPiece, mContainerPiece)
53 MGNCS_EXPORT
extern mSliderPieceClass g_stmSliderPieceCls;
55 #define mSliderPieceHeader(clss) \ 56 mContainerPieceHeader(clss) \ 58 unsigned char flags; \ 59 unsigned char thumb_state; \ 60 unsigned short line_step; \ 61 unsigned short page_step; \ 62 unsigned short cur_pos; \ 66 #define NCSS_SLIDERPIECE_VERT 0x01 67 #define NCSS_SLIDERPIECE_TICK 0x02 68 #define NCSS_SLIDERPIECE_MIN 0x04 69 #define NCSS_SLIDERPIECE_MAX 0x08 70 #define NCSS_SLIDERPIECE_CENTERTHUMB 0x10 //the start point at the center of thumb 72 #define mSliderPiece_setVert(self) (((self)->flags)|= NCSS_SLIDERPIECE_VERT) 73 #define mSliderPiece_setHorz(self) (((self)->flags)&= (~NCSS_SLIDERPIECE_VERT)) 74 #define mSliderPiece_isVert(self) ((((self)->flags)&NCSS_SLIDERPIECE_VERT) == NCSS_SLIDERPIECE_VERT) 76 #define mSliderPiece_setTick(self) (((self)->flags)|=NCSS_SLIDERPIECE_TICK) 77 #define mSliderPiece_clearTick(self) (((self)->flags)&=(~NCSS_SLIDERPIECE_TICK)) 78 #define mSliderPiece_isTick(self) (((self)->flags)&NCSS_SLIDERPIECE_TICK) 80 #define mSliderPiece_setMin(self) (((self)->flags)|=NCSS_SLIDERPIECE_MIN) 81 #define mSliderPiece_clearMin(self) (((self)->flags)&=(~NCSS_SLIDERPIECE_MIN)) 82 #define mSliderPiece_isMin(self) ((self)->flags & NCSS_SLIDERPIECE_MIN) 84 #define mSliderPiece_setMax(self) (((self)->flags)|=NCSS_SLIDERPIECE_MAX) 85 #define mSliderPiece_clearMax(self) (((self)->flags)&=(~NCSS_SLIDERPIECE_MAX)) 86 #define mSliderPiece_isMax(self) ((self)->flags & NCSS_SLIDERPIECE_MAX) 88 #define mSliderPiece_setCenterThumb(self) (((self)->flags) |= NCSS_SLIDERPIECE_CENTERTHUMB) 89 #define mSliderPiece_clearCenterThumb(self) (((self)->flags) &= (~NCSS_SLIDERPIECE_CENTERTHUMB)) 90 #define mSliderPiece_isCenterThumb(self) ((self)->flags & NCSS_SLIDERPIECE_CENTERTHUMB) 94 mSliderPieceHeader(mSliderPiece)
97 enum mSliderPieceProps{
98 NCSP_SLIDERPIECE_POS = SLIDERPIECE_PROP_BEGIN,
99 NCSP_SLIDERPIECE_LINESTEP ,
100 NCSP_SLIDERPIECE_PAGESTEP ,
101 NCSP_SLIDERPIECE_MAX,
102 NCSP_SLIDERPIECE_MIN,
103 NCSP_SLIDERPIECE_TICK,
105 NCSP_SLIDERPIECE_DIRECTION = PIECECOMM_PROP_DIRECTION
108 enum mSliderPieceEvent
110 NCSN_SLIDERPIECE_POSCHANGED = SLIDERPIECE_EVENT_BEGIN,
111 NCSN_SLIDERPIECE_REACHMAX,
112 NCSN_SLIDERPIECE_REACHMIN
120 #endif //_MGNCSCTRL_SCROLLBAR _MGNCSCTRL_TRACKBAR