mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mbuttongroup.h
Go to the documentation of this file.
1 
42 #ifndef _MGUI_NCSCTRL_BTNGRP_H
43 #define _MGUI_NCSCTRL_BTNGRP_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48 
58 #define NCSCTRL_BUTTONGROUP NCSCLASSNAME("buttongroup")
59 
60 typedef struct _mButtonGroup mButtonGroup;
61 typedef struct _mButtonGroupClass mButtonGroupClass;
62 typedef struct _mButtonGroupRenderer mButtonGroupRenderer;
63 
64 typedef struct _mButtonNode mButtonNode;
76 {
77  mWidget *pbtn;
78  mButtonNode *next;
79 };
80 
81 #define mButtonGroupHeader(clsName) \
82  mGroupBoxHeader(clsName) \
83  mButtonNode *pBtnList;
84 
93 struct _mButtonGroup
94 {
95  mButtonGroupHeader(mButtonGroup)
96 };
97 
98 #define mButtonGroupClassHeader(clsName, parentClass) \
99  mGroupBoxClassHeader(clsName, parentClass) \
100 /*private*/ \
101  BOOL (*addButton)(clsName *group, mWidget *button); \
102  BOOL (*checkBtn)(clsName *group, mWidget *btn_to_check);
103 
122 struct _mButtonGroupClass
123 {
124  mButtonGroupClassHeader(mButtonGroup, mGroupBox)
125 };
126 
127 #define mButtonGroupRendererHeader(clsName, parentClass) \
128  mGroupBoxRendererHeader(clsName, parentClass) \
129  void (*drawButtongroup)(clsName *self, HDC, const RECT*);
130 
142 /* define the render of image static */
143 struct _mButtonGroupRenderer {
144  mButtonGroupRendererHeader(mButtonGroup, mGroupBox)
145 };
146 
151 MGNCS_EXPORT extern mButtonGroupClass g_stmButtonGroupCls;
152 
165  NCSP_BTNGRP_SELID = NCSP_GRPBOX_MAX + 1,
183  NCSP_BTNGRP_MAX
184 };
185 
186 #define NCSS_BTNGRP_SHIFT NCSS_GRPBOX_SHIFT
187 
199  NCSN_BTNGRP_SELCHANGED = NCSN_GRPBOX_MAX + 1,
200  NCSN_BTNGRP_MAX
201 };
202 
206 #ifdef __cplusplus
207 }
208 #endif /* __cplusplus */
209 
210 #endif /* _MGUI_NCSCTRL_BTNGRP_H */
211 
struct of mButtonGroupClass control, derived from mGroupBoxClass
groupbox class, derived from mStatic
define the mWidget members, inherit from mComponent
enumButtonGroupNotify
notification code of mButtonGroup
Definition: mbuttongroup.h:192
set/get selected object
Definition: mbuttongroup.h:182
mButtonGroup renderer interface, derived from mGroupBoxRenderer
the list node include member button
Definition: mbuttongroup.h:75
set/set selected index
Definition: mbuttongroup.h:174
MGNCS_EXPORT mButtonGroupClass g_stmButtonGroupCls
global mButtonGroupClass
mButtonGroupProp
properties of mButtonGroup
Definition: mbuttongroup.h:157
get/set selected id of button
Definition: mbuttongroup.h:165
raised when the current button changed
Definition: mbuttongroup.h:199
A group control, mamanger a list of buttons, in which only one button can be selected. Derived from mGroupBox.