Headers for emWin lib
Dependents: DISCO-F746NG_rtos_test
emWin_header/LISTBOX.h@0:1bf8f02b0770, 2016-03-26 (annotated)
- Committer:
- redbird
- Date:
- Sat Mar 26 22:49:50 2016 +0000
- Revision:
- 0:1bf8f02b0770
new code integration
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
redbird | 0:1bf8f02b0770 | 1 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
redbird | 0:1bf8f02b0770 | 3 | * Solutions for real time microcontroller applications * |
redbird | 0:1bf8f02b0770 | 4 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 5 | * * |
redbird | 0:1bf8f02b0770 | 6 | * (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * |
redbird | 0:1bf8f02b0770 | 7 | * * |
redbird | 0:1bf8f02b0770 | 8 | * Internet: www.segger.com Support: support@segger.com * |
redbird | 0:1bf8f02b0770 | 9 | * * |
redbird | 0:1bf8f02b0770 | 10 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 11 | |
redbird | 0:1bf8f02b0770 | 12 | ** emWin V5.24 - Graphical user interface for embedded applications ** |
redbird | 0:1bf8f02b0770 | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
redbird | 0:1bf8f02b0770 | 14 | emWin is protected by international copyright laws. Knowledge of the |
redbird | 0:1bf8f02b0770 | 15 | source code may not be used to write a similar product. This file may |
redbird | 0:1bf8f02b0770 | 16 | only be used in accordance with the following terms: |
redbird | 0:1bf8f02b0770 | 17 | |
redbird | 0:1bf8f02b0770 | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
redbird | 0:1bf8f02b0770 | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
redbird | 0:1bf8f02b0770 | 20 | CA 95134, USA solely for the purposes of creating libraries for |
redbird | 0:1bf8f02b0770 | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
redbird | 0:1bf8f02b0770 | 22 | distributed under the terms and conditions of the NXP End User License |
redbird | 0:1bf8f02b0770 | 23 | Agreement. |
redbird | 0:1bf8f02b0770 | 24 | Full source code is available at: www.segger.com |
redbird | 0:1bf8f02b0770 | 25 | |
redbird | 0:1bf8f02b0770 | 26 | We appreciate your understanding and fairness. |
redbird | 0:1bf8f02b0770 | 27 | ---------------------------------------------------------------------- |
redbird | 0:1bf8f02b0770 | 28 | File : LISTBOX.h |
redbird | 0:1bf8f02b0770 | 29 | Purpose : LISTBOX widget include |
redbird | 0:1bf8f02b0770 | 30 | --------------------END-OF-HEADER------------------------------------- |
redbird | 0:1bf8f02b0770 | 31 | */ |
redbird | 0:1bf8f02b0770 | 32 | |
redbird | 0:1bf8f02b0770 | 33 | #ifndef LISTBOX_H |
redbird | 0:1bf8f02b0770 | 34 | #define LISTBOX_H |
redbird | 0:1bf8f02b0770 | 35 | |
redbird | 0:1bf8f02b0770 | 36 | #include "WM.h" |
redbird | 0:1bf8f02b0770 | 37 | #include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */ |
redbird | 0:1bf8f02b0770 | 38 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
redbird | 0:1bf8f02b0770 | 39 | |
redbird | 0:1bf8f02b0770 | 40 | #if GUI_WINSUPPORT |
redbird | 0:1bf8f02b0770 | 41 | |
redbird | 0:1bf8f02b0770 | 42 | #if defined(__cplusplus) |
redbird | 0:1bf8f02b0770 | 43 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
redbird | 0:1bf8f02b0770 | 44 | #endif |
redbird | 0:1bf8f02b0770 | 45 | |
redbird | 0:1bf8f02b0770 | 46 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 47 | * |
redbird | 0:1bf8f02b0770 | 48 | * defines |
redbird | 0:1bf8f02b0770 | 49 | * |
redbird | 0:1bf8f02b0770 | 50 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 51 | */ |
redbird | 0:1bf8f02b0770 | 52 | |
redbird | 0:1bf8f02b0770 | 53 | #define LISTBOX_ALL_ITEMS -1 |
redbird | 0:1bf8f02b0770 | 54 | |
redbird | 0:1bf8f02b0770 | 55 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 56 | * |
redbird | 0:1bf8f02b0770 | 57 | * Color indices |
redbird | 0:1bf8f02b0770 | 58 | */ |
redbird | 0:1bf8f02b0770 | 59 | #define LISTBOX_CI_UNSEL 0 |
redbird | 0:1bf8f02b0770 | 60 | #define LISTBOX_CI_SEL 1 |
redbird | 0:1bf8f02b0770 | 61 | #define LISTBOX_CI_SELFOCUS 2 |
redbird | 0:1bf8f02b0770 | 62 | #define LISTBOX_CI_DISABLED 3 |
redbird | 0:1bf8f02b0770 | 63 | |
redbird | 0:1bf8f02b0770 | 64 | /************************************************************ |
redbird | 0:1bf8f02b0770 | 65 | * |
redbird | 0:1bf8f02b0770 | 66 | * States |
redbird | 0:1bf8f02b0770 | 67 | */ |
redbird | 0:1bf8f02b0770 | 68 | typedef WM_HMEM LISTBOX_Handle; |
redbird | 0:1bf8f02b0770 | 69 | |
redbird | 0:1bf8f02b0770 | 70 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 71 | * |
redbird | 0:1bf8f02b0770 | 72 | * Notification codes |
redbird | 0:1bf8f02b0770 | 73 | * |
redbird | 0:1bf8f02b0770 | 74 | * The following is the list of notification codes specific to this widget, |
redbird | 0:1bf8f02b0770 | 75 | * Send with the WM_NOTIFY_PARENT message |
redbird | 0:1bf8f02b0770 | 76 | */ |
redbird | 0:1bf8f02b0770 | 77 | #define LISTBOX_NOTIFICATION_LOST_FOCUS (WM_NOTIFICATION_WIDGET + 0) |
redbird | 0:1bf8f02b0770 | 78 | |
redbird | 0:1bf8f02b0770 | 79 | /************************************************************ |
redbird | 0:1bf8f02b0770 | 80 | * |
redbird | 0:1bf8f02b0770 | 81 | * Create / Status flags |
redbird | 0:1bf8f02b0770 | 82 | */ |
redbird | 0:1bf8f02b0770 | 83 | #define LISTBOX_CF_AUTOSCROLLBAR_H (1<<0) |
redbird | 0:1bf8f02b0770 | 84 | #define LISTBOX_CF_AUTOSCROLLBAR_V (1<<1) |
redbird | 0:1bf8f02b0770 | 85 | #define LISTBOX_CF_MULTISEL (1<<2) |
redbird | 0:1bf8f02b0770 | 86 | #define LISTBOX_SF_AUTOSCROLLBAR_H LISTBOX_CF_AUTOSCROLLBAR_H |
redbird | 0:1bf8f02b0770 | 87 | #define LISTBOX_SF_AUTOSCROLLBAR_V LISTBOX_CF_AUTOSCROLLBAR_V |
redbird | 0:1bf8f02b0770 | 88 | #define LISTBOX_SF_MULTISEL LISTBOX_CF_MULTISEL |
redbird | 0:1bf8f02b0770 | 89 | |
redbird | 0:1bf8f02b0770 | 90 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 91 | * |
redbird | 0:1bf8f02b0770 | 92 | * Standard member functions |
redbird | 0:1bf8f02b0770 | 93 | * |
redbird | 0:1bf8f02b0770 | 94 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 95 | */ |
redbird | 0:1bf8f02b0770 | 96 | |
redbird | 0:1bf8f02b0770 | 97 | #define LISTBOX_EnableMemdev(hObj) WM_EnableMemdev(hObj) |
redbird | 0:1bf8f02b0770 | 98 | #define LISTBOX_DisableMemdev(hObj) WM_DisableMemdev(hObj) |
redbird | 0:1bf8f02b0770 | 99 | #define LISTBOX_Delete(hObj) WM_DeleteWindow(hObj) |
redbird | 0:1bf8f02b0770 | 100 | #define LISTBOX_Paint(hObj) WM_Paint(hObj) |
redbird | 0:1bf8f02b0770 | 101 | #define LISTBOX_Invalidate(hObj) WM_InvalidateWindow(hObj) |
redbird | 0:1bf8f02b0770 | 102 | |
redbird | 0:1bf8f02b0770 | 103 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 104 | * |
redbird | 0:1bf8f02b0770 | 105 | * Create functions |
redbird | 0:1bf8f02b0770 | 106 | * |
redbird | 0:1bf8f02b0770 | 107 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 108 | */ |
redbird | 0:1bf8f02b0770 | 109 | |
redbird | 0:1bf8f02b0770 | 110 | LISTBOX_Handle LISTBOX_Create (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags); |
redbird | 0:1bf8f02b0770 | 111 | LISTBOX_Handle LISTBOX_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); |
redbird | 0:1bf8f02b0770 | 112 | 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); |
redbird | 0:1bf8f02b0770 | 113 | 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); |
redbird | 0:1bf8f02b0770 | 114 | LISTBOX_Handle LISTBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
redbird | 0:1bf8f02b0770 | 115 | |
redbird | 0:1bf8f02b0770 | 116 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 117 | * |
redbird | 0:1bf8f02b0770 | 118 | * The callback ... |
redbird | 0:1bf8f02b0770 | 119 | * |
redbird | 0:1bf8f02b0770 | 120 | * Do not call it directly ! It is only to be used from within an |
redbird | 0:1bf8f02b0770 | 121 | * overwritten callback. |
redbird | 0:1bf8f02b0770 | 122 | */ |
redbird | 0:1bf8f02b0770 | 123 | void LISTBOX_Callback(WM_MESSAGE * pMsg); |
redbird | 0:1bf8f02b0770 | 124 | |
redbird | 0:1bf8f02b0770 | 125 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 126 | * |
redbird | 0:1bf8f02b0770 | 127 | * Member functions |
redbird | 0:1bf8f02b0770 | 128 | * |
redbird | 0:1bf8f02b0770 | 129 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 130 | */ |
redbird | 0:1bf8f02b0770 | 131 | |
redbird | 0:1bf8f02b0770 | 132 | int LISTBOX_AddKey (LISTBOX_Handle hObj, int Key); |
redbird | 0:1bf8f02b0770 | 133 | void LISTBOX_AddString (LISTBOX_Handle hObj, const char * s); |
redbird | 0:1bf8f02b0770 | 134 | void LISTBOX_AddStringH (LISTBOX_Handle hObj, WM_HMEM hString); /* Not to be documented!!! */ |
redbird | 0:1bf8f02b0770 | 135 | void LISTBOX_DecSel (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 136 | void LISTBOX_DeleteItem (LISTBOX_Handle hObj, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 137 | unsigned LISTBOX_GetItemSpacing (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 138 | unsigned LISTBOX_GetNumItems (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 139 | int LISTBOX_GetSel (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 140 | const GUI_FONT * LISTBOX_GetFont (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 141 | int LISTBOX_GetItemDisabled (LISTBOX_Handle hObj, unsigned Index); |
redbird | 0:1bf8f02b0770 | 142 | int LISTBOX_GetItemSel (LISTBOX_Handle hObj, unsigned Index); |
redbird | 0:1bf8f02b0770 | 143 | void LISTBOX_GetItemText (LISTBOX_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); |
redbird | 0:1bf8f02b0770 | 144 | int LISTBOX_GetMulti (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 145 | int LISTBOX_GetScrollStepH (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 146 | int LISTBOX_GetTextAlign (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 147 | int LISTBOX_GetUserData (LISTBOX_Handle hObj, void * pDest, int NumBytes); |
redbird | 0:1bf8f02b0770 | 148 | void LISTBOX_IncSel (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 149 | void LISTBOX_InsertString (LISTBOX_Handle hObj, const char * s, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 150 | void LISTBOX_InvalidateItem (LISTBOX_Handle hObj, int Index); |
redbird | 0:1bf8f02b0770 | 151 | int LISTBOX_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
redbird | 0:1bf8f02b0770 | 152 | void LISTBOX_SetAutoScrollH (LISTBOX_Handle hObj, int OnOff); |
redbird | 0:1bf8f02b0770 | 153 | void LISTBOX_SetAutoScrollV (LISTBOX_Handle hObj, int OnOff); |
redbird | 0:1bf8f02b0770 | 154 | void LISTBOX_SetBkColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR color); |
redbird | 0:1bf8f02b0770 | 155 | void LISTBOX_SetFont (LISTBOX_Handle hObj, const GUI_FONT * pFont); |
redbird | 0:1bf8f02b0770 | 156 | void LISTBOX_SetItemDisabled (LISTBOX_Handle hObj, unsigned Index, int OnOff); |
redbird | 0:1bf8f02b0770 | 157 | void LISTBOX_SetItemSel (LISTBOX_Handle hObj, unsigned Index, int OnOff); |
redbird | 0:1bf8f02b0770 | 158 | void LISTBOX_SetItemSpacing (LISTBOX_Handle hObj, unsigned Value); |
redbird | 0:1bf8f02b0770 | 159 | void LISTBOX_SetMulti (LISTBOX_Handle hObj, int Mode); |
redbird | 0:1bf8f02b0770 | 160 | void LISTBOX_SetOwner (LISTBOX_Handle hObj, WM_HWIN hOwner); |
redbird | 0:1bf8f02b0770 | 161 | void LISTBOX_SetOwnerDraw (LISTBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); |
redbird | 0:1bf8f02b0770 | 162 | void LISTBOX_SetScrollStepH (LISTBOX_Handle hObj, int Value); |
redbird | 0:1bf8f02b0770 | 163 | void LISTBOX_SetSel (LISTBOX_Handle hObj, int Sel); |
redbird | 0:1bf8f02b0770 | 164 | void LISTBOX_SetScrollbarColor(LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 165 | void LISTBOX_SetScrollbarWidth(LISTBOX_Handle hObj, unsigned Width); |
redbird | 0:1bf8f02b0770 | 166 | void LISTBOX_SetString (LISTBOX_Handle hObj, const char * s, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 167 | void LISTBOX_SetText (LISTBOX_Handle hObj, const GUI_ConstString * ppText); |
redbird | 0:1bf8f02b0770 | 168 | void LISTBOX_SetTextAlign (LISTBOX_Handle hObj, int Align); |
redbird | 0:1bf8f02b0770 | 169 | GUI_COLOR LISTBOX_SetTextColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 170 | int LISTBOX_SetUserData (LISTBOX_Handle hObj, const void * pSrc, int NumBytes); |
redbird | 0:1bf8f02b0770 | 171 | int LISTBOX_UpdateScrollers (LISTBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 172 | |
redbird | 0:1bf8f02b0770 | 173 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 174 | * |
redbird | 0:1bf8f02b0770 | 175 | * Global functions |
redbird | 0:1bf8f02b0770 | 176 | * |
redbird | 0:1bf8f02b0770 | 177 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 178 | */ |
redbird | 0:1bf8f02b0770 | 179 | |
redbird | 0:1bf8f02b0770 | 180 | const GUI_FONT * LISTBOX_GetDefaultFont(void); |
redbird | 0:1bf8f02b0770 | 181 | int LISTBOX_GetDefaultScrollStepH (void); |
redbird | 0:1bf8f02b0770 | 182 | GUI_COLOR LISTBOX_GetDefaultBkColor (unsigned Index); |
redbird | 0:1bf8f02b0770 | 183 | int LISTBOX_GetDefaultTextAlign (void); |
redbird | 0:1bf8f02b0770 | 184 | GUI_COLOR LISTBOX_GetDefaultTextColor (unsigned Index); |
redbird | 0:1bf8f02b0770 | 185 | void LISTBOX_SetDefaultFont (const GUI_FONT * pFont); |
redbird | 0:1bf8f02b0770 | 186 | void LISTBOX_SetDefaultScrollStepH (int Value); |
redbird | 0:1bf8f02b0770 | 187 | void LISTBOX_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 188 | void LISTBOX_SetDefaultTextAlign (int Align); |
redbird | 0:1bf8f02b0770 | 189 | void LISTBOX_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 190 | |
redbird | 0:1bf8f02b0770 | 191 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 192 | * |
redbird | 0:1bf8f02b0770 | 193 | * Compatibility to older versions |
redbird | 0:1bf8f02b0770 | 194 | * |
redbird | 0:1bf8f02b0770 | 195 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 196 | */ |
redbird | 0:1bf8f02b0770 | 197 | |
redbird | 0:1bf8f02b0770 | 198 | #define LISTBOX_SetBackColor(hObj, Index, Color) LISTBOX_SetBkColor(hObj, Index, Color) |
redbird | 0:1bf8f02b0770 | 199 | #define LISTBOX_DeleteString LISTBOX_DeleteItem |
redbird | 0:1bf8f02b0770 | 200 | |
redbird | 0:1bf8f02b0770 | 201 | #if defined(__cplusplus) |
redbird | 0:1bf8f02b0770 | 202 | } |
redbird | 0:1bf8f02b0770 | 203 | #endif |
redbird | 0:1bf8f02b0770 | 204 | |
redbird | 0:1bf8f02b0770 | 205 | #endif // GUI_WINSUPPORT |
redbird | 0:1bf8f02b0770 | 206 | #endif // LISTBOX_H |
redbird | 0:1bf8f02b0770 | 207 | |
redbird | 0:1bf8f02b0770 | 208 | /*************************** End of file ****************************/ |