mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mcombobox.h
Go to the documentation of this file.
1 
42 #ifdef _MGNCSCTRL_COMBOBOX
43 
44 #ifndef _MGUI_PANEL_COMBOBOX_H
45 #define _MGUI_PANEL_COMBOBOX_H
46 
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif /* __cplusplus */
51 
61 #define NCSCTRL_COMBOBOX NCSCLASSNAME("combobox")
62 
63 typedef struct _mCombobox mCombobox;
64 typedef struct _mComboboxClass mComboboxClass;
65 typedef struct _mComboboxRenderer mComboboxRenderer;
66 
67 #define mComboboxHeader(clsName) \
68  mPanelHeader(clsName) \
69  mListBox *listbox; \
70  mSlEdit *edit; \
71  RECT rcList; \
72  RECT rcEdit; \
73  RECT rcBtn; \
74  unsigned int flag; \
75  int dropWidth;
76 
98 struct _mCombobox
99 {
100  mComboboxHeader(mCombobox)
101 };
102 
103 #define mComboboxClassHeader(clsName, parentClass) \
104  mPanelClassHeader(clsName, parentClass) \
105  BOOL (*addItem)(clsName *self, const char *item, DWORD addData); \
106  BOOL (*removeItem)(clsName *self, int index); \
107  BOOL (*setItem)(clsName *self, int index, const char *item); \
108  const char* (*getItem)(clsName *self, int index); \
109  void (*setAddData)(clsName *self, int index, DWORD addData); \
110  DWORD (*getAddData)(clsName *self, int index);
111 
137 struct _mComboboxClass
138 {
139  mComboboxClassHeader(mCombobox, mPanel)
140 };
141 
142 MGNCS_EXPORT extern mComboboxClass g_stmComboboxCls;
143 
144 #define mComboboxRendererHeader(clsName, parentClass) \
145  mPanelRendererHeader(clsName, parentClass) \
146  void (*drawDropDownBtn)(clsName* self, HDC, const RECT*);
147 
160 struct _mComboboxRenderer {
161  mComboboxRendererHeader(mCombobox, mPanel)
162 };
163 
168 enum mComboboxProp {
174  NCSP_COMB_ITEMHEIGHT = NCSP_LSTBOX_ITEMHEIGHT,
180  NCSP_COMB_ITEMCOUNT = NCSP_LSTBOX_ITEMCOUNT,
187  NCSP_COMB_DROPDOWNHEIGHT = NCSP_PANEL_MAX + 1,
194  NCSP_COMB_TEXTLIMIT,
201  NCSP_COMB_SELECT,
202  NCSP_COMB_MAX
203 };
204 
205 
210 #define NCSS_CMBOX_SIMPLE 0x0000L
211 
216 #define NCSS_CMBOX_DROPDOWNLIST (0x0001L<<NCSS_PANEL_SHIFT)
217 
222 #define NCSS_CMBOX_SORT (0x0002L<<NCSS_PANEL_SHIFT)
223 
228 #define NCSS_CMBOX_EDITNOBORDER (0x0004L<<NCSS_PANEL_SHIFT)
229 
234 #define NCSS_CMBOX_EDITBASELINE (0x0008L<<NCSS_PANEL_SHIFT)
235 
240 #define NCSS_CMBOX_READONLY (0x0010L<<NCSS_PANEL_SHIFT)
241 
246 #define NCSS_CMBOX_UPPERCASE (0x0020L<<NCSS_PANEL_SHIFT)
247 
252 #define NCSS_CMBOX_LOWERCASE (0x0040L<<NCSS_PANEL_SHIFT)
253 
258 #define NCSS_CMBOX_AUTOFOCUS (0x0080L<<NCSS_PANEL_SHIFT)
259 
260 #define NCSS_CMBOX_SHIFT (NCSS_PANEL_SHIFT + 9)
261 
262 
264 enum enumComboboxNotify {
265  NCSN_CMBOX_SELCHANGE = NCSN_PANEL_MAX + 1,
266  NCSN_CMBOX_SETFOCUS,
267  NCSN_CMBOX_KILLFOCUS,
268  NCSN_CMBOX_EDITCHANGE,
269  NCSN_CMBOX_DROPDOWN,
270  NCSN_CMBOX_CLOSEUP,
271  NCSN_CMBOX_SELECTOK,
272  NCSN_CMBOX_SELECTCANCEL,
273  NCSN_CMBOX_MAX
274 };
275 
276 
280 
281 #define NCSF_CMBOX_BUTTONDOWN 0x0001
282 #define NCSF_CMBOX_BUTTONUP 0x0002
283 #define NCSF_CMBOX_DROPPED 0x0004
284 #define NCSF_CMBOX_HILIGHT 0x0008
285 
286 #define SET_STATE(lp, mask) (lp->flag |= (mask))
287 #define CLEAR_STATE(lp, mask) (lp->flag &= ~(mask))
288 #define IS_SET(lp, mask) (lp->flag & (mask))
289 
292 #ifdef __cplusplus
293 }
294 #endif /* __cplusplus */
295 
296 #endif /* _MGUI_PANEL_COMBOBOX_H */
297 #endif //_MGNCSCTRL_COMBOBOX
The structure of mPanel control, which derived from mWidget. It is a control which is capable of cont...