Headers for emWin lib
Dependents: DISCO-F746NG_rtos_test
emWin_header/DROPDOWN.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 : DROPDOWN.h |
redbird | 0:1bf8f02b0770 | 29 | Purpose : Multiple choice object include |
redbird | 0:1bf8f02b0770 | 30 | --------------------END-OF-HEADER------------------------------------- |
redbird | 0:1bf8f02b0770 | 31 | */ |
redbird | 0:1bf8f02b0770 | 32 | |
redbird | 0:1bf8f02b0770 | 33 | #ifndef DROPDOWN_H |
redbird | 0:1bf8f02b0770 | 34 | #define DROPDOWN_H |
redbird | 0:1bf8f02b0770 | 35 | |
redbird | 0:1bf8f02b0770 | 36 | #include "WM.h" |
redbird | 0:1bf8f02b0770 | 37 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
redbird | 0:1bf8f02b0770 | 38 | #include "LISTBOX.h" |
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 | * Create flags |
redbird | 0:1bf8f02b0770 | 49 | */ |
redbird | 0:1bf8f02b0770 | 50 | #define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0) |
redbird | 0:1bf8f02b0770 | 51 | #define DROPDOWN_CF_UP (1 << 1) |
redbird | 0:1bf8f02b0770 | 52 | |
redbird | 0:1bf8f02b0770 | 53 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 54 | * |
redbird | 0:1bf8f02b0770 | 55 | * Color indices |
redbird | 0:1bf8f02b0770 | 56 | */ |
redbird | 0:1bf8f02b0770 | 57 | #define DROPDOWN_CI_UNSEL 0 |
redbird | 0:1bf8f02b0770 | 58 | #define DROPDOWN_CI_SEL 1 |
redbird | 0:1bf8f02b0770 | 59 | #define DROPDOWN_CI_SELFOCUS 2 |
redbird | 0:1bf8f02b0770 | 60 | |
redbird | 0:1bf8f02b0770 | 61 | #define DROPDOWN_CI_ARROW 0 |
redbird | 0:1bf8f02b0770 | 62 | #define DROPDOWN_CI_BUTTON 1 |
redbird | 0:1bf8f02b0770 | 63 | |
redbird | 0:1bf8f02b0770 | 64 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 65 | * |
redbird | 0:1bf8f02b0770 | 66 | * Skinning property indices |
redbird | 0:1bf8f02b0770 | 67 | */ |
redbird | 0:1bf8f02b0770 | 68 | #define DROPDOWN_SKINFLEX_PI_EXPANDED 0 |
redbird | 0:1bf8f02b0770 | 69 | #define DROPDOWN_SKINFLEX_PI_FOCUSSED 1 |
redbird | 0:1bf8f02b0770 | 70 | #define DROPDOWN_SKINFLEX_PI_ENABLED 2 |
redbird | 0:1bf8f02b0770 | 71 | #define DROPDOWN_SKINFLEX_PI_DISABLED 3 |
redbird | 0:1bf8f02b0770 | 72 | |
redbird | 0:1bf8f02b0770 | 73 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 74 | * |
redbird | 0:1bf8f02b0770 | 75 | * Types |
redbird | 0:1bf8f02b0770 | 76 | * |
redbird | 0:1bf8f02b0770 | 77 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 78 | */ |
redbird | 0:1bf8f02b0770 | 79 | typedef WM_HMEM DROPDOWN_Handle; |
redbird | 0:1bf8f02b0770 | 80 | |
redbird | 0:1bf8f02b0770 | 81 | typedef struct { |
redbird | 0:1bf8f02b0770 | 82 | GUI_COLOR aColorFrame[3]; |
redbird | 0:1bf8f02b0770 | 83 | GUI_COLOR aColorUpper[2]; |
redbird | 0:1bf8f02b0770 | 84 | GUI_COLOR aColorLower[2]; |
redbird | 0:1bf8f02b0770 | 85 | GUI_COLOR ColorArrow; |
redbird | 0:1bf8f02b0770 | 86 | GUI_COLOR ColorText; |
redbird | 0:1bf8f02b0770 | 87 | GUI_COLOR ColorSep; |
redbird | 0:1bf8f02b0770 | 88 | int Radius; |
redbird | 0:1bf8f02b0770 | 89 | } DROPDOWN_SKINFLEX_PROPS; |
redbird | 0:1bf8f02b0770 | 90 | |
redbird | 0:1bf8f02b0770 | 91 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 92 | * |
redbird | 0:1bf8f02b0770 | 93 | * Standard member functions |
redbird | 0:1bf8f02b0770 | 94 | * |
redbird | 0:1bf8f02b0770 | 95 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 96 | */ |
redbird | 0:1bf8f02b0770 | 97 | #define DROPDOWN_EnableMemdev(hObj) WM_EnableMemdev(hObj) |
redbird | 0:1bf8f02b0770 | 98 | #define DROPDOWN_DisableMemdev(hObj) WM_DisableMemdev(hObj) |
redbird | 0:1bf8f02b0770 | 99 | #define DROPDOWN_Delete(hObj) WM_DeleteWindow(hObj) |
redbird | 0:1bf8f02b0770 | 100 | #define DROPDOWN_Paint(hObj) WM_Paint(hObj) |
redbird | 0:1bf8f02b0770 | 101 | #define DROPDOWN_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 | DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); |
redbird | 0:1bf8f02b0770 | 110 | DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
redbird | 0:1bf8f02b0770 | 111 | DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
redbird | 0:1bf8f02b0770 | 112 | DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb); |
redbird | 0:1bf8f02b0770 | 113 | |
redbird | 0:1bf8f02b0770 | 114 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 115 | * |
redbird | 0:1bf8f02b0770 | 116 | * The callback ... |
redbird | 0:1bf8f02b0770 | 117 | * |
redbird | 0:1bf8f02b0770 | 118 | * Do not call it directly ! It is only to be used from within an |
redbird | 0:1bf8f02b0770 | 119 | * overwritten callback. |
redbird | 0:1bf8f02b0770 | 120 | */ |
redbird | 0:1bf8f02b0770 | 121 | void DROPDOWN_Callback(WM_MESSAGE * pMsg); |
redbird | 0:1bf8f02b0770 | 122 | |
redbird | 0:1bf8f02b0770 | 123 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 124 | * |
redbird | 0:1bf8f02b0770 | 125 | * Member functions |
redbird | 0:1bf8f02b0770 | 126 | * |
redbird | 0:1bf8f02b0770 | 127 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 128 | */ |
redbird | 0:1bf8f02b0770 | 129 | void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key); |
redbird | 0:1bf8f02b0770 | 130 | void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s); |
redbird | 0:1bf8f02b0770 | 131 | void DROPDOWN_Collapse (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 132 | void DROPDOWN_DecSel (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 133 | void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 134 | void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 135 | void DROPDOWN_Expand (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 136 | unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index); |
redbird | 0:1bf8f02b0770 | 137 | unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 138 | int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); |
redbird | 0:1bf8f02b0770 | 139 | LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 140 | int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 141 | int DROPDOWN_GetSel (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 142 | int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 143 | int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes); |
redbird | 0:1bf8f02b0770 | 144 | void DROPDOWN_IncSel (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 145 | void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 146 | void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 147 | void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff); |
redbird | 0:1bf8f02b0770 | 148 | void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color); |
redbird | 0:1bf8f02b0770 | 149 | void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 150 | void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont); |
redbird | 0:1bf8f02b0770 | 151 | void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff); |
redbird | 0:1bf8f02b0770 | 152 | void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value); |
redbird | 0:1bf8f02b0770 | 153 | int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height); |
redbird | 0:1bf8f02b0770 | 154 | void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 155 | void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width); |
redbird | 0:1bf8f02b0770 | 156 | void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel); |
redbird | 0:1bf8f02b0770 | 157 | void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel); |
redbird | 0:1bf8f02b0770 | 158 | void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align); |
redbird | 0:1bf8f02b0770 | 159 | void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color); |
redbird | 0:1bf8f02b0770 | 160 | void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight); |
redbird | 0:1bf8f02b0770 | 161 | int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff); |
redbird | 0:1bf8f02b0770 | 162 | int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes); |
redbird | 0:1bf8f02b0770 | 163 | |
redbird | 0:1bf8f02b0770 | 164 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 165 | * |
redbird | 0:1bf8f02b0770 | 166 | * Member functions: Skinning |
redbird | 0:1bf8f02b0770 | 167 | * |
redbird | 0:1bf8f02b0770 | 168 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 169 | */ |
redbird | 0:1bf8f02b0770 | 170 | void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index); |
redbird | 0:1bf8f02b0770 | 171 | void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj); |
redbird | 0:1bf8f02b0770 | 172 | void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
redbird | 0:1bf8f02b0770 | 173 | int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
redbird | 0:1bf8f02b0770 | 174 | void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index); |
redbird | 0:1bf8f02b0770 | 175 | void DROPDOWN_SetDefaultSkinClassic(void); |
redbird | 0:1bf8f02b0770 | 176 | WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
redbird | 0:1bf8f02b0770 | 177 | |
redbird | 0:1bf8f02b0770 | 178 | #define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex |
redbird | 0:1bf8f02b0770 | 179 | |
redbird | 0:1bf8f02b0770 | 180 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 181 | * |
redbird | 0:1bf8f02b0770 | 182 | * Global functions |
redbird | 0:1bf8f02b0770 | 183 | * |
redbird | 0:1bf8f02b0770 | 184 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 185 | */ |
redbird | 0:1bf8f02b0770 | 186 | GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index); |
redbird | 0:1bf8f02b0770 | 187 | GUI_COLOR DROPDOWN_GetDefaultColor (int Index); |
redbird | 0:1bf8f02b0770 | 188 | const GUI_FONT * DROPDOWN_GetDefaultFont (void); |
redbird | 0:1bf8f02b0770 | 189 | GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index); |
redbird | 0:1bf8f02b0770 | 190 | void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont); |
redbird | 0:1bf8f02b0770 | 191 | GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 192 | GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 193 | GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 194 | |
redbird | 0:1bf8f02b0770 | 195 | #if defined(__cplusplus) |
redbird | 0:1bf8f02b0770 | 196 | } |
redbird | 0:1bf8f02b0770 | 197 | #endif |
redbird | 0:1bf8f02b0770 | 198 | |
redbird | 0:1bf8f02b0770 | 199 | #endif // GUI_WINSUPPORT |
redbird | 0:1bf8f02b0770 | 200 | #endif // DROPDOWN_H |
redbird | 0:1bf8f02b0770 | 201 | |
redbird | 0:1bf8f02b0770 | 202 | /*************************** End of file ****************************/ |