RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MENU_Private.h Source File

MENU_Private.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights  in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product.  This file may
00016 only be used in accordance with the following terms:
00017 
00018 The software has been licensed to  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP End User License
00023 Agreement.
00024 Full source code is available at: www.segger.com
00025 
00026 We appreciate your understanding and fairness.
00027 ----------------------------------------------------------------------
00028 Licensing information
00029 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : MENU_Private.h
00040 Purpose     : Internal header file
00041 ---------------------------END-OF-HEADER------------------------------
00042 */
00043 
00044 #ifndef MENU_PRIVATE_H
00045 #define MENU_PRIVATE_H
00046 
00047 #include "WIDGET.h"
00048 #include "MENU.h"
00049 #include "GUI_ARRAY.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 /*********************************************************************
00054 *
00055 *       Defines
00056 *
00057 **********************************************************************
00058 */
00059 /*********************************************************************
00060 *
00061 *       Status flags
00062 */
00063 #define MENU_SF_HORIZONTAL              MENU_CF_HORIZONTAL
00064 #define MENU_SF_VERTICAL                MENU_CF_VERTICAL
00065 #define MENU_SF_OPEN_ON_POINTEROVER     MENU_CF_OPEN_ON_POINTEROVER
00066 #define MENU_SF_CLOSE_ON_SECOND_CLICK   MENU_CF_CLOSE_ON_SECOND_CLICK
00067 #define MENU_SF_HIDE_DISABLED_SEL       MENU_CF_HIDE_DISABLED_SEL
00068 
00069 #define MENU_SF_ACTIVE                  (1 << 6)  // Internal flag only
00070 #define MENU_SF_POPUP                   (1 << 7)  // Internal flag only
00071 #define MENU_SF_ARROW                   (1 << 8)  // Internal flag only
00072 
00073 /*********************************************************************
00074 *
00075 *       Types
00076 *
00077 **********************************************************************
00078 */
00079 //
00080 // MENU_SKIN_PRIVATE
00081 //
00082 typedef struct {
00083   WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
00084 } MENU_SKIN_PRIVATE;
00085 
00086 //
00087 // MENU_ITEM
00088 //
00089 typedef struct {
00090   MENU_Handle hSubmenu;
00091   U16         Id;
00092   U16         Flags;
00093   int         TextWidth;
00094   char        acText[1];
00095 } MENU_ITEM;
00096 
00097 //
00098 // MENU_PROPS
00099 //
00100 typedef struct {
00101   GUI_COLOR           aTextColor[5];
00102   GUI_COLOR           aBkColor[5];
00103   U8                  aBorder[4];
00104   const GUI_FONT    * pFont;
00105   MENU_SKIN_PRIVATE   SkinPrivate;
00106 } MENU_PROPS;
00107 
00108 //
00109 // MENU_Obj
00110 //
00111 typedef struct {
00112   WIDGET              Widget;
00113   MENU_PROPS          Props;
00114   GUI_ARRAY           ItemArray;
00115   WM_HWIN             hOwner;
00116   U16                 Flags;
00117   char                IsSubmenuActive;
00118   int                 Width;
00119   int                 Height;
00120   int                 Sel;
00121   unsigned            ArrowAreaWidth;
00122   WIDGET_SKIN const * pWidgetSkin;
00123 } MENU_Obj;
00124 
00125 /*********************************************************************
00126 *
00127 *       Macros for internal use
00128 *
00129 **********************************************************************
00130 */
00131 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00132   #define MENU_INIT_ID(pObj)  (pObj->Widget.DebugId = MENU_ID)
00133 #else
00134   #define MENU_INIT_ID(pObj)
00135 #endif
00136 
00137 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00138   MENU_Obj * MENU_LockH(MENU_Handle hObj);
00139   #define MENU_LOCK_H(hObj)   MENU_LockH(hObj)
00140 #else
00141   #define MENU_LOCK_H(hObj)   (MENU_Obj *)GUI_LOCK_H(hObj)
00142 #endif
00143 
00144 /*********************************************************************
00145 *
00146 *       Public data (internal defaults)
00147 *
00148 **********************************************************************
00149 */
00150 
00151 extern MENU_PROPS            MENU__DefaultProps;
00152 extern const WIDGET_EFFECT * MENU__pDefaultEffect;
00153 
00154 extern const WIDGET_SKIN     MENU__SkinClassic;
00155 extern       WIDGET_SKIN     MENU__Skin;
00156 
00157 extern WIDGET_SKIN const   * MENU__pSkinDefault;
00158 
00159 /*********************************************************************
00160 *
00161 *       Private functions
00162 *
00163 **********************************************************************
00164 */
00165 int       MENU__CalcMenuSizeX         (MENU_Handle hObj);
00166 int       MENU__CalcMenuSizeY         (MENU_Handle hObj);
00167 int       MENU__FindItem              (MENU_Handle hObj, U16 ItemId, MENU_Handle* phMenu);
00168 int       MENU__GetEffectSize         (MENU_Handle hObj);
00169 int       MENU__GetItemHeight         (MENU_Handle hObj, unsigned Index);
00170 int       MENU__GetItemWidth          (MENU_Handle hObj, unsigned Index);
00171 unsigned  MENU__GetNumItems           (MENU_Obj * pObj);
00172 int       MENU__HasEffect             (MENU_Handle hObj, MENU_Obj * pObj);
00173 void      MENU__InvalidateItem        (MENU_Handle hObj, unsigned Index);
00174 void      MENU__RecalcTextWidthOfItems(MENU_Obj * pObj);
00175 void      MENU__ResizeMenu            (MENU_Handle hObj);
00176 int       MENU__SendMenuMessage       (MENU_Handle hObj, WM_HWIN hDestWin, U16 MsgType, U16 ItemId);
00177 char      MENU__SetItem               (MENU_Handle hObj, unsigned Index, const MENU_ITEM_DATA* pItemData);
00178 void      MENU__SetItemFlags          (MENU_Obj * pObj, unsigned Index, U16 Mask, U16 Flags);
00179 
00180 #endif  // GUI_WINSUPPORT
00181 #endif  // MENU_PRIVATE_H
00182 
00183 /*************************** End of file ****************************/