NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/SWIPELIST.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 : SWIPELIST.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : SWIPELIST include |
alejandroRL | 0:dd702039127a | 41 | --------------------END-OF-HEADER------------------------------------- |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #ifndef SWIPELIST_H |
alejandroRL | 0:dd702039127a | 45 | #define SWIPELIST_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 "WIDGET.h" |
alejandroRL | 0:dd702039127a | 50 | #include "GUI_Debug.h" |
alejandroRL | 0:dd702039127a | 51 | |
alejandroRL | 0:dd702039127a | 52 | #if GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 53 | |
alejandroRL | 0:dd702039127a | 54 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 55 | extern "C" { // Make sure we have C-declarations in C++ programs |
alejandroRL | 0:dd702039127a | 56 | #endif |
alejandroRL | 0:dd702039127a | 57 | |
alejandroRL | 0:dd702039127a | 58 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 59 | * |
alejandroRL | 0:dd702039127a | 60 | * Create flags |
alejandroRL | 0:dd702039127a | 61 | * |
alejandroRL | 0:dd702039127a | 62 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 63 | */ |
alejandroRL | 0:dd702039127a | 64 | #define SWIPELIST_CF_HORIZONTAL (0 << 0) |
alejandroRL | 0:dd702039127a | 65 | #define SWIPELIST_CF_VERTICAL (1 << 0) |
alejandroRL | 0:dd702039127a | 66 | |
alejandroRL | 0:dd702039127a | 67 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 68 | * |
alejandroRL | 0:dd702039127a | 69 | * Getting border size |
alejandroRL | 0:dd702039127a | 70 | */ |
alejandroRL | 0:dd702039127a | 71 | #define SWIPELIST_BI_LEFT 0 |
alejandroRL | 0:dd702039127a | 72 | #define SWIPELIST_BI_RIGHT 1 |
alejandroRL | 0:dd702039127a | 73 | #define SWIPELIST_BI_TOP 2 |
alejandroRL | 0:dd702039127a | 74 | #define SWIPELIST_BI_BOTTOM 3 |
alejandroRL | 0:dd702039127a | 75 | |
alejandroRL | 0:dd702039127a | 76 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 77 | * |
alejandroRL | 0:dd702039127a | 78 | * Getting font |
alejandroRL | 0:dd702039127a | 79 | */ |
alejandroRL | 0:dd702039127a | 80 | #define SWIPELIST_FI_SEP_ITEM 0 |
alejandroRL | 0:dd702039127a | 81 | #define SWIPELIST_FI_ITEM_HEADER 1 |
alejandroRL | 0:dd702039127a | 82 | #define SWIPELIST_FI_ITEM_TEXT 2 |
alejandroRL | 0:dd702039127a | 83 | |
alejandroRL | 0:dd702039127a | 84 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 85 | * |
alejandroRL | 0:dd702039127a | 86 | * Getting color |
alejandroRL | 0:dd702039127a | 87 | */ |
alejandroRL | 0:dd702039127a | 88 | #define SWIPELIST_CI_ITEM_HEADER_UNSEL 0 |
alejandroRL | 0:dd702039127a | 89 | #define SWIPELIST_CI_ITEM_HEADER_SEL 1 |
alejandroRL | 0:dd702039127a | 90 | #define SWIPELIST_CI_ITEM_TEXT_UNSEL 2 |
alejandroRL | 0:dd702039127a | 91 | #define SWIPELIST_CI_ITEM_TEXT_SEL 3 |
alejandroRL | 0:dd702039127a | 92 | #define SWIPELIST_CI_SEP_ITEM_TEXT 4 |
alejandroRL | 0:dd702039127a | 93 | |
alejandroRL | 0:dd702039127a | 94 | #define SWIPELIST_CI_BK_ITEM_UNSEL 0 |
alejandroRL | 0:dd702039127a | 95 | #define SWIPELIST_CI_BK_ITEM_SEL 1 |
alejandroRL | 0:dd702039127a | 96 | #define SWIPELIST_CI_BK_SEP_ITEM 2 |
alejandroRL | 0:dd702039127a | 97 | |
alejandroRL | 0:dd702039127a | 98 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 99 | * |
alejandroRL | 0:dd702039127a | 100 | * Bitmap align |
alejandroRL | 0:dd702039127a | 101 | */ |
alejandroRL | 0:dd702039127a | 102 | #define SWIPELIST_BA_LEFT (0<<0) |
alejandroRL | 0:dd702039127a | 103 | #define SWIPELIST_BA_RIGHT (1<<0) |
alejandroRL | 0:dd702039127a | 104 | #define SWIPELIST_BA_HCENTER (2<<0) |
alejandroRL | 0:dd702039127a | 105 | |
alejandroRL | 0:dd702039127a | 106 | #define SWIPELIST_BA_VCENTER (3<<2) |
alejandroRL | 0:dd702039127a | 107 | #define SWIPELIST_BA_TOP (0<<2) |
alejandroRL | 0:dd702039127a | 108 | #define SWIPELIST_BA_BOTTOM (1<<2) |
alejandroRL | 0:dd702039127a | 109 | |
alejandroRL | 0:dd702039127a | 110 | |
alejandroRL | 0:dd702039127a | 111 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 112 | * |
alejandroRL | 0:dd702039127a | 113 | * Public Types |
alejandroRL | 0:dd702039127a | 114 | * |
alejandroRL | 0:dd702039127a | 115 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 116 | */ |
alejandroRL | 0:dd702039127a | 117 | typedef WM_HMEM SWIPELIST_Handle; |
alejandroRL | 0:dd702039127a | 118 | |
alejandroRL | 0:dd702039127a | 119 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 120 | * |
alejandroRL | 0:dd702039127a | 121 | * Create functions |
alejandroRL | 0:dd702039127a | 122 | * |
alejandroRL | 0:dd702039127a | 123 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 124 | */ |
alejandroRL | 0:dd702039127a | 125 | SWIPELIST_Handle SWIPELIST_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); |
alejandroRL | 0:dd702039127a | 126 | SWIPELIST_Handle SWIPELIST_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
alejandroRL | 0:dd702039127a | 127 | SWIPELIST_Handle SWIPELIST_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
alejandroRL | 0:dd702039127a | 128 | SWIPELIST_Handle SWIPELIST_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
alejandroRL | 0:dd702039127a | 129 | |
alejandroRL | 0:dd702039127a | 130 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 131 | * |
alejandroRL | 0:dd702039127a | 132 | * The callback ... |
alejandroRL | 0:dd702039127a | 133 | * |
alejandroRL | 0:dd702039127a | 134 | * Do not call it directly ! It is only to be used from within an |
alejandroRL | 0:dd702039127a | 135 | * overwritten callback. |
alejandroRL | 0:dd702039127a | 136 | */ |
alejandroRL | 0:dd702039127a | 137 | void SWIPELIST_Callback(WM_MESSAGE * pMsg); |
alejandroRL | 0:dd702039127a | 138 | |
alejandroRL | 0:dd702039127a | 139 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 140 | * |
alejandroRL | 0:dd702039127a | 141 | * Member functions |
alejandroRL | 0:dd702039127a | 142 | * |
alejandroRL | 0:dd702039127a | 143 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 144 | */ |
alejandroRL | 0:dd702039127a | 145 | |
alejandroRL | 0:dd702039127a | 146 | |
alejandroRL | 0:dd702039127a | 147 | int SWIPELIST_AddItem (SWIPELIST_Handle hObj, const char * sText, int ItemSize); |
alejandroRL | 0:dd702039127a | 148 | int SWIPELIST_AddItemText (SWIPELIST_Handle hObj, unsigned ItemIndex, const char * sText); |
alejandroRL | 0:dd702039127a | 149 | int SWIPELIST_AddSepItem (SWIPELIST_Handle hObj, const char * sText, int ItemSize); |
alejandroRL | 0:dd702039127a | 150 | void SWIPELIST_DeleteItem (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 151 | |
alejandroRL | 0:dd702039127a | 152 | const GUI_BITMAP * SWIPELIST_GetBitmap (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 153 | int SWIPELIST_GetBitmapSpace (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 154 | GUI_COLOR SWIPELIST_GetBkColor (SWIPELIST_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 155 | int SWIPELIST_GetBorderSize (SWIPELIST_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 156 | const GUI_FONT * SWIPELIST_GetFont (SWIPELIST_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 157 | int SWIPELIST_GetItemSize (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 158 | U32 SWIPELIST_GetItemUserData (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 159 | int SWIPELIST_GetNumItems (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 160 | int SWIPELIST_GetNumText (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 161 | int SWIPELIST_GetReleasedItem (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 162 | int SWIPELIST_GetScrollPos (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 163 | int SWIPELIST_GetSelItem (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 164 | GUI_COLOR SWIPELIST_GetSepColor (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 165 | int SWIPELIST_GetSepSize (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 166 | void SWIPELIST_GetText (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * pBuffer, int MaxSize); |
alejandroRL | 0:dd702039127a | 167 | int SWIPELIST_GetTextAlign (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 168 | GUI_COLOR SWIPELIST_GetTextColor (SWIPELIST_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 169 | int SWIPELIST_GetThreshold (SWIPELIST_Handle hObj); |
alejandroRL | 0:dd702039127a | 170 | int SWIPELIST_GetUserData (SWIPELIST_Handle hObj, void * pDest, int NumBytes); |
alejandroRL | 0:dd702039127a | 171 | |
alejandroRL | 0:dd702039127a | 172 | int SWIPELIST_ItemAttachWindow (SWIPELIST_Handle hObj, unsigned ItemIndex, WM_HWIN hWin, int x0, int y0); |
alejandroRL | 0:dd702039127a | 173 | void SWIPELIST_ItemDetachWindow (SWIPELIST_Handle hObj, WM_HWIN hWin); |
alejandroRL | 0:dd702039127a | 174 | int SWIPELIST_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
alejandroRL | 0:dd702039127a | 175 | |
alejandroRL | 0:dd702039127a | 176 | void SWIPELIST_SetAttachedWindowPos (SWIPELIST_Handle hObj, WM_HWIN hWin, int x0, int y0); |
alejandroRL | 0:dd702039127a | 177 | void SWIPELIST_SetBitmap (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap); |
alejandroRL | 0:dd702039127a | 178 | void SWIPELIST_SetBitmapEx (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap, int x, int y); |
alejandroRL | 0:dd702039127a | 179 | void SWIPELIST_SetBitmapSpace (SWIPELIST_Handle hObj, unsigned Size); |
alejandroRL | 0:dd702039127a | 180 | void SWIPELIST_SetBkColor (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 181 | void SWIPELIST_SetBorderSize (SWIPELIST_Handle hObj, unsigned Index, unsigned Size); |
alejandroRL | 0:dd702039127a | 182 | void SWIPELIST_SetFont (SWIPELIST_Handle hObj, unsigned Index, const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 183 | void SWIPELIST_SetItemSize (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned Size); |
alejandroRL | 0:dd702039127a | 184 | void SWIPELIST_SetItemUserData (SWIPELIST_Handle hObj, unsigned ItemIndex, U32 UserData); |
alejandroRL | 0:dd702039127a | 185 | void SWIPELIST_SetOwnerDraw (SWIPELIST_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); |
alejandroRL | 0:dd702039127a | 186 | void SWIPELIST_SetScrollPos (SWIPELIST_Handle hObj, int Pos); |
alejandroRL | 0:dd702039127a | 187 | void SWIPELIST_SetScrollPosItem (SWIPELIST_Handle hObj, unsigned ItemIndex); |
alejandroRL | 0:dd702039127a | 188 | void SWIPELIST_SetSepColor (SWIPELIST_Handle hObj, unsigned ItemIndex, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 189 | void SWIPELIST_SetSepSize (SWIPELIST_Handle hObj, unsigned ItemIndex, int Size); |
alejandroRL | 0:dd702039127a | 190 | void SWIPELIST_SetText (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * sText); |
alejandroRL | 0:dd702039127a | 191 | void SWIPELIST_SetTextAlign (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align); |
alejandroRL | 0:dd702039127a | 192 | void SWIPELIST_SetTextColor (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 193 | int SWIPELIST_SetThreshold (SWIPELIST_Handle hObj, int Threshold); |
alejandroRL | 0:dd702039127a | 194 | int SWIPELIST_SetUserData (SWIPELIST_Handle hObj, const void * pSrc, int NumBytes); |
alejandroRL | 0:dd702039127a | 195 | |
alejandroRL | 0:dd702039127a | 196 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 197 | * |
alejandroRL | 0:dd702039127a | 198 | * Global functions |
alejandroRL | 0:dd702039127a | 199 | * |
alejandroRL | 0:dd702039127a | 200 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 201 | */ |
alejandroRL | 0:dd702039127a | 202 | int SWIPELIST_GetDefaultBitmapSpace (void); |
alejandroRL | 0:dd702039127a | 203 | GUI_COLOR SWIPELIST_GetDefaultBkColor (unsigned Index); |
alejandroRL | 0:dd702039127a | 204 | int SWIPELIST_GetDefaultBorderSize (unsigned Index); |
alejandroRL | 0:dd702039127a | 205 | const GUI_FONT * SWIPELIST_GetDefaultFont (unsigned Index); |
alejandroRL | 0:dd702039127a | 206 | GUI_COLOR SWIPELIST_GetDefaultSepColor (void); |
alejandroRL | 0:dd702039127a | 207 | unsigned SWIPELIST_GetDefaultSepSize (void); |
alejandroRL | 0:dd702039127a | 208 | GUI_COLOR SWIPELIST_GetDefaultTextColor (unsigned Index); |
alejandroRL | 0:dd702039127a | 209 | int SWIPELIST_GetDefaultTextAlign (void); |
alejandroRL | 0:dd702039127a | 210 | int SWIPELIST_GetDefaultThreshold (void); |
alejandroRL | 0:dd702039127a | 211 | |
alejandroRL | 0:dd702039127a | 212 | void SWIPELIST_SetDefaultBitmapSpace (unsigned Size); |
alejandroRL | 0:dd702039127a | 213 | void SWIPELIST_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 214 | void SWIPELIST_SetDefaultBorderSize (unsigned Index, unsigned Size); |
alejandroRL | 0:dd702039127a | 215 | void SWIPELIST_SetDefaultFont (unsigned Index, const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 216 | void SWIPELIST_SetDefaultSepColor (GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 217 | void SWIPELIST_SetDefaultSepSize (unsigned Size); |
alejandroRL | 0:dd702039127a | 218 | void SWIPELIST_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 219 | void SWIPELIST_SetDefaultTextAlign (int Align); |
alejandroRL | 0:dd702039127a | 220 | void SWIPELIST_SetDefaultThreshold (int Threshold); |
alejandroRL | 0:dd702039127a | 221 | |
alejandroRL | 0:dd702039127a | 222 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 223 | } |
alejandroRL | 0:dd702039127a | 224 | #endif |
alejandroRL | 0:dd702039127a | 225 | |
alejandroRL | 0:dd702039127a | 226 | #endif // GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 227 | #endif // SWIPELIST_H |
alejandroRL | 0:dd702039127a | 228 | |
alejandroRL | 0:dd702039127a | 229 | /*************************** End of file ****************************/ |