mpropsheet.h

Go to the documentation of this file.
00001 
00026 #ifdef _MGNCSCTRL_PROPSHEET
00027 
00028 #ifndef _MGUI_NCSCTRL_PROPSHEET_H
00029 #define _MGUI_NCSCTRL_PROPSHEET_H
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif  /* __cplusplus */
00034 
00044 #define NCSCTRL_PROPSHEET        NCSCLASSNAME("propsheet")
00045 
00050 #define NCSS_PRPSHT_SHIFT  NCSS_WIDGET_SHIFT+3
00051 
00052 #define NCSS_PRPSHT_BTNMASK         (0x0003<<NCSS_WIDGET_SHIFT)
00053 #define NCSS_PRPSHT_TABMASK         (0x0004<<NCSS_WIDGET_SHIFT)
00054 
00060 #define NCSS_PRPSHT_SIMPLE          (0x0000<<NCSS_WIDGET_SHIFT)
00061 
00066 #define NCSS_PRPSHT_COMPACTTAB      (0x0001<<NCSS_WIDGET_SHIFT)
00067 
00072 #define NCSS_PRPSHT_SCROLLABLE      (0x0002<<NCSS_WIDGET_SHIFT)
00073 
00078 #define NCSS_PRPSHT_TOP             (0x0000<<NCSS_WIDGET_SHIFT)
00079 
00085 #define NCSS_PRPSHT_BOTTOM          (0x0004<<NCSS_WIDGET_SHIFT)
00086 
00087 typedef struct _mPropSheet mPropSheet;
00088 typedef struct _mPropSheetClass mPropSheetClass;
00089 typedef struct _mPropSheetRenderer mPropSheetRenderer;
00090 
00091 #define mPropSheetHeader(className) \
00092         mWidgetHeader(className)        \
00093     int     minTabWidth;            \
00094     int     maxTabWidth;            \
00095     int     scrollTabWidth;         \
00096     RECT    headRect;               \
00097     int     pageCount;              \
00098     BOOL    btnShow;                \
00099     mPage*  active;                 \
00100     mPage*  firstView;              \
00101     int     tabMargin;
00102 
00134 struct _mPropSheet
00135 {
00136         mPropSheetHeader(mPropSheet)
00137 };
00138 
00139 #define mPropSheetClassHeader(clsName, parentClass)    \
00140         mWidgetClassHeader(clsName, parentClass)           \
00141     int (*getPageIndex)(clsName*, mPage* page);        \
00142     mPage* (*getPageByIndex)(clsName*, int pageIndex); \
00143     mPage* (*addPage)(clsName*, const PDLGTEMPLATE dlgTemplate, const NCS_EVENT_HANDLER* handlers);\
00144     BOOL (*removePageByIndex)(clsName*, int pageIndex);\
00145     BOOL (*removePage)(clsName*, mPage* page);         \
00146     mPage* (*getNextPage)(clsName*, mPage* page);      \
00147     mPage* (*getPrevPage)(clsName*, mPage* page);      \
00148     int (*broadCastMsg)(clsName*, DWORD param1, DWORD param2);
00149 
00199 struct _mPropSheetClass
00200 {
00201         mPropSheetClassHeader(mPropSheet, mWidget)
00202 };
00203 
00208 enum ncsPrpShtFlags
00209 {
00213     NCSF_PRPSHT_BORDER,
00214 
00218     NCSF_PRPSHT_TAB,
00219 
00223     NCSF_PRPSHT_LEFT,
00224 
00228     NCSF_PRPSHT_RIGHT,
00229 
00233     NCSF_PRPSHT_PAGE,
00234 
00238     NCSF_PRPSHT_MAX,
00239 };
00240 
00241 #define mPropSheetRendererHeader(clsName, parentClass)                      \
00242         mWidgetRendererHeader(clsName, parentClass)                             \
00243     void (*resetHeadArea) (clsName*, RECT* rcClient, DWORD style);          \
00244     void (*getRect)(clsName*, RECT* rcClient, RECT *rcResult, int which);   \
00245     void (*drawBorder)(clsName*, HDC hdc, RECT *rcBorder);                  \
00246     void (*drawScrollBtn)(clsName*, HDC hdc, RECT *rcBtn, int which);       \
00247     void (*drawTab)(clsName*, HDC hdc, RECT* rcTab, const char* title, HICON hIcon, BOOL active);
00248 
00292 struct  _mPropSheetRenderer {
00293         mPropSheetRendererHeader(mPropSheet, mWidget)
00294 };
00295 
00302 MGNCS_EXPORT extern mPropSheetClass g_stmPropSheetCls;
00303 
00308 enum mPropSheetNotify
00309 {
00314     NCSN_PRPSHT_ACTIVECHANGED = NCSN_WIDGET_MAX + 1,
00318     NCSN_PRPSHT_MAX
00319 };
00320 
00321 
00326 enum mPropSheetProp
00327 {
00335         NCSP_PRPSHT_MINTABWIDTH = NCSP_WIDGET_MAX + 1,
00343         NCSP_PRPSHT_TABMARGIN,
00351     NCSP_PRPSHT_ACTIVEPAGE,
00359     NCSP_PRPSHT_ACTIVEPAGEIDX,
00367     NCSP_PRPSHT_FIRSTVIEWPAGE,
00375     NCSP_PRPSHT_FIRSTVIEWPAGEIDX,
00383         NCSP_PRPSHT_PAGECOUNT,
00384         NCSP_PRPSHT_MAX
00385 };
00386 
00388 #ifdef __cplusplus
00389 }
00390 #endif  /* __cplusplus */
00391 
00392 #endif /* _MGUI_NCSCTRL_PROPSHEET_H */
00393 #endif //_MGNCSCTRL_PROPSHEET
Generated on Fri Jun 10 11:18:06 2011 for New Control Set V1.0.0 API Reference by  doxygen 1.6.3