mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mmainwnd.h
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 /*
14  * \file mmainwnd.h
15  * \author dongjunjie
16  * \date 2009/01/01
17  *
18  * This file include the main window defines
19  *
20  \verbatim
21 
22  This file is part of mGNCS, a component for MiniGUI.
23 
24  Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
25 
26  This program is free software: you can redistribute it and/or modify
27  it under the terms of the GNU General Public License as published by
28  the Free Software Foundation, either version 3 of the License, or
29  (at your option) any later version.
30 
31  This program is distributed in the hope that it will be useful,
32  but WITHOUT ANY WARRANTY; without even the implied warranty of
33  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  GNU General Public License for more details.
35 
36  You should have received a copy of the GNU General Public License
37  along with this program. If not, see <http://www.gnu.org/licenses/>.
38 
39  Or,
40 
41  As this program is a library, any link to this program must follow
42  GNU General Public License version 3 (GPLv3). If you cannot accept
43  GPLv3, you need to be licensed from FMSoft.
44 
45  If you have got a commercial license of this program, please use it
46  under the terms and conditions of the commercial license.
47 
48  For more information about the commercial license, please refer to
49  <http://www.minigui.com/blog/minigui-licensing-policy/>.
50 
51  \endverbatim
52  */
53 
54 #ifndef _MGUI_CTRL_MNWND_H
55 #define _MGUI_CTRL_MNWND_H
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
70 #define NCSCTRL_MAINWND NCSCLASSNAME("mainwnd")
71 
72 typedef struct _mMainWnd mMainWnd;
73 typedef struct _mMainWndClass mMainWndClass;
74 typedef struct _mMainWndRenderer mMainWndRenderer;
75 
76 /*define mMainWndRender */
77 #define mMainWndRendererHeader(clsName, parentClass) \
78  mPanelRendererHeader(clsName, parentClass)
79 
87 struct _mMainWndRenderer
88 {
89  mMainWndRendererHeader(mMainWnd, mPanel)
90 };
91 
92 /* define mMainWnd */
93 #define mMainWndHeader(className) \
94  mPanelHeader(className) \
95  mComponent* parentCmp; \
96  mComponent* nextCmp, *prevCmp;
97 
104 struct _mMainWnd {
105  mMainWndHeader(mMainWnd)
106 };
107 
108 #define MSG_MNWND_ENDDIALOG MSG_LASTUSERMSG + 4
109 //lParam is exit code
110 //wParam is the special flag, used by interal
111 
112 /* define mMainWndClass */
113 #define mMainWndClassHeader(clsName, parentClass) \
114  mPanelClassHeader(clsName, parentClass) \
115  DWORD (*doModal)(clsName*,BOOL AutoDestroy); \
116  BOOL (*endDialog)(clsName*, DWORD code);
117 
132 struct _mMainWndClass
133 {
134  mMainWndClassHeader(mMainWnd, mPanel)
135 };
136 
137 #define DECLARE_MAINWND_CLASS(clss, clssSuper) \
138  typedef mMainWndRenderer clss##Renderer; \
139  DECLARE_CLASS(clss, clssSuper)
140 
141 #define NCS_MAINWND_ISMODE(obj) (INSTANCEOF(obj, mMainWnd) && (GetWindowStyle(obj->hwnd) & NCSS_MNWND_MODE))
142 
146 MGNCS_EXPORT extern mMainWndClass g_stmMainWndCls; //Class(mMainWnd);
147 
148 enum enumMainWndProp {
149  NCSP_MNWND_MAX = NCSP_PANEL_MAX + 1
150 };
151 
158 #define NCSS_MNWND_MODE (1<<NCSS_PANEL_SHIFT)
159 #define NCSS_MNWND_SHIFT (NCSS_PANEL_SHIFT+1)
160 enum enumMainWndNotify{
161  NCSN_MNWND_MAX = NCSN_PANEL_MAX + 1
162 };
163 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif
171 
g_stmMainWndCls
MGNCS_EXPORT mMainWndClass g_stmMainWndCls
the singleton of mMainWndClass
mMainWnd
define the memders of mMainWnd, inherit from mPanel
NCSN_PANEL_MAX
@ NCSN_PANEL_MAX
Definition: mpanel.h:149
NCSP_PANEL_MAX
@ NCSP_PANEL_MAX
Definition: mpanel.h:132
mMainWndClass
the VTable of mMainWnd, inherit from mPanelClass
mMainWndRenderer
the mMainWnd renderer interface, inherit from mPanelRenderer
mPanel
The structure of mPanel control, which derived from mWidget. It is a control which is capable of cont...