mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mpropsheet.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 #ifdef _MGNCSCTRL_PROPSHEET
55 
56 #ifndef _MGUI_NCSCTRL_PROPSHEET_H
57 #define _MGUI_NCSCTRL_PROPSHEET_H
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62 
72 #define NCSCTRL_PROPSHEET NCSCLASSNAME("propsheet")
73 
78 #define NCSS_PRPSHT_SHIFT NCSS_WIDGET_SHIFT+3
79 
80 #define NCSS_PRPSHT_BTNMASK (0x0003<<NCSS_WIDGET_SHIFT)
81 #define NCSS_PRPSHT_TABMASK (0x0004<<NCSS_WIDGET_SHIFT)
82 
88 #define NCSS_PRPSHT_SIMPLE (0x0000<<NCSS_WIDGET_SHIFT)
89 
94 #define NCSS_PRPSHT_COMPACTTAB (0x0001<<NCSS_WIDGET_SHIFT)
95 
100 #define NCSS_PRPSHT_SCROLLABLE (0x0002<<NCSS_WIDGET_SHIFT)
101 
106 #define NCSS_PRPSHT_TOP (0x0000<<NCSS_WIDGET_SHIFT)
107 
113 #define NCSS_PRPSHT_BOTTOM (0x0004<<NCSS_WIDGET_SHIFT)
114 
115 typedef struct _mPropSheet mPropSheet;
116 typedef struct _mPropSheetClass mPropSheetClass;
117 typedef struct _mPropSheetRenderer mPropSheetRenderer;
118 
119 #define mPropSheetHeader(className) \
120  mWidgetHeader(className) \
121  int minTabWidth; \
122  int maxTabWidth; \
123  int scrollTabWidth; \
124  RECT headRect; \
125  int pageCount; \
126  BOOL btnShow; \
127  mPage* active; \
128  mPage* firstView; \
129  int tabMargin;
130 
162 struct _mPropSheet
163 {
164  mPropSheetHeader(mPropSheet)
165 };
166 
167 #define mPropSheetClassHeader(clsName, parentClass) \
168  mWidgetClassHeader(clsName, parentClass) \
169  int (*getPageIndex)(clsName*, mPage* page); \
170  mPage* (*getPageByIndex)(clsName*, int pageIndex); \
171  mPage* (*addPage)(clsName*, const PDLGTEMPLATE dlgTemplate, const NCS_EVENT_HANDLER* handlers);\
172  BOOL (*removePageByIndex)(clsName*, int pageIndex);\
173  BOOL (*removePage)(clsName*, mPage* page); \
174  mPage* (*getNextPage)(clsName*, mPage* page); \
175  mPage* (*getPrevPage)(clsName*, mPage* page); \
176  int (*broadCastMsg)(clsName*, DWORD param1, DWORD param2);
177 
227 struct _mPropSheetClass
228 {
229  mPropSheetClassHeader(mPropSheet, mWidget)
230 };
231 
236 enum ncsPrpShtFlags
237 {
241  NCSF_PRPSHT_BORDER,
242 
246  NCSF_PRPSHT_TAB,
247 
251  NCSF_PRPSHT_LEFT,
252 
256  NCSF_PRPSHT_RIGHT,
257 
261  NCSF_PRPSHT_PAGE,
262 
266  NCSF_PRPSHT_MAX,
267 };
268 
269 #define mPropSheetRendererHeader(clsName, parentClass) \
270  mWidgetRendererHeader(clsName, parentClass) \
271  void (*resetHeadArea) (clsName*, RECT* rcClient, DWORD style); \
272  void (*getRect)(clsName*, RECT* rcClient, RECT *rcResult, int which); \
273  void (*drawBorder)(clsName*, HDC hdc, RECT *rcBorder); \
274  void (*drawScrollBtn)(clsName*, HDC hdc, RECT *rcBtn, int which); \
275  void (*drawTab)(clsName*, HDC hdc, RECT* rcTab, const char* title, HICON hIcon, BOOL active);
276 
320 struct _mPropSheetRenderer {
321  mPropSheetRendererHeader(mPropSheet, mWidget)
322 };
323 
330 MGNCS_EXPORT extern mPropSheetClass g_stmPropSheetCls;
331 
336 enum mPropSheetNotify
337 {
342  NCSN_PRPSHT_ACTIVECHANGED = NCSN_WIDGET_MAX + 1,
346  NCSN_PRPSHT_MAX
347 };
348 
349 
354 enum mPropSheetProp
355 {
363  NCSP_PRPSHT_MINTABWIDTH = NCSP_WIDGET_MAX + 1,
371  NCSP_PRPSHT_TABMARGIN,
379  NCSP_PRPSHT_ACTIVEPAGE,
387  NCSP_PRPSHT_ACTIVEPAGEIDX,
395  NCSP_PRPSHT_FIRSTVIEWPAGE,
403  NCSP_PRPSHT_FIRSTVIEWPAGEIDX,
411  NCSP_PRPSHT_PAGECOUNT,
412  NCSP_PRPSHT_MAX
413 };
414 
416 #ifdef __cplusplus
417 }
418 #endif /* __cplusplus */
419 
420 #endif /* _MGUI_NCSCTRL_PROPSHEET_H */
421 #endif //_MGNCSCTRL_PROPSHEET
mWidget
define the mWidget members, inherit from mComponent