![](/media/cache/group/NXP_logo_RGB_web.png.50x50_q85.jpg)
RT1050 GUI demo using emWin library
emwin/emWin_header/DROPDOWN.h@0:dd702039127a, 2018-09-20 (annotated)
- Committer:
- alejandroRL
- Date:
- Thu Sep 20 19:16:34 2018 +0000
- Revision:
- 0:dd702039127a
emWin GUI Demo for RT1050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alejandroRL | 0:dd702039127a | 1 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 3 | * Solutions for real time microcontroller applications * |
alejandroRL | 0:dd702039127a | 4 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 5 | * * |
alejandroRL | 0:dd702039127a | 6 | * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 7 | * * |
alejandroRL | 0:dd702039127a | 8 | * Internet: www.segger.com Support: support@segger.com * |
alejandroRL | 0:dd702039127a | 9 | * * |
alejandroRL | 0:dd702039127a | 10 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 11 | |
alejandroRL | 0:dd702039127a | 12 | ** emWin V5.38 - Graphical user interface for embedded applications ** |
alejandroRL | 0:dd702039127a | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
alejandroRL | 0:dd702039127a | 14 | emWin is protected by international copyright laws. Knowledge of the |
alejandroRL | 0:dd702039127a | 15 | source code may not be used to write a similar product. This file may |
alejandroRL | 0:dd702039127a | 16 | only be used in accordance with the following terms: |
alejandroRL | 0:dd702039127a | 17 | |
alejandroRL | 0:dd702039127a | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
alejandroRL | 0:dd702039127a | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
alejandroRL | 0:dd702039127a | 20 | CA 95134, USA solely for the purposes of creating libraries for |
alejandroRL | 0:dd702039127a | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
alejandroRL | 0:dd702039127a | 22 | distributed under the terms and conditions of the NXP End User License |
alejandroRL | 0:dd702039127a | 23 | Agreement. |
alejandroRL | 0:dd702039127a | 24 | Full source code is available at: www.segger.com |
alejandroRL | 0:dd702039127a | 25 | |
alejandroRL | 0:dd702039127a | 26 | We appreciate your understanding and fairness. |
alejandroRL | 0:dd702039127a | 27 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 28 | Licensing information |
alejandroRL | 0:dd702039127a | 29 | |
alejandroRL | 0:dd702039127a | 30 | Licensor: SEGGER Microcontroller Systems LLC |
alejandroRL | 0:dd702039127a | 31 | Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA |
alejandroRL | 0:dd702039127a | 32 | Licensed SEGGER software: emWin |
alejandroRL | 0:dd702039127a | 33 | License number: GUI-00186 |
alejandroRL | 0:dd702039127a | 34 | License model: emWin License Agreement, dated August 20th 2011 |
alejandroRL | 0:dd702039127a | 35 | Licensed product: - |
alejandroRL | 0:dd702039127a | 36 | Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4 |
alejandroRL | 0:dd702039127a | 37 | Licensed number of seats: - |
alejandroRL | 0:dd702039127a | 38 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 39 | File : DROPDOWN.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : Multiple choice object include |
alejandroRL | 0:dd702039127a | 41 | --------------------END-OF-HEADER------------------------------------- |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #ifndef DROPDOWN_H |
alejandroRL | 0:dd702039127a | 45 | #define DROPDOWN_H |
alejandroRL | 0:dd702039127a | 46 | |
alejandroRL | 0:dd702039127a | 47 | #include "WM.h" |
alejandroRL | 0:dd702039127a | 48 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
alejandroRL | 0:dd702039127a | 49 | #include "LISTBOX.h" |
alejandroRL | 0:dd702039127a | 50 | |
alejandroRL | 0:dd702039127a | 51 | #if GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 52 | |
alejandroRL | 0:dd702039127a | 53 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 54 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
alejandroRL | 0:dd702039127a | 55 | #endif |
alejandroRL | 0:dd702039127a | 56 | |
alejandroRL | 0:dd702039127a | 57 | /************************************************************ |
alejandroRL | 0:dd702039127a | 58 | * |
alejandroRL | 0:dd702039127a | 59 | * Create flags |
alejandroRL | 0:dd702039127a | 60 | */ |
alejandroRL | 0:dd702039127a | 61 | #define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0) |
alejandroRL | 0:dd702039127a | 62 | #define DROPDOWN_CF_UP (1 << 1) |
alejandroRL | 0:dd702039127a | 63 | |
alejandroRL | 0:dd702039127a | 64 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 65 | * |
alejandroRL | 0:dd702039127a | 66 | * Color indices |
alejandroRL | 0:dd702039127a | 67 | */ |
alejandroRL | 0:dd702039127a | 68 | #define DROPDOWN_CI_UNSEL 0 |
alejandroRL | 0:dd702039127a | 69 | #define DROPDOWN_CI_SEL 1 |
alejandroRL | 0:dd702039127a | 70 | #define DROPDOWN_CI_SELFOCUS 2 |
alejandroRL | 0:dd702039127a | 71 | |
alejandroRL | 0:dd702039127a | 72 | #define DROPDOWN_CI_ARROW 0 |
alejandroRL | 0:dd702039127a | 73 | #define DROPDOWN_CI_BUTTON 1 |
alejandroRL | 0:dd702039127a | 74 | |
alejandroRL | 0:dd702039127a | 75 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 76 | * |
alejandroRL | 0:dd702039127a | 77 | * Skinning property indices |
alejandroRL | 0:dd702039127a | 78 | */ |
alejandroRL | 0:dd702039127a | 79 | #define DROPDOWN_SKINFLEX_PI_EXPANDED 0 |
alejandroRL | 0:dd702039127a | 80 | #define DROPDOWN_SKINFLEX_PI_FOCUSSED 1 |
alejandroRL | 0:dd702039127a | 81 | #define DROPDOWN_SKINFLEX_PI_ENABLED 2 |
alejandroRL | 0:dd702039127a | 82 | #define DROPDOWN_SKINFLEX_PI_DISABLED 3 |
alejandroRL | 0:dd702039127a | 83 | |
alejandroRL | 0:dd702039127a | 84 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 85 | * |
alejandroRL | 0:dd702039127a | 86 | * Types |
alejandroRL | 0:dd702039127a | 87 | * |
alejandroRL | 0:dd702039127a | 88 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 89 | */ |
alejandroRL | 0:dd702039127a | 90 | typedef WM_HMEM DROPDOWN_Handle; |
alejandroRL | 0:dd702039127a | 91 | |
alejandroRL | 0:dd702039127a | 92 | typedef struct { |
alejandroRL | 0:dd702039127a | 93 | GUI_COLOR aColorFrame[3]; |
alejandroRL | 0:dd702039127a | 94 | GUI_COLOR aColorUpper[2]; |
alejandroRL | 0:dd702039127a | 95 | GUI_COLOR aColorLower[2]; |
alejandroRL | 0:dd702039127a | 96 | GUI_COLOR ColorArrow; |
alejandroRL | 0:dd702039127a | 97 | GUI_COLOR ColorText; |
alejandroRL | 0:dd702039127a | 98 | GUI_COLOR ColorSep; |
alejandroRL | 0:dd702039127a | 99 | int Radius; |
alejandroRL | 0:dd702039127a | 100 | } DROPDOWN_SKINFLEX_PROPS; |
alejandroRL | 0:dd702039127a | 101 | |
alejandroRL | 0:dd702039127a | 102 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 103 | * |
alejandroRL | 0:dd702039127a | 104 | * Create functions |
alejandroRL | 0:dd702039127a | 105 | * |
alejandroRL | 0:dd702039127a | 106 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 107 | */ |
alejandroRL | 0:dd702039127a | 108 | DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); |
alejandroRL | 0:dd702039127a | 109 | DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
alejandroRL | 0:dd702039127a | 110 | DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
alejandroRL | 0:dd702039127a | 111 | DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb); |
alejandroRL | 0:dd702039127a | 112 | |
alejandroRL | 0:dd702039127a | 113 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 114 | * |
alejandroRL | 0:dd702039127a | 115 | * The callback ... |
alejandroRL | 0:dd702039127a | 116 | * |
alejandroRL | 0:dd702039127a | 117 | * Do not call it directly ! It is only to be used from within an |
alejandroRL | 0:dd702039127a | 118 | * overwritten callback. |
alejandroRL | 0:dd702039127a | 119 | */ |
alejandroRL | 0:dd702039127a | 120 | void DROPDOWN_Callback(WM_MESSAGE * pMsg); |
alejandroRL | 0:dd702039127a | 121 | |
alejandroRL | 0:dd702039127a | 122 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 123 | * |
alejandroRL | 0:dd702039127a | 124 | * Member functions |
alejandroRL | 0:dd702039127a | 125 | * |
alejandroRL | 0:dd702039127a | 126 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 127 | */ |
alejandroRL | 0:dd702039127a | 128 | void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key); |
alejandroRL | 0:dd702039127a | 129 | void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s); |
alejandroRL | 0:dd702039127a | 130 | void DROPDOWN_Collapse (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 131 | void DROPDOWN_DecSel (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 132 | void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 133 | void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index); |
alejandroRL | 0:dd702039127a | 134 | void DROPDOWN_Expand (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 135 | unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 136 | unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 137 | int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); |
alejandroRL | 0:dd702039127a | 138 | LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 139 | int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 140 | int DROPDOWN_GetSel (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 141 | int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 142 | int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes); |
alejandroRL | 0:dd702039127a | 143 | void DROPDOWN_IncSel (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 144 | void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 145 | void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index); |
alejandroRL | 0:dd702039127a | 146 | void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff); |
alejandroRL | 0:dd702039127a | 147 | void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color); |
alejandroRL | 0:dd702039127a | 148 | void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 149 | void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont); |
alejandroRL | 0:dd702039127a | 150 | void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff); |
alejandroRL | 0:dd702039127a | 151 | void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 152 | int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height); |
alejandroRL | 0:dd702039127a | 153 | void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 154 | void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width); |
alejandroRL | 0:dd702039127a | 155 | void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel); |
alejandroRL | 0:dd702039127a | 156 | void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel); |
alejandroRL | 0:dd702039127a | 157 | void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align); |
alejandroRL | 0:dd702039127a | 158 | void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color); |
alejandroRL | 0:dd702039127a | 159 | void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight); |
alejandroRL | 0:dd702039127a | 160 | int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff); |
alejandroRL | 0:dd702039127a | 161 | int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes); |
alejandroRL | 0:dd702039127a | 162 | |
alejandroRL | 0:dd702039127a | 163 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 164 | * |
alejandroRL | 0:dd702039127a | 165 | * Member functions: Skinning |
alejandroRL | 0:dd702039127a | 166 | * |
alejandroRL | 0:dd702039127a | 167 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 168 | */ |
alejandroRL | 0:dd702039127a | 169 | void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index); |
alejandroRL | 0:dd702039127a | 170 | void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj); |
alejandroRL | 0:dd702039127a | 171 | void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
alejandroRL | 0:dd702039127a | 172 | int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
alejandroRL | 0:dd702039127a | 173 | void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index); |
alejandroRL | 0:dd702039127a | 174 | void DROPDOWN_SetDefaultSkinClassic(void); |
alejandroRL | 0:dd702039127a | 175 | WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
alejandroRL | 0:dd702039127a | 176 | |
alejandroRL | 0:dd702039127a | 177 | #define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex |
alejandroRL | 0:dd702039127a | 178 | |
alejandroRL | 0:dd702039127a | 179 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 180 | * |
alejandroRL | 0:dd702039127a | 181 | * Managing default values |
alejandroRL | 0:dd702039127a | 182 | * |
alejandroRL | 0:dd702039127a | 183 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 184 | */ |
alejandroRL | 0:dd702039127a | 185 | GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index); |
alejandroRL | 0:dd702039127a | 186 | GUI_COLOR DROPDOWN_GetDefaultColor (int Index); |
alejandroRL | 0:dd702039127a | 187 | const GUI_FONT * DROPDOWN_GetDefaultFont (void); |
alejandroRL | 0:dd702039127a | 188 | GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index); |
alejandroRL | 0:dd702039127a | 189 | void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 190 | GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 191 | GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 192 | GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 193 | |
alejandroRL | 0:dd702039127a | 194 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 195 | } |
alejandroRL | 0:dd702039127a | 196 | #endif |
alejandroRL | 0:dd702039127a | 197 | |
alejandroRL | 0:dd702039127a | 198 | #endif // GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 199 | #endif // DROPDOWN_H |
alejandroRL | 0:dd702039127a | 200 | |
alejandroRL | 0:dd702039127a | 201 | /*************************** End of file ****************************/ |