mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mmainwnd.h
1 /*
2  * \file mmainwnd.h
3  * \author dongjunjie
4  * \date 2009/01/01
5  *
6  * This file include the main window defines
7  *
8  \verbatim
9 
10  This file is part of mGNCS, a component for MiniGUI.
11 
12  Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
13 
14  This program is free software: you can redistribute it and/or modify
15  it under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program. If not, see <http://www.gnu.org/licenses/>.
26 
27  Or,
28 
29  As this program is a library, any link to this program must follow
30  GNU General Public License version 3 (GPLv3). If you cannot accept
31  GPLv3, you need to be licensed from FMSoft.
32 
33  If you have got a commercial license of this program, please use it
34  under the terms and conditions of the commercial license.
35 
36  For more information about the commercial license, please refer to
37  <http://www.minigui.com/en/about/licensing-policy/>.
38 
39  \endverbatim
40  */
41 
42 #ifndef _MGUI_CTRL_MNWND_H
43 #define _MGUI_CTRL_MNWND_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
58 #define NCSCTRL_MAINWND NCSCLASSNAME("mainwnd")
59 
60 typedef struct _mMainWnd mMainWnd;
61 typedef struct _mMainWndClass mMainWndClass;
62 typedef struct _mMainWndRenderer mMainWndRenderer;
63 
64 /*define mMainWndRender */
65 #define mMainWndRendererHeader(clsName, parentClass) \
66  mPanelRendererHeader(clsName, parentClass)
67 
75 struct _mMainWndRenderer
76 {
77  mMainWndRendererHeader(mMainWnd, mPanel)
78 };
79 
80 /* define mMainWnd */
81 #define mMainWndHeader(className) \
82  mPanelHeader(className) \
83  mComponent* parentCmp; \
84  mComponent* nextCmp, *prevCmp;
85 
92 struct _mMainWnd {
93  mMainWndHeader(mMainWnd)
94 };
95 
96 #define MSG_MNWND_ENDDIALOG MSG_LASTUSERMSG + 4
97 //lParam is exit code
98 //wParam is the special flag, used by interal
99 
100 /* define mMainWndClass */
101 #define mMainWndClassHeader(clsName, parentClass) \
102  mPanelClassHeader(clsName, parentClass) \
103  DWORD (*doModal)(clsName*,BOOL AutoDestroy); \
104  BOOL (*endDialog)(clsName*, DWORD code);
105 
120 struct _mMainWndClass
121 {
122  mMainWndClassHeader(mMainWnd, mPanel)
123 };
124 
125 #define DECLARE_MAINWND_CLASS(clss, clssSuper) \
126  typedef mMainWndRenderer clss##Renderer; \
127  DECLARE_CLASS(clss, clssSuper)
128 
129 #define NCS_MAINWND_ISMODE(obj) (INSTANCEOF(obj, mMainWnd) && (GetWindowStyle(obj->hwnd) & NCSS_MNWND_MODE))
130 
134 MGNCS_EXPORT extern mMainWndClass g_stmMainWndCls; //Class(mMainWnd);
135 
136 enum enumMainWndProp {
137  NCSP_MNWND_MAX = NCSP_PANEL_MAX + 1
138 };
139 
146 #define NCSS_MNWND_MODE (1<<NCSS_PANEL_SHIFT)
147 #define NCSS_MNWND_SHIFT (NCSS_PANEL_SHIFT+1)
148 enum enumMainWndNotify{
149  NCSN_MNWND_MAX = NCSN_PANEL_MAX + 1
150 };
151 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif
159 
define the memders of mMainWnd, inherit from mPanel
the VTable of mMainWnd, inherit from mPanelClass
MGNCS_EXPORT mMainWndClass g_stmMainWndCls
the singleton of mMainWndClass
the mMainWnd renderer interface, inherit from mPanelRenderer
The structure of mPanel control, which derived from mWidget. It is a control which is capable of cont...