NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/LISTVIEW.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 : LISTVIEW.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : LISTVIEW include |
alejandroRL | 0:dd702039127a | 41 | --------------------END-OF-HEADER------------------------------------- |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #ifndef LISTVIEW_H |
alejandroRL | 0:dd702039127a | 45 | #define LISTVIEW_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 "ICONVIEW.h" |
alejandroRL | 0:dd702039127a | 50 | #include "HEADER.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 | * Defines |
alejandroRL | 0:dd702039127a | 61 | */ |
alejandroRL | 0:dd702039127a | 62 | #define LISTVIEW_ALL_ITEMS -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 LISTVIEW_CI_UNSEL 0 |
alejandroRL | 0:dd702039127a | 69 | #define LISTVIEW_CI_SEL 1 |
alejandroRL | 0:dd702039127a | 70 | #define LISTVIEW_CI_SELFOCUS 2 |
alejandroRL | 0:dd702039127a | 71 | #define LISTVIEW_CI_DISABLED 3 |
alejandroRL | 0:dd702039127a | 72 | |
alejandroRL | 0:dd702039127a | 73 | /************************************************************ |
alejandroRL | 0:dd702039127a | 74 | * |
alejandroRL | 0:dd702039127a | 75 | * Create / Status flags |
alejandroRL | 0:dd702039127a | 76 | */ |
alejandroRL | 0:dd702039127a | 77 | #define LISTVIEW_CF_AUTOSCROLLBAR_H (1 << 0) |
alejandroRL | 0:dd702039127a | 78 | #define LISTVIEW_CF_AUTOSCROLLBAR_V (1 << 1) |
alejandroRL | 0:dd702039127a | 79 | #define LISTVIEW_CF_CELL_SELECT (1 << 2) // Create Flag used to enable cell selection |
alejandroRL | 0:dd702039127a | 80 | #define LISTVIEW_SF_AUTOSCROLLBAR_H LISTVIEW_CF_AUTOSCROLLBAR_H |
alejandroRL | 0:dd702039127a | 81 | #define LISTVIEW_SF_AUTOSCROLLBAR_V LISTVIEW_CF_AUTOSCROLLBAR_V |
alejandroRL | 0:dd702039127a | 82 | |
alejandroRL | 0:dd702039127a | 83 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 84 | * |
alejandroRL | 0:dd702039127a | 85 | * Public Types |
alejandroRL | 0:dd702039127a | 86 | * |
alejandroRL | 0:dd702039127a | 87 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 88 | */ |
alejandroRL | 0:dd702039127a | 89 | typedef WM_HMEM LISTVIEW_Handle; |
alejandroRL | 0:dd702039127a | 90 | |
alejandroRL | 0:dd702039127a | 91 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 92 | * |
alejandroRL | 0:dd702039127a | 93 | * Create functions |
alejandroRL | 0:dd702039127a | 94 | * |
alejandroRL | 0:dd702039127a | 95 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 96 | */ |
alejandroRL | 0:dd702039127a | 97 | LISTVIEW_Handle LISTVIEW_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); |
alejandroRL | 0:dd702039127a | 98 | LISTVIEW_Handle LISTVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
alejandroRL | 0:dd702039127a | 99 | LISTVIEW_Handle LISTVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
alejandroRL | 0:dd702039127a | 100 | LISTVIEW_Handle LISTVIEW_CreateAttached(WM_HWIN hParent, int Id, int SpecialFlags); |
alejandroRL | 0:dd702039127a | 101 | LISTVIEW_Handle LISTVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
alejandroRL | 0:dd702039127a | 102 | |
alejandroRL | 0:dd702039127a | 103 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 104 | * |
alejandroRL | 0:dd702039127a | 105 | * The callback ... |
alejandroRL | 0:dd702039127a | 106 | * |
alejandroRL | 0:dd702039127a | 107 | * Do not call it directly ! It is only to be used from within an |
alejandroRL | 0:dd702039127a | 108 | * overwritten callback. |
alejandroRL | 0:dd702039127a | 109 | */ |
alejandroRL | 0:dd702039127a | 110 | void LISTVIEW_Callback(WM_MESSAGE * pMsg); |
alejandroRL | 0:dd702039127a | 111 | |
alejandroRL | 0:dd702039127a | 112 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 113 | * |
alejandroRL | 0:dd702039127a | 114 | * Member functions |
alejandroRL | 0:dd702039127a | 115 | * |
alejandroRL | 0:dd702039127a | 116 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 117 | */ |
alejandroRL | 0:dd702039127a | 118 | int LISTVIEW_AddColumn (LISTVIEW_Handle hObj, int Width, const char * s, int Align); |
alejandroRL | 0:dd702039127a | 119 | int LISTVIEW_AddRow (LISTVIEW_Handle hObj, const GUI_ConstString * ppText); |
alejandroRL | 0:dd702039127a | 120 | int LISTVIEW_CompareText (const void * p0, const void * p1); |
alejandroRL | 0:dd702039127a | 121 | int LISTVIEW_CompareDec (const void * p0, const void * p1); |
alejandroRL | 0:dd702039127a | 122 | void LISTVIEW_DecSel (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 123 | void LISTVIEW_DeleteAllRows (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 124 | void LISTVIEW_DeleteColumn (LISTVIEW_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 125 | void LISTVIEW_DeleteRow (LISTVIEW_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 126 | void LISTVIEW_DeleteRowSorted (LISTVIEW_Handle hObj, int Row); |
alejandroRL | 0:dd702039127a | 127 | void LISTVIEW_DisableRow (LISTVIEW_Handle hObj, unsigned Row); |
alejandroRL | 0:dd702039127a | 128 | void LISTVIEW_DisableSort (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 129 | void LISTVIEW_EnableCellSelect (LISTVIEW_Handle hObj, unsigned OnOff); // Enables/disables cell selection |
alejandroRL | 0:dd702039127a | 130 | void LISTVIEW_EnableRow (LISTVIEW_Handle hObj, unsigned Row); |
alejandroRL | 0:dd702039127a | 131 | void LISTVIEW_EnableSort (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 132 | GUI_COLOR LISTVIEW_GetBkColor (LISTVIEW_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 133 | const GUI_FONT * LISTVIEW_GetFont (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 134 | HEADER_Handle LISTVIEW_GetHeader (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 135 | void LISTVIEW_GetItemRect (LISTVIEW_Handle hObj, U32 Col, U32 Row, GUI_RECT * pRect); |
alejandroRL | 0:dd702039127a | 136 | void LISTVIEW_GetItemText (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, char * pBuffer, unsigned MaxSize); |
alejandroRL | 0:dd702039127a | 137 | unsigned LISTVIEW_GetItemTextLen (LISTVIEW_Handle hObj, unsigned Column, unsigned Row); |
alejandroRL | 0:dd702039127a | 138 | void LISTVIEW_GetItemTextSorted (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, char * pBuffer, unsigned MaxSize); |
alejandroRL | 0:dd702039127a | 139 | unsigned LISTVIEW_GetLBorder (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 140 | unsigned LISTVIEW_GetNumColumns (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 141 | unsigned LISTVIEW_GetNumRows (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 142 | unsigned LISTVIEW_GetRBorder (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 143 | int LISTVIEW_GetSel (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 144 | int LISTVIEW_GetSelCol (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 145 | int LISTVIEW_GetSelUnsorted (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 146 | int LISTVIEW_GetTextAlign (LISTVIEW_Handle hObj, unsigned ColIndex); |
alejandroRL | 0:dd702039127a | 147 | GUI_COLOR LISTVIEW_GetTextColor (LISTVIEW_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 148 | int LISTVIEW_GetUserData (LISTVIEW_Handle hObj, void * pDest, int NumBytes); |
alejandroRL | 0:dd702039127a | 149 | U32 LISTVIEW_GetUserDataRow (LISTVIEW_Handle hObj, unsigned Row); |
alejandroRL | 0:dd702039127a | 150 | GUI_WRAPMODE LISTVIEW_GetWrapMode (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 151 | void LISTVIEW_IncSel (LISTVIEW_Handle hObj); |
alejandroRL | 0:dd702039127a | 152 | int LISTVIEW_InsertRow (LISTVIEW_Handle hObj, unsigned Index, const GUI_ConstString * ppText); |
alejandroRL | 0:dd702039127a | 153 | int LISTVIEW_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
alejandroRL | 0:dd702039127a | 154 | unsigned LISTVIEW_RowIsDisabled (LISTVIEW_Handle hObj, unsigned Row); |
alejandroRL | 0:dd702039127a | 155 | void LISTVIEW_SetAutoScrollH (LISTVIEW_Handle hObj, int OnOff); |
alejandroRL | 0:dd702039127a | 156 | void LISTVIEW_SetAutoScrollV (LISTVIEW_Handle hObj, int OnOff); |
alejandroRL | 0:dd702039127a | 157 | void LISTVIEW_SetItemBitmap (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, int xOff, int yOff, const GUI_BITMAP * pBitmap); |
alejandroRL | 0:dd702039127a | 158 | void LISTVIEW_SetBkColor (LISTVIEW_Handle hObj, unsigned int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 159 | void LISTVIEW_SetColumnWidth (LISTVIEW_Handle hObj, unsigned int Index, int Width); |
alejandroRL | 0:dd702039127a | 160 | void LISTVIEW_SetCompareFunc (LISTVIEW_Handle hObj, unsigned Column, int (* fpCompare)(const void * p0, const void * p1)); |
alejandroRL | 0:dd702039127a | 161 | unsigned LISTVIEW_SetFixed (LISTVIEW_Handle hObj, unsigned Fixed); |
alejandroRL | 0:dd702039127a | 162 | void LISTVIEW_SetFont (LISTVIEW_Handle hObj, const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 163 | int LISTVIEW_SetGridVis (LISTVIEW_Handle hObj, int Show); |
alejandroRL | 0:dd702039127a | 164 | void LISTVIEW_SetHeaderHeight (LISTVIEW_Handle hObj, unsigned HeaderHeight); |
alejandroRL | 0:dd702039127a | 165 | void LISTVIEW_SetItemBkColor (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, unsigned int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 166 | void LISTVIEW_SetItemText (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, const char * s); |
alejandroRL | 0:dd702039127a | 167 | void LISTVIEW_SetItemTextColor (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, unsigned int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 168 | void LISTVIEW_SetItemTextSorted (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, const char * pText); |
alejandroRL | 0:dd702039127a | 169 | void LISTVIEW_SetLBorder (LISTVIEW_Handle hObj, unsigned BorderSize); |
alejandroRL | 0:dd702039127a | 170 | void LISTVIEW_SetOwnerDraw (LISTVIEW_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); |
alejandroRL | 0:dd702039127a | 171 | void LISTVIEW_SetRBorder (LISTVIEW_Handle hObj, unsigned BorderSize); |
alejandroRL | 0:dd702039127a | 172 | unsigned LISTVIEW_SetRowHeight (LISTVIEW_Handle hObj, unsigned RowHeight); |
alejandroRL | 0:dd702039127a | 173 | void LISTVIEW_SetSel (LISTVIEW_Handle hObj, int Sel); |
alejandroRL | 0:dd702039127a | 174 | void LISTVIEW_SetSelCol (LISTVIEW_Handle hObj, int NewCol); |
alejandroRL | 0:dd702039127a | 175 | void LISTVIEW_SetSelUnsorted (LISTVIEW_Handle hObj, int Sel); |
alejandroRL | 0:dd702039127a | 176 | unsigned LISTVIEW_SetSort (LISTVIEW_Handle hObj, unsigned Column, unsigned Reverse); |
alejandroRL | 0:dd702039127a | 177 | void LISTVIEW_SetTextAlign (LISTVIEW_Handle hObj, unsigned int Index, int Align); |
alejandroRL | 0:dd702039127a | 178 | void LISTVIEW_SetTextColor (LISTVIEW_Handle hObj, unsigned int Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 179 | int LISTVIEW_SetUserData (LISTVIEW_Handle hObj, const void * pSrc, int NumBytes); |
alejandroRL | 0:dd702039127a | 180 | void LISTVIEW_SetUserDataRow (LISTVIEW_Handle hObj, unsigned Row, U32 UserData); |
alejandroRL | 0:dd702039127a | 181 | void LISTVIEW_SetWrapMode (LISTVIEW_Handle hObj, GUI_WRAPMODE WrapMode); |
alejandroRL | 0:dd702039127a | 182 | |
alejandroRL | 0:dd702039127a | 183 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 184 | * |
alejandroRL | 0:dd702039127a | 185 | * Managing default values |
alejandroRL | 0:dd702039127a | 186 | * |
alejandroRL | 0:dd702039127a | 187 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 188 | */ |
alejandroRL | 0:dd702039127a | 189 | |
alejandroRL | 0:dd702039127a | 190 | GUI_COLOR LISTVIEW_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 191 | const GUI_FONT * LISTVIEW_SetDefaultFont (const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 192 | GUI_COLOR LISTVIEW_SetDefaultGridColor(GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 193 | GUI_COLOR LISTVIEW_SetDefaultTextColor(unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 194 | |
alejandroRL | 0:dd702039127a | 195 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 196 | } |
alejandroRL | 0:dd702039127a | 197 | #endif |
alejandroRL | 0:dd702039127a | 198 | |
alejandroRL | 0:dd702039127a | 199 | #endif // GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 200 | #endif // LISTVIEW_H |
alejandroRL | 0:dd702039127a | 201 | |
alejandroRL | 0:dd702039127a | 202 | /*************************** End of file ****************************/ |