Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
emWin/Include/LISTBOX.h@1:c0f972361605, 2019-02-27 (annotated)
- Committer:
- csyang2
- Date:
- Wed Feb 27 14:34:09 2019 +0800
- Revision:
- 1:c0f972361605
Add emWin related materials
Who changed what in which revision?
User | Revision | Line number | New 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 : LISTBOX.h |
csyang2 |
1:c0f972361605 | 40 | Purpose : LISTBOX widget include |
csyang2 |
1:c0f972361605 | 41 | --------------------END-OF-HEADER------------------------------------- |
csyang2 |
1:c0f972361605 | 42 | */ |
csyang2 |
1:c0f972361605 | 43 | |
csyang2 |
1:c0f972361605 | 44 | #ifndef LISTBOX_H |
csyang2 |
1:c0f972361605 | 45 | #define LISTBOX_H |
csyang2 |
1:c0f972361605 | 46 | |
csyang2 |
1:c0f972361605 | 47 | #include "WM.h" |
csyang2 |
1:c0f972361605 | 48 | #include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */ |
csyang2 |
1:c0f972361605 | 49 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
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 | * defines |
csyang2 |
1:c0f972361605 | 60 | * |
csyang2 |
1:c0f972361605 | 61 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 62 | */ |
csyang2 |
1:c0f972361605 | 63 | |
csyang2 |
1:c0f972361605 | 64 | #define LISTBOX_ALL_ITEMS -1 |
csyang2 |
1:c0f972361605 | 65 | |
csyang2 |
1:c0f972361605 | 66 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 67 | * |
csyang2 |
1:c0f972361605 | 68 | * Color indices |
csyang2 |
1:c0f972361605 | 69 | */ |
csyang2 |
1:c0f972361605 | 70 | #define LISTBOX_CI_UNSEL 0 |
csyang2 |
1:c0f972361605 | 71 | #define LISTBOX_CI_SEL 1 |
csyang2 |
1:c0f972361605 | 72 | #define LISTBOX_CI_SELFOCUS 2 |
csyang2 |
1:c0f972361605 | 73 | #define LISTBOX_CI_DISABLED 3 |
csyang2 |
1:c0f972361605 | 74 | |
csyang2 |
1:c0f972361605 | 75 | /************************************************************ |
csyang2 |
1:c0f972361605 | 76 | * |
csyang2 |
1:c0f972361605 | 77 | * States |
csyang2 |
1:c0f972361605 | 78 | */ |
csyang2 |
1:c0f972361605 | 79 | typedef WM_HMEM LISTBOX_Handle; |
csyang2 |
1:c0f972361605 | 80 | |
csyang2 |
1:c0f972361605 | 81 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 82 | * |
csyang2 |
1:c0f972361605 | 83 | * Notification codes |
csyang2 |
1:c0f972361605 | 84 | * |
csyang2 |
1:c0f972361605 | 85 | * The following is the list of notification codes specific to this widget, |
csyang2 |
1:c0f972361605 | 86 | * Send with the WM_NOTIFY_PARENT message |
csyang2 |
1:c0f972361605 | 87 | */ |
csyang2 |
1:c0f972361605 | 88 | #define LISTBOX_NOTIFICATION_LOST_FOCUS (WM_NOTIFICATION_WIDGET + 0) |
csyang2 |
1:c0f972361605 | 89 | |
csyang2 |
1:c0f972361605 | 90 | /************************************************************ |
csyang2 |
1:c0f972361605 | 91 | * |
csyang2 |
1:c0f972361605 | 92 | * Create / Status flags |
csyang2 |
1:c0f972361605 | 93 | */ |
csyang2 |
1:c0f972361605 | 94 | #define LISTBOX_CF_AUTOSCROLLBAR_H (1 << 0) |
csyang2 |
1:c0f972361605 | 95 | #define LISTBOX_CF_AUTOSCROLLBAR_V (1 << 1) |
csyang2 |
1:c0f972361605 | 96 | #define LISTBOX_CF_MULTISEL (1 << 2) |
csyang2 |
1:c0f972361605 | 97 | #define LISTBOX_CF_WRAP (1 << 3) |
csyang2 |
1:c0f972361605 | 98 | #define LISTBOX_CF_FIXEDSCROLLMODE (1 << 4) |
csyang2 |
1:c0f972361605 | 99 | #define LISTBOX_SF_AUTOSCROLLBAR_H LISTBOX_CF_AUTOSCROLLBAR_H |
csyang2 |
1:c0f972361605 | 100 | #define LISTBOX_SF_AUTOSCROLLBAR_V LISTBOX_CF_AUTOSCROLLBAR_V |
csyang2 |
1:c0f972361605 | 101 | #define LISTBOX_SF_MULTISEL LISTBOX_CF_MULTISEL |
csyang2 |
1:c0f972361605 | 102 | #define LISTBOX_SF_WRAP LISTBOX_CF_WRAP |
csyang2 |
1:c0f972361605 | 103 | #define LISTBOX_SF_FIXEDSCROLLMODE LISTBOX_CF_FIXEDSCROLLMODE |
csyang2 |
1:c0f972361605 | 104 | |
csyang2 |
1:c0f972361605 | 105 | /************************************************************ |
csyang2 |
1:c0f972361605 | 106 | * |
csyang2 |
1:c0f972361605 | 107 | * Fixed scroll mode flags |
csyang2 |
1:c0f972361605 | 108 | */ |
csyang2 |
1:c0f972361605 | 109 | #define LISTBOX_FM_OFF 0 // Turn fixed mode off |
csyang2 |
1:c0f972361605 | 110 | #define LISTBOX_FM_ON 1 // Turn fixed mode on |
csyang2 |
1:c0f972361605 | 111 | #define LISTBOX_FM_CENTER 2 // Set fixed mode to center |
csyang2 |
1:c0f972361605 | 112 | |
csyang2 |
1:c0f972361605 | 113 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 114 | * |
csyang2 |
1:c0f972361605 | 115 | * Create functions |
csyang2 |
1:c0f972361605 | 116 | * |
csyang2 |
1:c0f972361605 | 117 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 118 | */ |
csyang2 |
1:c0f972361605 | 119 | |
csyang2 |
1:c0f972361605 | 120 | LISTBOX_Handle LISTBOX_Create (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags); |
csyang2 |
1:c0f972361605 | 121 | LISTBOX_Handle LISTBOX_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); |
csyang2 |
1:c0f972361605 | 122 | LISTBOX_Handle LISTBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText); |
csyang2 |
1:c0f972361605 | 123 | LISTBOX_Handle LISTBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText, int NumExtraBytes); |
csyang2 |
1:c0f972361605 | 124 | LISTBOX_Handle LISTBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
csyang2 |
1:c0f972361605 | 125 | |
csyang2 |
1:c0f972361605 | 126 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 127 | * |
csyang2 |
1:c0f972361605 | 128 | * The callback ... |
csyang2 |
1:c0f972361605 | 129 | * |
csyang2 |
1:c0f972361605 | 130 | * Do not call it directly ! It is only to be used from within an |
csyang2 |
1:c0f972361605 | 131 | * overwritten callback. |
csyang2 |
1:c0f972361605 | 132 | */ |
csyang2 |
1:c0f972361605 | 133 | void LISTBOX_Callback(WM_MESSAGE * pMsg); |
csyang2 |
1:c0f972361605 | 134 | |
csyang2 |
1:c0f972361605 | 135 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 136 | * |
csyang2 |
1:c0f972361605 | 137 | * Member functions |
csyang2 |
1:c0f972361605 | 138 | * |
csyang2 |
1:c0f972361605 | 139 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 140 | */ |
csyang2 |
1:c0f972361605 | 141 | |
csyang2 |
1:c0f972361605 | 142 | int LISTBOX_AddKey (LISTBOX_Handle hObj, int Key); |
csyang2 |
1:c0f972361605 | 143 | void LISTBOX_AddString (LISTBOX_Handle hObj, const char * s); |
csyang2 |
1:c0f972361605 | 144 | void LISTBOX_AddStringH (LISTBOX_Handle hObj, WM_HMEM hString); /* Not to be documented!!! */ |
csyang2 |
1:c0f972361605 | 145 | void LISTBOX_DecSel (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 146 | void LISTBOX_DeleteItem (LISTBOX_Handle hObj, unsigned Index); |
csyang2 |
1:c0f972361605 | 147 | void LISTBOX_EnableWrapMode (LISTBOX_Handle hObj, int OnOff); |
csyang2 |
1:c0f972361605 | 148 | GUI_COLOR LISTBOX_GetBkColor (LISTBOX_Handle hObj, unsigned Index); |
csyang2 |
1:c0f972361605 | 149 | const GUI_FONT * LISTBOX_GetFont (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 150 | unsigned LISTBOX_GetItemSpacing (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 151 | unsigned LISTBOX_GetNumItems (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 152 | int LISTBOX_GetSel (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 153 | GUI_COLOR LISTBOX_GetTextColor (LISTBOX_Handle hObj, unsigned Index); |
csyang2 |
1:c0f972361605 | 154 | int LISTBOX_GetItemDisabled (LISTBOX_Handle hObj, unsigned Index); |
csyang2 |
1:c0f972361605 | 155 | int LISTBOX_GetItemSel (LISTBOX_Handle hObj, unsigned Index); |
csyang2 |
1:c0f972361605 | 156 | void LISTBOX_GetItemText (LISTBOX_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); |
csyang2 |
1:c0f972361605 | 157 | int LISTBOX_GetMulti (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 158 | WM_HWIN LISTBOX_GetOwner (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 159 | int LISTBOX_GetScrollStepH (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 160 | int LISTBOX_GetTextAlign (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 161 | int LISTBOX_GetUserData (LISTBOX_Handle hObj, void * pDest, int NumBytes); |
csyang2 |
1:c0f972361605 | 162 | void LISTBOX_IncSel (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 163 | void LISTBOX_InsertString (LISTBOX_Handle hObj, const char * s, unsigned Index); |
csyang2 |
1:c0f972361605 | 164 | void LISTBOX_InvalidateItem (LISTBOX_Handle hObj, int Index); |
csyang2 |
1:c0f972361605 | 165 | int LISTBOX_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
csyang2 |
1:c0f972361605 | 166 | void LISTBOX_SetAutoScrollH (LISTBOX_Handle hObj, int OnOff); |
csyang2 |
1:c0f972361605 | 167 | void LISTBOX_SetAutoScrollV (LISTBOX_Handle hObj, int OnOff); |
csyang2 |
1:c0f972361605 | 168 | void LISTBOX_SetBkColor (LISTBOX_Handle hObj, unsigned Index, GUI_COLOR color); |
csyang2 |
1:c0f972361605 | 169 | void LISTBOX_SetFixedScrollPos(LISTBOX_Handle hObj, U16 FixedScrollPos, U8 Mode); |
csyang2 |
1:c0f972361605 | 170 | void LISTBOX_SetFont (LISTBOX_Handle hObj, const GUI_FONT * pFont); |
csyang2 |
1:c0f972361605 | 171 | void LISTBOX_SetItemDisabled (LISTBOX_Handle hObj, unsigned Index, int OnOff); |
csyang2 |
1:c0f972361605 | 172 | void LISTBOX_SetItemSel (LISTBOX_Handle hObj, unsigned Index, int OnOff); |
csyang2 |
1:c0f972361605 | 173 | void LISTBOX_SetItemSpacing (LISTBOX_Handle hObj, unsigned Value); |
csyang2 |
1:c0f972361605 | 174 | void LISTBOX_SetMulti (LISTBOX_Handle hObj, int Mode); |
csyang2 |
1:c0f972361605 | 175 | void LISTBOX_SetOwner (LISTBOX_Handle hObj, WM_HWIN hOwner); |
csyang2 |
1:c0f972361605 | 176 | void LISTBOX_SetOwnerDraw (LISTBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); |
csyang2 |
1:c0f972361605 | 177 | void LISTBOX_SetScrollStepH (LISTBOX_Handle hObj, int Value); |
csyang2 |
1:c0f972361605 | 178 | void LISTBOX_SetSel (LISTBOX_Handle hObj, int Sel); |
csyang2 |
1:c0f972361605 | 179 | void LISTBOX_SetScrollbarColor(LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 180 | void LISTBOX_SetScrollbarWidth(LISTBOX_Handle hObj, unsigned Width); |
csyang2 |
1:c0f972361605 | 181 | void LISTBOX_SetString (LISTBOX_Handle hObj, const char * s, unsigned Index); |
csyang2 |
1:c0f972361605 | 182 | void LISTBOX_SetText (LISTBOX_Handle hObj, const GUI_ConstString * ppText); |
csyang2 |
1:c0f972361605 | 183 | void LISTBOX_SetTextAlign (LISTBOX_Handle hObj, int Align); |
csyang2 |
1:c0f972361605 | 184 | GUI_COLOR LISTBOX_SetTextColor (LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 185 | int LISTBOX_SetUserData (LISTBOX_Handle hObj, const void * pSrc, int NumBytes); |
csyang2 |
1:c0f972361605 | 186 | int LISTBOX_UpdateScrollers (LISTBOX_Handle hObj); |
csyang2 |
1:c0f972361605 | 187 | |
csyang2 |
1:c0f972361605 | 188 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 189 | * |
csyang2 |
1:c0f972361605 | 190 | * Managing default values |
csyang2 |
1:c0f972361605 | 191 | * |
csyang2 |
1:c0f972361605 | 192 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 193 | */ |
csyang2 |
1:c0f972361605 | 194 | |
csyang2 |
1:c0f972361605 | 195 | const GUI_FONT * LISTBOX_GetDefaultFont(void); |
csyang2 |
1:c0f972361605 | 196 | int LISTBOX_GetDefaultScrollStepH (void); |
csyang2 |
1:c0f972361605 | 197 | GUI_COLOR LISTBOX_GetDefaultBkColor (unsigned Index); |
csyang2 |
1:c0f972361605 | 198 | int LISTBOX_GetDefaultTextAlign (void); |
csyang2 |
1:c0f972361605 | 199 | GUI_COLOR LISTBOX_GetDefaultTextColor (unsigned Index); |
csyang2 |
1:c0f972361605 | 200 | void LISTBOX_SetDefaultFont (const GUI_FONT * pFont); |
csyang2 |
1:c0f972361605 | 201 | void LISTBOX_SetDefaultScrollStepH (int Value); |
csyang2 |
1:c0f972361605 | 202 | void LISTBOX_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 203 | void LISTBOX_SetDefaultTextAlign (int Align); |
csyang2 |
1:c0f972361605 | 204 | void LISTBOX_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 205 | |
csyang2 |
1:c0f972361605 | 206 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 207 | * |
csyang2 |
1:c0f972361605 | 208 | * Compatibility to older versions |
csyang2 |
1:c0f972361605 | 209 | * |
csyang2 |
1:c0f972361605 | 210 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 211 | */ |
csyang2 |
1:c0f972361605 | 212 | |
csyang2 |
1:c0f972361605 | 213 | #define LISTBOX_SetBackColor(hObj, Index, Color) LISTBOX_SetBkColor(hObj, Index, Color) |
csyang2 |
1:c0f972361605 | 214 | #define LISTBOX_DeleteString LISTBOX_DeleteItem |
csyang2 |
1:c0f972361605 | 215 | |
csyang2 |
1:c0f972361605 | 216 | #if defined(__cplusplus) |
csyang2 |
1:c0f972361605 | 217 | } |
csyang2 |
1:c0f972361605 | 218 | #endif |
csyang2 |
1:c0f972361605 | 219 | |
csyang2 |
1:c0f972361605 | 220 | #endif // GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 221 | #endif // LISTBOX_H |
csyang2 |
1:c0f972361605 | 222 | |
csyang2 |
1:c0f972361605 | 223 | /*************************** End of file ****************************/ |