mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mnavigationbarpiece.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
15  * \author FMSoft
16  * \date
17  *
18  \verbatim
19 
20  This file is part of mGNCS4Touch, one of MiniGUI components.
21 
22  Copyright (C) 2008-2018 FMSoft (http://www.fmsoft.cn).
23 
24  This program is free software: you can redistribute it and/or modify
25  it under the terms of the GNU General Public License as published by
26  the Free Software Foundation, either version 3 of the License, or
27  (at your option) any later version.
28 
29  This program is distributed in the hope that it will be useful,
30  but WITHOUT ANY WARRANTY; without even the implied warranty of
31  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32  GNU General Public License for more details.
33 
34  You should have received a copy of the GNU General Public License
35  along with this program. If not, see <http://www.gnu.org/licenses/>.
36 
37  Or,
38 
39  As this program is a library, any link to this program must follow
40  GNU General Public License version 3 (GPLv3). If you cannot accept
41  GPLv3, you need to be licensed from FMSoft.
42 
43  If you have got a commercial license of this program, please use it
44  under the terms and conditions of the commercial license.
45 
46  For more information about the commercial license, please refer to
47  <http://www.minigui.com/blog/minigui-licensing-policy/>.
48 
49  \endverbatim
50 */
51 
52 #ifndef _MGNCS_MNAVIGATION_BAR_PIECE_H
53 #define _MGNCS_MNAVIGATION_BAR_PIECE_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 typedef struct _mNavigationBarPieceClass mNavigationBarPieceClass;
60 typedef struct _mNavigationBarPiece mNavigationBarPiece;
61 
62 /* navigation bar default configure */
63 #define NAVIGATIONBAR_W (g_rcScr.right)
64 #define NAVIGATIONBAR_H 38
65 #define NAVIGATIONBAR_DEFAULT_BUTTON_H 27
66 #define NAVIGATIONBAR_HORIZONAL_W 8
67 #define NAVIGATIONBAR_BUTTON_DX 10
68 #define NAVIGATIONBAR_NORMALBUTTON_COLOR1 0xffffffff
69 #define NAVIGATIONBAR_NORMALBUTTON_COLOR2 0xffd1d1d1
70 #define NAVIGATIONBAR_PUSHBUTTON_COLOR1 0xa0e2edf9
71 #define NAVIGATIONBAR_PUSHBUTTON_COLOR2 0xa0a1abb7
72 #define NAVIGATIONBAR_PUSHBUTTON_COLOR3 0xa0e2edf9
73 #define NAVIGATIONBAR_BORDER_COLOR1 0xffaaaaaa
74 #define NAVIGATIONBAR_BORDER_COLOR2 0xff888888
75 #define NAVIGATIONBAR_NORMAL_POS1 0.0
76 #define NAVIGATIONBAR_NORMAL_POS2 1.0
77 #define NAVIGATIONBAR_BORDER_POS1 0.0
78 #define NAVIGATIONBAR_BORDER_POS2 1.0
79 #define NAVIGATIONBAR_BORDER_SIZE 1
80 #define NAVIGATIONBAR_DEFAULT_TITLE_FONT_SIZE 20
81 #define NAVIGATIONBAR_DEFAULT_BUTTON_FONT_SIZE 16
82 #define NAVIGATIONBAR_DEFAULT_ROUND_RADIUS 4
83 #define NAVIGATIONBAR_DEFAULT_SHARPWIDTH 10
84 #define NAVIGATIONBAR_DEFAULT_FONT_COLOR 0xff192952
85 #define NAVIGATIONBAR_DEFAULT_FONT_SHADOW_COLOR 0x66ffffff
86 #define NAVIGATIONBAR_DEFAULT_BUTTON_COLOR 0xffe6e6e6
87 #define NAVIGATIONBAR_DEFAULT_BUTTON_Y ((NAVIGATIONBAR_H - NAVIGATIONBAR_DEFAULT_BUTTON_H)/2)
88 #define NAVIGATIONBAR_TITLE_X(w) (NAVIGATIONBAR_W/2 - (w)/2)
89 #define NAVIGATIONBAR_RIGHT_X(w) (NAVIGATIONBAR_W - NAVIGATIONBAR_HORIZONAL_W - (w))
90 
91 
92 /* NavigationBarPiece set and get properties */
93 #define NAVIGATIONBARPIECE_PROP_BEGIN USER_PIECE_PROP_BEGIN + 50
94 enum {
95  NCSP_NAVIGATIONBARPIECE_BACKGROUND = NAVIGATIONBARPIECE_PROP_BEGIN,
96  NCSP_NAVIGATIONBARPIECE_BKG,
97  NCSP_NAVIGATIONBARPIECE_LEFT_BUTTON,
98  NCSP_NAVIGATIONBARPIECE_TITLE_BUTTON,
99  NCSP_NAVIGATIONBARPIECE_RIGHT_BUTTON,
100 };
101 
102 
103 /* NaviagtionBarPiece methods */
104 #define mNavigationBarPieceClassHeader(clss, superCls) \
105  mPanelPieceClassHeader(clss, superCls)
106 
107 struct _mNavigationBarPieceClass
108 {
109  mNavigationBarPieceClassHeader(mNavigationBarPiece, mPanelPiece)
110 };
111 
112 MGNCS_EXPORT extern mNavigationBarPieceClass g_stmNavigationBarPieceCls;
113 
114 
115 /* NaviagtioBarPiece data members */
116 #define mNavigationBarPieceHeader(clss) \
117  mPanelPieceHeader(clss) \
118  mShapeTransRoundPiece* background; \
119  mButtonPanelPiece* left_button; \
120  mTextPiece* title_button; \
121  mButtonPanelPiece* right_button;
122 
123 struct _mNavigationBarPiece
124 {
125  mNavigationBarPieceHeader(mNavigationBarPiece)
126 };
127 
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif /*_MGNCS_MNAVIGATION_BAR_PIECE_H*/
134