mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mscroll_widget.h
Go to the documentation of this file.
1 
42 #ifndef _MGUI_WIDGET_SCROLL_H
43 #define _MGUI_WIDGET_SCROLL_H
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49 
60 #define NCSCTRL_SCROLLWIDGET NCSCLASSNAME("scrollwidget")
61 
62 typedef struct _mScrollWidget mScrollWidget;
63 typedef struct _mScrollWidgetClass mScrollWidgetClass;
64 typedef struct _mScrollWidgetRenderer mScrollWidgetRenderer;
65 
71 {
84 };
85 
86 #define mScrollWidgetHeader(className) \
87  mWidgetHeader(className) \
88  unsigned int realContWidth; \
89  unsigned int realContHeight; \
90  unsigned int hStepVal; \
91  unsigned int vStepVal; \
92  int contX; \
93  int contY; \
94  unsigned int contWidth; \
95  unsigned int contHeight; \
96  unsigned int visWidth; \
97  unsigned int visHeight; \
98  unsigned int leftMargin; \
99  unsigned int topMargin; \
100  unsigned int rightMargin; \
101  unsigned int bottomMargin; \
102  unsigned int drawMode;
103 
155 struct _mScrollWidget
156 {
157  mScrollWidgetHeader(mScrollWidget)
158 };
159 
160 #define mScrollWidgetClassHeader(clsName, parentClass) \
161  mWidgetClassHeader(clsName, parentClass) \
162  void (*onHScroll)(clsName*, int code, int mouseX); \
163  void (*onVScroll)(clsName*, int code, int mouseY); \
164  void (*initMargins)(clsName*, int l, int t, int r, int b); \
165  void (*moveContent)(clsName*); \
166  void (*resetViewPort)(clsName*, unsigned int,unsigned int); \
167  void (*setScrollInfo)(clsName*, BOOL reDraw); \
168  BOOL (*makePosVisible)(clsName*, int x, int y); \
169  void (*getContRect)(clsName*, RECT *rcCont); \
170  void (*getVisRect)(clsName*, RECT *rcVis); \
171  void (*viewportToWindow)(clsName*, int *x, int *y); \
172  void (*viewportToContent)(clsName*, int *x, int *y); \
173  void (*windowToViewport)(clsName*, int *x, int *y); \
174  void (*contentToViewport)(clsName*, int *x, int *y); \
175  void (*contentToWindow)(clsName*, int *x, int *y); \
176  void (*windowToContent)(clsName*, int *x, int *y); \
177  void (*refreshRect)(clsName*, const RECT *rc); \
178  BOOL (*isVisible)(clsName*, int x, int y);
179 
236 struct _mScrollWidgetClass
237 {
238  mScrollWidgetClassHeader(mScrollWidget, mWidget)
239 };
240 
241 #define mScrollWidgetRendererHeader(clsName, parentClass) \
242  mWidgetRendererHeader(clsName, parentClass)
243 
249 struct _mScrollWidgetRenderer {
250  mScrollWidgetRendererHeader(mScrollWidget, mWidget)
251 };
252 
259 MGNCS_EXPORT extern mScrollWidgetClass g_stmScrollWidgetCls;
260 
266 {
270  NCSP_SWGT_CONTWIDTH = NCSP_WIDGET_MAX + 1,
311 };
312 
317 #define NCSS_SWGT_SHIFT NCSS_WIDGET_SHIFT
318 
327  NCSN_SWGT_MAX = NCSN_WIDGET_MAX + 1
328 };
329 
332 #ifdef __cplusplus
333 }
334 #endif /* __cplusplus */
335 
336 #endif /* _MGUI_WIDGET_SCROLL_H */
337 
MGNCS_EXPORT mScrollWidgetClass g_stmScrollWidgetCls
The instance of mScrollWidgetClass.
The structure of mScrollWidget control, which derived from mWidget. It is the abstract superclass of ...
The virtual function table of mScrollWidget, which derived from mWidgetClass.
define the mWidget members, inherit from mComponent
The structure of mScrollWidget renderer, which inheried from mWidgetRenderer.
ncsSwgtDrawMode
Scroll bar drawing mode in ScrollWidget.
mScrollWidgetProp
The properties id of mScrollWidget.
mScrollWidgetNotify
The notification code id of mScrollWidget.