mscroll_widget.h

Go to the documentation of this file.
00001 
00026 #ifndef _MGUI_WIDGET_SCROLL_H
00027 #define _MGUI_WIDGET_SCROLL_H
00028  
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif  /* __cplusplus */
00033 
00044 #define NCSCTRL_SCROLLWIDGET   NCSCLASSNAME("scrollwidget")
00045 
00046 typedef struct _mScrollWidget mScrollWidget;
00047 typedef struct _mScrollWidgetClass mScrollWidgetClass;
00048 typedef struct _mScrollWidgetRenderer mScrollWidgetRenderer;
00049 
00054 enum ncsSwgtDrawMode
00055 {
00059    NCSID_SWGT_AUTO = 0,
00063    NCSID_SWGT_ALWAYS,
00067    NCSID_SWGT_NEVER
00068 };
00069 
00070 #define mScrollWidgetHeader(className)  \
00071         mWidgetHeader(className)            \
00072     unsigned int realContWidth;         \
00073     unsigned int realContHeight;        \
00074     unsigned int hStepVal;              \
00075     unsigned int vStepVal;              \
00076     int          contX;                 \
00077     int          contY;                 \
00078     unsigned int contWidth;             \
00079     unsigned int contHeight;            \
00080     unsigned int visWidth;              \
00081     unsigned int visHeight;             \
00082     unsigned int leftMargin;            \
00083     unsigned int topMargin;             \
00084     unsigned int rightMargin;           \
00085     unsigned int bottomMargin;          \
00086     unsigned int drawMode;
00087 
00139 struct _mScrollWidget
00140 {
00141         mScrollWidgetHeader(mScrollWidget)
00142 };
00143 
00144 #define mScrollWidgetClassHeader(clsName, parentClass)          \
00145         mWidgetClassHeader(clsName, parentClass)                    \
00146     void (*onHScroll)(clsName*, int code, int mouseX);          \
00147     void (*onVScroll)(clsName*, int code, int mouseY);          \
00148     void (*initMargins)(clsName*, int l, int t, int r, int b);  \
00149     void (*moveContent)(clsName*);                              \
00150     void (*resetViewPort)(clsName*, unsigned int,unsigned int); \
00151     void (*setScrollInfo)(clsName*, BOOL reDraw);               \
00152     BOOL (*makePosVisible)(clsName*, int x, int y);             \
00153     void (*getContRect)(clsName*, RECT *rcCont);                \
00154     void (*getVisRect)(clsName*, RECT *rcVis);                  \
00155     void (*viewportToWindow)(clsName*, int *x, int *y);         \
00156     void (*viewportToContent)(clsName*, int *x, int *y);        \
00157     void (*windowToViewport)(clsName*, int *x, int *y);         \
00158     void (*contentToViewport)(clsName*, int *x, int *y);        \
00159     void (*contentToWindow)(clsName*, int *x, int *y);          \
00160     void (*windowToContent)(clsName*, int *x, int *y);          \
00161     void (*refreshRect)(clsName*, const RECT *rc);              \
00162     BOOL (*isVisible)(clsName*, int x, int y);
00163 
00220 struct _mScrollWidgetClass
00221 {
00222         mScrollWidgetClassHeader(mScrollWidget, mWidget)
00223 };
00224 
00225 #define mScrollWidgetRendererHeader(clsName, parentClass) \
00226         mWidgetRendererHeader(clsName, parentClass)
00227 
00233 struct  _mScrollWidgetRenderer {
00234         mScrollWidgetRendererHeader(mScrollWidget, mWidget)
00235 };
00236 
00243 MGNCS_EXPORT extern mScrollWidgetClass g_stmScrollWidgetCls;
00244 
00249 enum mScrollWidgetProp
00250 {
00254     NCSP_SWGT_CONTWIDTH = NCSP_WIDGET_MAX + 1,
00258         NCSP_SWGT_CONTHEIGHT,
00262         NCSP_SWGT_CONTX,
00266         NCSP_SWGT_CONTY,
00270         NCSP_SWGT_HSTEPVALUE,
00274         NCSP_SWGT_VSTEPVALUE,
00278         NCSP_SWGT_VISWIDTH,
00282         NCSP_SWGT_VISHEIGHT,
00286         NCSP_SWGT_MARGINRECT,
00290         NCSP_SWGT_DRAWMODE,
00294         NCSP_SWGT_MAX
00295 };
00296 
00301 #define NCSS_SWGT_SHIFT  NCSS_WIDGET_SHIFT
00302 
00307 enum mScrollWidgetNotify {
00311     NCSN_SWGT_MAX = NCSN_WIDGET_MAX + 1
00312 };
00313 
00316 #ifdef __cplusplus
00317 }
00318 #endif  /* __cplusplus */
00319 
00320 #endif /* _MGUI_WIDGET_SCROLL_H */
00321 
Generated on Fri Jun 10 11:18:06 2011 for New Control Set V1.0.0 API Reference by  doxygen 1.6.3