mbutton.h
00001
00002 #ifndef _MGUI_NCSCTRL_BUTTON_H
00003 #define _MGUI_NCSCTRL_BUTTON_H
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00018 #define NCSCTRL_BUTTON NCSCLASSNAME("button")
00019
00020 typedef struct _mButton mButton;
00021 typedef struct _mButtonClass mButtonClass;
00022 typedef struct _mButtonRenderer mButtonRenderer;
00023
00029 enum mButtonCheckState{
00030 NCS_BUTTON_UNCHECKED = 0,
00031 NCS_BUTTON_HALFCHECKED,
00032 NCS_BUTTON_CHECKED
00033 };
00034
00048 #define mButtonHeader(clsName) \
00049 mWidgetHeader(clsName) \
00050 mWidget* group;
00051
00061 struct _mButton
00062 {
00063 mButtonHeader(mButton)
00064 };
00065
00066 #define mButtonClassHeader(clsName, parentClass) \
00067 mWidgetClassHeader(clsName, parentClass) \
00068 mObject * (*createContent)(clsName *self, DWORD dwStyle); \
00069 mObject * (*createButtonBody)(clsName *self, DWORD dwStyle, mObject * content);
00070
00092 struct _mButtonClass
00093 {
00094 mButtonClassHeader(mButton, mWidget)
00095 };
00096
00097 #define mButtonRendererHeader(clsName, parentClass) \
00098 mWidgetRendererHeader(clsName, parentClass) \
00099 void (*drawPushButton)(clsName *self, HDC hdc, \
00100 const RECT *rect, \
00101 DWORD color1, DWORD color2, int status);
00102
00120 struct _mButtonRenderer
00121 {
00122 mButtonRendererHeader(mButton, mWidget)
00123 };
00124
00129 MGNCS_EXPORT extern mButtonClass g_stmButtonCls;
00130
00135 enum mButtonProp {
00143 NCSP_BUTTON_ALIGN = NCSP_WIDGET_MAX + 1,
00151 NCSP_BUTTON_VALIGN,
00159 NCSP_BUTTON_WORDWRAP,
00167 NCSP_BUTTON_IMAGE,
00175 NCSP_BUTTON_CHECKSTATE,
00183 NCSP_BUTTON_IMAGE_SIZE_PERCENT,
00191 NCSP_BUTTON_GROUPID,
00199 NCSP_BUTTON_GROUP,
00200 NCSP_BUTTON_MAX
00201 };
00202
00208 enum eButtonNotify {
00213 NCSN_BUTTON_PUSHED = NCSN_WIDGET_MAX + 1,
00220 NCSN_BUTTON_STATE_CHANGED,
00221 NCSN_BUTTON_MAX
00222 };
00223
00228 #define NCSS_BUTTON_IMAGE (1<<NCSS_WIDGET_SHIFT)
00229
00233 #define NCSS_BUTTON_CHECKABLE (2<<NCSS_WIDGET_SHIFT)
00234
00239 #define NCSS_BUTTON_AUTOCHECK (4<<NCSS_WIDGET_SHIFT)
00240
00245 #define NCSS_BUTTON_3DCHECK (8<<NCSS_WIDGET_SHIFT)
00246
00251 #define NCSS_BUTTON_IMAGELABEL (0x10<<NCSS_WIDGET_SHIFT)
00252
00257 #define NCSS_BUTTON_VERTIMAGELABEL (0x20<<NCSS_WIDGET_SHIFT)
00258 #define NCSS_BUTTON_SHIFT (NCSS_WIDGET_SHIFT + 6)
00259
00265 #ifdef __cplusplus
00266 }
00267 #endif
00268
00269 #endif
00270