mGNCS API Reference  v1.2.5
A new control set and a new framework for MiniGUI apps
mscroll_widget.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
54 #ifndef _MGUI_WIDGET_SCROLL_H
55 #define _MGUI_WIDGET_SCROLL_H
56 
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif /* __cplusplus */
61 
72 #define NCSCTRL_SCROLLWIDGET NCSCLASSNAME("scrollwidget")
73 
74 typedef struct _mScrollWidget mScrollWidget;
75 typedef struct _mScrollWidgetClass mScrollWidgetClass;
76 typedef struct _mScrollWidgetRenderer mScrollWidgetRenderer;
77 
83 {
96 };
97 
98 #define mScrollWidgetHeader(className) \
99  mWidgetHeader(className) \
100  unsigned int realContWidth; \
101  unsigned int realContHeight; \
102  unsigned int hStepVal; \
103  unsigned int vStepVal; \
104  int contX; \
105  int contY; \
106  unsigned int contWidth; \
107  unsigned int contHeight; \
108  unsigned int visWidth; \
109  unsigned int visHeight; \
110  unsigned int leftMargin; \
111  unsigned int topMargin; \
112  unsigned int rightMargin; \
113  unsigned int bottomMargin; \
114  unsigned int drawMode;
115 
167 struct _mScrollWidget
168 {
169  mScrollWidgetHeader(mScrollWidget)
170 };
171 
172 #define mScrollWidgetClassHeader(clsName, parentClass) \
173  mWidgetClassHeader(clsName, parentClass) \
174  void (*onHScroll)(clsName*, int code, int mouseX); \
175  void (*onVScroll)(clsName*, int code, int mouseY); \
176  void (*initMargins)(clsName*, int l, int t, int r, int b); \
177  void (*moveContent)(clsName*); \
178  void (*resetViewPort)(clsName*, unsigned int,unsigned int); \
179  void (*setScrollInfo)(clsName*, BOOL reDraw); \
180  BOOL (*makePosVisible)(clsName*, int x, int y); \
181  void (*getContRect)(clsName*, RECT *rcCont); \
182  void (*getVisRect)(clsName*, RECT *rcVis); \
183  void (*viewportToWindow)(clsName*, int *x, int *y); \
184  void (*viewportToContent)(clsName*, int *x, int *y); \
185  void (*windowToViewport)(clsName*, int *x, int *y); \
186  void (*contentToViewport)(clsName*, int *x, int *y); \
187  void (*contentToWindow)(clsName*, int *x, int *y); \
188  void (*windowToContent)(clsName*, int *x, int *y); \
189  void (*refreshRect)(clsName*, const RECT *rc); \
190  BOOL (*isVisible)(clsName*, int x, int y);
191 
248 struct _mScrollWidgetClass
249 {
250  mScrollWidgetClassHeader(mScrollWidget, mWidget)
251 };
252 
253 #define mScrollWidgetRendererHeader(clsName, parentClass) \
254  mWidgetRendererHeader(clsName, parentClass)
255 
261 struct _mScrollWidgetRenderer {
262  mScrollWidgetRendererHeader(mScrollWidget, mWidget)
263 };
264 
271 MGNCS_EXPORT extern mScrollWidgetClass g_stmScrollWidgetCls;
272 
278 {
282  NCSP_SWGT_CONTWIDTH = NCSP_WIDGET_MAX + 1,
323 };
324 
329 #define NCSS_SWGT_SHIFT NCSS_WIDGET_SHIFT
330 
339  NCSN_SWGT_MAX = NCSN_WIDGET_MAX + 1
340 };
341 
344 #ifdef __cplusplus
345 }
346 #endif /* __cplusplus */
347 
348 #endif /* _MGUI_WIDGET_SCROLL_H */
349 
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.