mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mpropsheet.h
Go to the documentation of this file.
1 
42 #ifdef _MGNCSCTRL_PROPSHEET
43 
44 #ifndef _MGUI_NCSCTRL_PROPSHEET_H
45 #define _MGUI_NCSCTRL_PROPSHEET_H
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50 
60 #define NCSCTRL_PROPSHEET NCSCLASSNAME("propsheet")
61 
66 #define NCSS_PRPSHT_SHIFT NCSS_WIDGET_SHIFT+3
67 
68 #define NCSS_PRPSHT_BTNMASK (0x0003<<NCSS_WIDGET_SHIFT)
69 #define NCSS_PRPSHT_TABMASK (0x0004<<NCSS_WIDGET_SHIFT)
70 
76 #define NCSS_PRPSHT_SIMPLE (0x0000<<NCSS_WIDGET_SHIFT)
77 
82 #define NCSS_PRPSHT_COMPACTTAB (0x0001<<NCSS_WIDGET_SHIFT)
83 
88 #define NCSS_PRPSHT_SCROLLABLE (0x0002<<NCSS_WIDGET_SHIFT)
89 
94 #define NCSS_PRPSHT_TOP (0x0000<<NCSS_WIDGET_SHIFT)
95 
101 #define NCSS_PRPSHT_BOTTOM (0x0004<<NCSS_WIDGET_SHIFT)
102 
103 typedef struct _mPropSheet mPropSheet;
104 typedef struct _mPropSheetClass mPropSheetClass;
105 typedef struct _mPropSheetRenderer mPropSheetRenderer;
106 
107 #define mPropSheetHeader(className) \
108  mWidgetHeader(className) \
109  int minTabWidth; \
110  int maxTabWidth; \
111  int scrollTabWidth; \
112  RECT headRect; \
113  int pageCount; \
114  BOOL btnShow; \
115  mPage* active; \
116  mPage* firstView; \
117  int tabMargin;
118 
150 struct _mPropSheet
151 {
152  mPropSheetHeader(mPropSheet)
153 };
154 
155 #define mPropSheetClassHeader(clsName, parentClass) \
156  mWidgetClassHeader(clsName, parentClass) \
157  int (*getPageIndex)(clsName*, mPage* page); \
158  mPage* (*getPageByIndex)(clsName*, int pageIndex); \
159  mPage* (*addPage)(clsName*, const PDLGTEMPLATE dlgTemplate, const NCS_EVENT_HANDLER* handlers);\
160  BOOL (*removePageByIndex)(clsName*, int pageIndex);\
161  BOOL (*removePage)(clsName*, mPage* page); \
162  mPage* (*getNextPage)(clsName*, mPage* page); \
163  mPage* (*getPrevPage)(clsName*, mPage* page); \
164  int (*broadCastMsg)(clsName*, DWORD param1, DWORD param2);
165 
215 struct _mPropSheetClass
216 {
217  mPropSheetClassHeader(mPropSheet, mWidget)
218 };
219 
224 enum ncsPrpShtFlags
225 {
229  NCSF_PRPSHT_BORDER,
230 
234  NCSF_PRPSHT_TAB,
235 
239  NCSF_PRPSHT_LEFT,
240 
244  NCSF_PRPSHT_RIGHT,
245 
249  NCSF_PRPSHT_PAGE,
250 
254  NCSF_PRPSHT_MAX,
255 };
256 
257 #define mPropSheetRendererHeader(clsName, parentClass) \
258  mWidgetRendererHeader(clsName, parentClass) \
259  void (*resetHeadArea) (clsName*, RECT* rcClient, DWORD style); \
260  void (*getRect)(clsName*, RECT* rcClient, RECT *rcResult, int which); \
261  void (*drawBorder)(clsName*, HDC hdc, RECT *rcBorder); \
262  void (*drawScrollBtn)(clsName*, HDC hdc, RECT *rcBtn, int which); \
263  void (*drawTab)(clsName*, HDC hdc, RECT* rcTab, const char* title, HICON hIcon, BOOL active);
264 
308 struct _mPropSheetRenderer {
309  mPropSheetRendererHeader(mPropSheet, mWidget)
310 };
311 
318 MGNCS_EXPORT extern mPropSheetClass g_stmPropSheetCls;
319 
324 enum mPropSheetNotify
325 {
330  NCSN_PRPSHT_ACTIVECHANGED = NCSN_WIDGET_MAX + 1,
334  NCSN_PRPSHT_MAX
335 };
336 
337 
342 enum mPropSheetProp
343 {
351  NCSP_PRPSHT_MINTABWIDTH = NCSP_WIDGET_MAX + 1,
359  NCSP_PRPSHT_TABMARGIN,
367  NCSP_PRPSHT_ACTIVEPAGE,
375  NCSP_PRPSHT_ACTIVEPAGEIDX,
383  NCSP_PRPSHT_FIRSTVIEWPAGE,
391  NCSP_PRPSHT_FIRSTVIEWPAGEIDX,
399  NCSP_PRPSHT_PAGECOUNT,
400  NCSP_PRPSHT_MAX
401 };
402 
404 #ifdef __cplusplus
405 }
406 #endif /* __cplusplus */
407 
408 #endif /* _MGUI_NCSCTRL_PROPSHEET_H */
409 #endif //_MGNCSCTRL_PROPSHEET
define the mWidget members, inherit from mComponent