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