Nuvoton / Mbed OS NuMaker-mbed-emWin-example
Committer:
SHLIU1@OANBE02333.nuvoton.com
Date:
Thu Feb 25 15:40:31 2021 +0800
Revision:
4:3d28c66231b0
Parent:
1:c0f972361605
Support the both V5.X and V6.X for mbed-os

Who changed what in which revision?

UserRevisionLine numberNew contents of line
csyang2 1:c0f972361605 1 /*********************************************************************
csyang2 1:c0f972361605 2 * SEGGER Software GmbH *
csyang2 1:c0f972361605 3 * Solutions for real time microcontroller applications *
csyang2 1:c0f972361605 4 **********************************************************************
csyang2 1:c0f972361605 5 * *
csyang2 1:c0f972361605 6 * (c) 1996 - 2018 SEGGER Microcontroller GmbH *
csyang2 1:c0f972361605 7 * *
csyang2 1:c0f972361605 8 * Internet: www.segger.com Support: support@segger.com *
csyang2 1:c0f972361605 9 * *
csyang2 1:c0f972361605 10 **********************************************************************
csyang2 1:c0f972361605 11
csyang2 1:c0f972361605 12 ** emWin V5.48 - Graphical user interface for embedded applications **
csyang2 1:c0f972361605 13 All Intellectual Property rights in the Software belongs to SEGGER.
csyang2 1:c0f972361605 14 emWin is protected by international copyright laws. Knowledge of the
csyang2 1:c0f972361605 15 source code may not be used to write a similar product. This file may
csyang2 1:c0f972361605 16 only be used in accordance with the following terms:
csyang2 1:c0f972361605 17
csyang2 1:c0f972361605 18 The software has been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
csyang2 1:c0f972361605 19 for the purposes of creating libraries for its
csyang2 1:c0f972361605 20 Arm Cortex-M and Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
csyang2 1:c0f972361605 21 under the terms and conditions of an End User
csyang2 1:c0f972361605 22 License Agreement supplied with the libraries.
csyang2 1:c0f972361605 23 Full source code is available at: www.segger.com
csyang2 1:c0f972361605 24
csyang2 1:c0f972361605 25 We appreciate your understanding and fairness.
csyang2 1:c0f972361605 26 ----------------------------------------------------------------------
csyang2 1:c0f972361605 27 Licensing information
csyang2 1:c0f972361605 28 Licensor: SEGGER Software GmbH
csyang2 1:c0f972361605 29 Licensed to: Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
csyang2 1:c0f972361605 30 Licensed SEGGER software: emWin
csyang2 1:c0f972361605 31 License number: GUI-00735
csyang2 1:c0f972361605 32 License model: emWin License Agreement, signed February 27, 2018
csyang2 1:c0f972361605 33 Licensed platform: Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
csyang2 1:c0f972361605 34 ----------------------------------------------------------------------
csyang2 1:c0f972361605 35 Support and Update Agreement (SUA)
csyang2 1:c0f972361605 36 SUA period: 2018-03-26 - 2019-03-27
csyang2 1:c0f972361605 37 Contact to extend SUA: sales@segger.com
csyang2 1:c0f972361605 38 ----------------------------------------------------------------------
csyang2 1:c0f972361605 39 File : DROPDOWN.h
csyang2 1:c0f972361605 40 Purpose : Multiple choice object include
csyang2 1:c0f972361605 41 --------------------END-OF-HEADER-------------------------------------
csyang2 1:c0f972361605 42 */
csyang2 1:c0f972361605 43
csyang2 1:c0f972361605 44 #ifndef DROPDOWN_H
csyang2 1:c0f972361605 45 #define DROPDOWN_H
csyang2 1:c0f972361605 46
csyang2 1:c0f972361605 47 #include "WM.h"
csyang2 1:c0f972361605 48 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
csyang2 1:c0f972361605 49 #include "LISTBOX.h"
csyang2 1:c0f972361605 50
csyang2 1:c0f972361605 51 #if GUI_WINSUPPORT
csyang2 1:c0f972361605 52
csyang2 1:c0f972361605 53 #if defined(__cplusplus)
csyang2 1:c0f972361605 54 extern "C" { /* Make sure we have C-declarations in C++ programs */
csyang2 1:c0f972361605 55 #endif
csyang2 1:c0f972361605 56
csyang2 1:c0f972361605 57 /************************************************************
csyang2 1:c0f972361605 58 *
csyang2 1:c0f972361605 59 * Create flags
csyang2 1:c0f972361605 60 */
csyang2 1:c0f972361605 61 #define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0)
csyang2 1:c0f972361605 62 #define DROPDOWN_CF_UP (1 << 1)
csyang2 1:c0f972361605 63
csyang2 1:c0f972361605 64 /*********************************************************************
csyang2 1:c0f972361605 65 *
csyang2 1:c0f972361605 66 * Color indices
csyang2 1:c0f972361605 67 */
csyang2 1:c0f972361605 68 #define DROPDOWN_CI_UNSEL 0
csyang2 1:c0f972361605 69 #define DROPDOWN_CI_SEL 1
csyang2 1:c0f972361605 70 #define DROPDOWN_CI_SELFOCUS 2
csyang2 1:c0f972361605 71
csyang2 1:c0f972361605 72 #define DROPDOWN_CI_ARROW 0
csyang2 1:c0f972361605 73 #define DROPDOWN_CI_BUTTON 1
csyang2 1:c0f972361605 74
csyang2 1:c0f972361605 75 /*********************************************************************
csyang2 1:c0f972361605 76 *
csyang2 1:c0f972361605 77 * Skinning property indices
csyang2 1:c0f972361605 78 */
csyang2 1:c0f972361605 79 #define DROPDOWN_SKINFLEX_PI_EXPANDED 0
csyang2 1:c0f972361605 80 #define DROPDOWN_SKINFLEX_PI_FOCUSED 1
csyang2 1:c0f972361605 81 #define DROPDOWN_SKINFLEX_PI_ENABLED 2
csyang2 1:c0f972361605 82 #define DROPDOWN_SKINFLEX_PI_DISABLED 3
csyang2 1:c0f972361605 83
csyang2 1:c0f972361605 84 /*********************************************************************
csyang2 1:c0f972361605 85 *
csyang2 1:c0f972361605 86 * Types
csyang2 1:c0f972361605 87 *
csyang2 1:c0f972361605 88 **********************************************************************
csyang2 1:c0f972361605 89 */
csyang2 1:c0f972361605 90 typedef WM_HMEM DROPDOWN_Handle;
csyang2 1:c0f972361605 91
csyang2 1:c0f972361605 92 typedef struct {
csyang2 1:c0f972361605 93 GUI_COLOR aColorFrame[3];
csyang2 1:c0f972361605 94 GUI_COLOR aColorUpper[2];
csyang2 1:c0f972361605 95 GUI_COLOR aColorLower[2];
csyang2 1:c0f972361605 96 GUI_COLOR ColorArrow;
csyang2 1:c0f972361605 97 GUI_COLOR ColorText;
csyang2 1:c0f972361605 98 GUI_COLOR ColorSep;
csyang2 1:c0f972361605 99 int Radius;
csyang2 1:c0f972361605 100 } DROPDOWN_SKINFLEX_PROPS;
csyang2 1:c0f972361605 101
csyang2 1:c0f972361605 102 /*********************************************************************
csyang2 1:c0f972361605 103 *
csyang2 1:c0f972361605 104 * Create functions
csyang2 1:c0f972361605 105 *
csyang2 1:c0f972361605 106 **********************************************************************
csyang2 1:c0f972361605 107 */
csyang2 1:c0f972361605 108 DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
csyang2 1:c0f972361605 109 DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
csyang2 1:c0f972361605 110 DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
csyang2 1:c0f972361605 111 DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb);
csyang2 1:c0f972361605 112
csyang2 1:c0f972361605 113 /*********************************************************************
csyang2 1:c0f972361605 114 *
csyang2 1:c0f972361605 115 * The callback ...
csyang2 1:c0f972361605 116 *
csyang2 1:c0f972361605 117 * Do not call it directly ! It is only to be used from within an
csyang2 1:c0f972361605 118 * overwritten callback.
csyang2 1:c0f972361605 119 */
csyang2 1:c0f972361605 120 void DROPDOWN_Callback(WM_MESSAGE * pMsg);
csyang2 1:c0f972361605 121
csyang2 1:c0f972361605 122 /*********************************************************************
csyang2 1:c0f972361605 123 *
csyang2 1:c0f972361605 124 * Member functions
csyang2 1:c0f972361605 125 *
csyang2 1:c0f972361605 126 **********************************************************************
csyang2 1:c0f972361605 127 */
csyang2 1:c0f972361605 128 void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key);
csyang2 1:c0f972361605 129 void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s);
csyang2 1:c0f972361605 130 void DROPDOWN_Collapse (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 131 void DROPDOWN_DecSel (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 132 void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 133 void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index);
csyang2 1:c0f972361605 134 void DROPDOWN_Expand (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 135 GUI_COLOR DROPDOWN_GetBkColor (DROPDOWN_Handle hObj, unsigned int Index);
csyang2 1:c0f972361605 136 GUI_COLOR DROPDOWN_GetColor (DROPDOWN_Handle hObj, unsigned int Index);
csyang2 1:c0f972361605 137 const GUI_FONT * DROPDOWN_GetFont (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 138 unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index);
csyang2 1:c0f972361605 139 unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 140 int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
csyang2 1:c0f972361605 141 LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 142 int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 143 int DROPDOWN_GetSel (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 144 int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 145 GUI_COLOR DROPDOWN_GetTextColor (DROPDOWN_Handle hObj, unsigned int Index);
csyang2 1:c0f972361605 146 int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes);
csyang2 1:c0f972361605 147 void DROPDOWN_IncSel (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 148 void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 149 void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index);
csyang2 1:c0f972361605 150 void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff);
csyang2 1:c0f972361605 151 void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color);
csyang2 1:c0f972361605 152 void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color);
csyang2 1:c0f972361605 153 void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont);
csyang2 1:c0f972361605 154 void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff);
csyang2 1:c0f972361605 155 void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value);
csyang2 1:c0f972361605 156 int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height);
csyang2 1:c0f972361605 157 void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color);
csyang2 1:c0f972361605 158 void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width);
csyang2 1:c0f972361605 159 void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel);
csyang2 1:c0f972361605 160 void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel);
csyang2 1:c0f972361605 161 void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align);
csyang2 1:c0f972361605 162 void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color);
csyang2 1:c0f972361605 163 void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight);
csyang2 1:c0f972361605 164 int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff);
csyang2 1:c0f972361605 165 int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes);
csyang2 1:c0f972361605 166
csyang2 1:c0f972361605 167 /*********************************************************************
csyang2 1:c0f972361605 168 *
csyang2 1:c0f972361605 169 * Member functions: Skinning
csyang2 1:c0f972361605 170 *
csyang2 1:c0f972361605 171 **********************************************************************
csyang2 1:c0f972361605 172 */
csyang2 1:c0f972361605 173 void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
csyang2 1:c0f972361605 174 void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj);
csyang2 1:c0f972361605 175 void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
csyang2 1:c0f972361605 176 int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
csyang2 1:c0f972361605 177 void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
csyang2 1:c0f972361605 178 void DROPDOWN_SetDefaultSkinClassic(void);
csyang2 1:c0f972361605 179 WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
csyang2 1:c0f972361605 180
csyang2 1:c0f972361605 181 #define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex
csyang2 1:c0f972361605 182
csyang2 1:c0f972361605 183 /*********************************************************************
csyang2 1:c0f972361605 184 *
csyang2 1:c0f972361605 185 * Managing default values
csyang2 1:c0f972361605 186 *
csyang2 1:c0f972361605 187 **********************************************************************
csyang2 1:c0f972361605 188 */
csyang2 1:c0f972361605 189 GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index);
csyang2 1:c0f972361605 190 GUI_COLOR DROPDOWN_GetDefaultColor (int Index);
csyang2 1:c0f972361605 191 const GUI_FONT * DROPDOWN_GetDefaultFont (void);
csyang2 1:c0f972361605 192 GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index);
csyang2 1:c0f972361605 193 void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont);
csyang2 1:c0f972361605 194 GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color);
csyang2 1:c0f972361605 195 GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color);
csyang2 1:c0f972361605 196 GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color);
csyang2 1:c0f972361605 197
csyang2 1:c0f972361605 198 #if defined(__cplusplus)
csyang2 1:c0f972361605 199 }
csyang2 1:c0f972361605 200 #endif
csyang2 1:c0f972361605 201
csyang2 1:c0f972361605 202 #endif // GUI_WINSUPPORT
csyang2 1:c0f972361605 203 #endif // DROPDOWN_H
csyang2 1:c0f972361605 204
csyang2 1:c0f972361605 205 /*************************** End of file ****************************/