mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mbutton.h
Go to the documentation of this file.
1 
42 #ifndef _MGUI_NCSCTRL_BUTTON_H
43 #define _MGUI_NCSCTRL_BUTTON_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48 
58 #define NCSCTRL_BUTTON NCSCLASSNAME("button")
59 
60 typedef struct _mButton mButton;
61 typedef struct _mButtonClass mButtonClass;
62 typedef struct _mButtonRenderer mButtonRenderer;
63 
73 };
74 
88 #define mButtonHeader(clsName) \
89  mWidgetHeader(clsName) \
90  mWidget* group;
91 
101 struct _mButton
102 {
103  mButtonHeader(mButton)
104 };
105 
106 #define mButtonClassHeader(clsName, parentClass) \
107  mWidgetClassHeader(clsName, parentClass) \
108  mObject * (*createContent)(clsName *self, DWORD dwStyle); \
109  mObject * (*createButtonBody)(clsName *self, DWORD dwStyle, mObject * content);
110 
132 struct _mButtonClass
133 {
134  mButtonClassHeader(mButton, mWidget)
135 };
136 
137 #define mButtonRendererHeader(clsName, parentClass) \
138  mWidgetRendererHeader(clsName, parentClass) \
139  void (*drawPushButton)(clsName *self, HDC hdc, \
140  const RECT *rect, \
141  DWORD color1, DWORD color2, int status);
142 
160 struct _mButtonRenderer
161 {
162  mButtonRendererHeader(mButton, mWidget)
163 };
164 
169 MGNCS_EXPORT extern mButtonClass g_stmButtonCls;
170 
183  NCSP_BUTTON_ALIGN = NCSP_WIDGET_MAX + 1,
240  NCSP_BUTTON_MAX
241 };
242 
253  NCSN_BUTTON_PUSHED = NCSN_WIDGET_MAX + 1,
261  NCSN_BUTTON_MAX
262 };
263 
268 #define NCSS_BUTTON_IMAGE (1<<NCSS_WIDGET_SHIFT)
269 
273 #define NCSS_BUTTON_CHECKABLE (2<<NCSS_WIDGET_SHIFT)
274 
279 #define NCSS_BUTTON_AUTOCHECK (4<<NCSS_WIDGET_SHIFT)
280 
285 #define NCSS_BUTTON_3DCHECK (8<<NCSS_WIDGET_SHIFT)
286 
291 #define NCSS_BUTTON_IMAGELABEL (0x10<<NCSS_WIDGET_SHIFT)
292 
297 #define NCSS_BUTTON_VERTIMAGELABEL (0x20<<NCSS_WIDGET_SHIFT)
298 #define NCSS_BUTTON_SHIFT (NCSS_WIDGET_SHIFT + 6)
299 
305 #ifdef __cplusplus
306 }
307 #endif /* __cplusplus */
308 
309 #endif /* _MGUI_NCSCTRL_BUTTON_H */
310 
button struct of button control, derived from mWidgetClass
Set the image size.
Definition: mbutton.h:223
define the mWidget members, inherit from mComponent
eButtonNotify
the notification code of mButton
Definition: mbutton.h:248
Set the button text horizontal align.
Definition: mbutton.h:183
Set the button group.
Definition: mbutton.h:239
button pushed
Definition: mbutton.h:253
button halfchecked state, it is a state between checked and unchecked, halfchecked state is valid if ...
Definition: mbutton.h:71
Set the button image pointer.
Definition: mbutton.h:207
mButtonProp
the properties id of mButton
Definition: mbutton.h:175
mButtonCheckState
define the check state of button
Definition: mbutton.h:69
Set the check state of button.
Definition: mbutton.h:215
Set the button text to autowrap mode.
Definition: mbutton.h:199
button unchecked state, the button is not pushed down
Definition: mbutton.h:70
Set the button text vertical align.
Definition: mbutton.h:191
button checked state, the button is pushed down
Definition: mbutton.h:72
Button class renderer interface, derived from mWidgetRenderer.
Button class, derived from mWidget.
button check state changed
Definition: mbutton.h:260
MGNCS_EXPORT mButtonClass g_stmButtonCls
global mButtonClass
Set the button group id.
Definition: mbutton.h:231