Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
emWin/Include/SLIDER.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 : SLIDER.h |
csyang2 |
1:c0f972361605 | 40 | Purpose : SLIDER include |
csyang2 |
1:c0f972361605 | 41 | --------------------END-OF-HEADER------------------------------------- |
csyang2 |
1:c0f972361605 | 42 | */ |
csyang2 |
1:c0f972361605 | 43 | |
csyang2 |
1:c0f972361605 | 44 | #ifndef SLIDER_H |
csyang2 |
1:c0f972361605 | 45 | #define SLIDER_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 "WIDGET.h" |
csyang2 |
1:c0f972361605 | 50 | |
csyang2 |
1:c0f972361605 | 51 | #if GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 52 | |
csyang2 |
1:c0f972361605 | 53 | #if defined(__cplusplus) |
csyang2 |
1:c0f972361605 | 54 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
csyang2 |
1:c0f972361605 | 55 | #endif |
csyang2 |
1:c0f972361605 | 56 | |
csyang2 |
1:c0f972361605 | 57 | /************************************************************ |
csyang2 |
1:c0f972361605 | 58 | * |
csyang2 |
1:c0f972361605 | 59 | * Defines |
csyang2 |
1:c0f972361605 | 60 | * |
csyang2 |
1:c0f972361605 | 61 | ************************************************************* |
csyang2 |
1:c0f972361605 | 62 | */ |
csyang2 |
1:c0f972361605 | 63 | /************************************************************ |
csyang2 |
1:c0f972361605 | 64 | * |
csyang2 |
1:c0f972361605 | 65 | * States |
csyang2 |
1:c0f972361605 | 66 | */ |
csyang2 |
1:c0f972361605 | 67 | #define SLIDER_STATE_PRESSED WIDGET_STATE_USER0 |
csyang2 |
1:c0f972361605 | 68 | |
csyang2 |
1:c0f972361605 | 69 | /************************************************************ |
csyang2 |
1:c0f972361605 | 70 | * |
csyang2 |
1:c0f972361605 | 71 | * Create / Status flags |
csyang2 |
1:c0f972361605 | 72 | */ |
csyang2 |
1:c0f972361605 | 73 | #define SLIDER_CF_HORIZONTAL 0 |
csyang2 |
1:c0f972361605 | 74 | #define SLIDER_CF_VERTICAL WIDGET_CF_VERTICAL |
csyang2 |
1:c0f972361605 | 75 | |
csyang2 |
1:c0f972361605 | 76 | /************************************************************ |
csyang2 |
1:c0f972361605 | 77 | * |
csyang2 |
1:c0f972361605 | 78 | * Skinning property indices |
csyang2 |
1:c0f972361605 | 79 | */ |
csyang2 |
1:c0f972361605 | 80 | #define SLIDER_SKINFLEX_PI_PRESSED 0 |
csyang2 |
1:c0f972361605 | 81 | #define SLIDER_SKINFLEX_PI_UNPRESSED 1 |
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 SLIDER_Handle; |
csyang2 |
1:c0f972361605 | 90 | |
csyang2 |
1:c0f972361605 | 91 | typedef struct { |
csyang2 |
1:c0f972361605 | 92 | GUI_COLOR aColorFrame[2]; |
csyang2 |
1:c0f972361605 | 93 | GUI_COLOR aColorInner[2]; |
csyang2 |
1:c0f972361605 | 94 | GUI_COLOR aColorShaft[3]; |
csyang2 |
1:c0f972361605 | 95 | GUI_COLOR ColorTick; |
csyang2 |
1:c0f972361605 | 96 | GUI_COLOR ColorFocus; |
csyang2 |
1:c0f972361605 | 97 | int TickSize; |
csyang2 |
1:c0f972361605 | 98 | int ShaftSize; |
csyang2 |
1:c0f972361605 | 99 | } SLIDER_SKINFLEX_PROPS; |
csyang2 |
1:c0f972361605 | 100 | |
csyang2 |
1:c0f972361605 | 101 | typedef struct { |
csyang2 |
1:c0f972361605 | 102 | int Width; |
csyang2 |
1:c0f972361605 | 103 | int NumTicks; |
csyang2 |
1:c0f972361605 | 104 | int Size; |
csyang2 |
1:c0f972361605 | 105 | int IsPressed; |
csyang2 |
1:c0f972361605 | 106 | int IsVertical; |
csyang2 |
1:c0f972361605 | 107 | } SLIDER_SKINFLEX_INFO; |
csyang2 |
1:c0f972361605 | 108 | |
csyang2 |
1:c0f972361605 | 109 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 110 | * |
csyang2 |
1:c0f972361605 | 111 | * Create functions |
csyang2 |
1:c0f972361605 | 112 | * |
csyang2 |
1:c0f972361605 | 113 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 114 | */ |
csyang2 |
1:c0f972361605 | 115 | SLIDER_Handle SLIDER_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags); |
csyang2 |
1:c0f972361605 | 116 | SLIDER_Handle SLIDER_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
csyang2 |
1:c0f972361605 | 117 | SLIDER_Handle SLIDER_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
csyang2 |
1:c0f972361605 | 118 | SLIDER_Handle SLIDER_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
csyang2 |
1:c0f972361605 | 119 | |
csyang2 |
1:c0f972361605 | 120 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 121 | * |
csyang2 |
1:c0f972361605 | 122 | * The callback ... |
csyang2 |
1:c0f972361605 | 123 | * |
csyang2 |
1:c0f972361605 | 124 | * Do not call it directly ! It is only to be used from within an |
csyang2 |
1:c0f972361605 | 125 | * overwritten callback. |
csyang2 |
1:c0f972361605 | 126 | */ |
csyang2 |
1:c0f972361605 | 127 | void SLIDER_Callback(WM_MESSAGE * pMsg); |
csyang2 |
1:c0f972361605 | 128 | |
csyang2 |
1:c0f972361605 | 129 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 130 | * |
csyang2 |
1:c0f972361605 | 131 | * Member functions |
csyang2 |
1:c0f972361605 | 132 | * |
csyang2 |
1:c0f972361605 | 133 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 134 | */ |
csyang2 |
1:c0f972361605 | 135 | void SLIDER_Dec (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 136 | void SLIDER_EnableFocusRect(SLIDER_Handle hObj, int OnOff); |
csyang2 |
1:c0f972361605 | 137 | GUI_COLOR SLIDER_GetBarColor (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 138 | GUI_COLOR SLIDER_GetBkColor (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 139 | U8 SLIDER_GetFlag (SLIDER_Handle hObj, U8 Flag); |
csyang2 |
1:c0f972361605 | 140 | GUI_COLOR SLIDER_GetFocusColor (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 141 | void SLIDER_GetRange (SLIDER_Handle hObj, int * pMin, int * pMax); |
csyang2 |
1:c0f972361605 | 142 | GUI_COLOR SLIDER_GetTickColor (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 143 | int SLIDER_GetUserData (SLIDER_Handle hObj, void * pDest, int NumBytes); |
csyang2 |
1:c0f972361605 | 144 | int SLIDER_GetValue (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 145 | void SLIDER_Inc (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 146 | void SLIDER_SetBarColor (SLIDER_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 147 | void SLIDER_SetBkColor (SLIDER_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 148 | GUI_COLOR SLIDER_SetFocusColor (SLIDER_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 149 | void SLIDER_SetNumTicks (SLIDER_Handle hObj, int NumTicks); |
csyang2 |
1:c0f972361605 | 150 | void SLIDER_SetRange (SLIDER_Handle hObj, int Min, int Max); |
csyang2 |
1:c0f972361605 | 151 | void SLIDER_SetTickColor (SLIDER_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 152 | int SLIDER_SetUserData (SLIDER_Handle hObj, const void * pSrc, int NumBytes); |
csyang2 |
1:c0f972361605 | 153 | void SLIDER_SetValue (SLIDER_Handle hObj, int v); |
csyang2 |
1:c0f972361605 | 154 | void SLIDER_SetWidth (SLIDER_Handle hObj, int Width); |
csyang2 |
1:c0f972361605 | 155 | |
csyang2 |
1:c0f972361605 | 156 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 157 | * |
csyang2 |
1:c0f972361605 | 158 | * Member functions: Skinning |
csyang2 |
1:c0f972361605 | 159 | * |
csyang2 |
1:c0f972361605 | 160 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 161 | */ |
csyang2 |
1:c0f972361605 | 162 | void SLIDER_GetSkinFlexProps (SLIDER_SKINFLEX_PROPS * pProps, int Index); |
csyang2 |
1:c0f972361605 | 163 | void SLIDER_SetSkinClassic (SLIDER_Handle hObj); |
csyang2 |
1:c0f972361605 | 164 | void SLIDER_SetSkin (SLIDER_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
csyang2 |
1:c0f972361605 | 165 | int SLIDER_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
csyang2 |
1:c0f972361605 | 166 | void SLIDER_SetSkinFlexProps (const SLIDER_SKINFLEX_PROPS * pProps, int Index); |
csyang2 |
1:c0f972361605 | 167 | void SLIDER_SetDefaultSkinClassic(void); |
csyang2 |
1:c0f972361605 | 168 | WIDGET_DRAW_ITEM_FUNC * SLIDER_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
csyang2 |
1:c0f972361605 | 169 | |
csyang2 |
1:c0f972361605 | 170 | #define SLIDER_SKIN_FLEX SLIDER_DrawSkinFlex |
csyang2 |
1:c0f972361605 | 171 | |
csyang2 |
1:c0f972361605 | 172 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 173 | * |
csyang2 |
1:c0f972361605 | 174 | * Managing default values |
csyang2 |
1:c0f972361605 | 175 | * |
csyang2 |
1:c0f972361605 | 176 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 177 | */ |
csyang2 |
1:c0f972361605 | 178 | GUI_COLOR SLIDER_GetDefaultBkColor (void); |
csyang2 |
1:c0f972361605 | 179 | GUI_COLOR SLIDER_GetDefaultBarColor (void); |
csyang2 |
1:c0f972361605 | 180 | GUI_COLOR SLIDER_GetDefaultFocusColor(void); |
csyang2 |
1:c0f972361605 | 181 | GUI_COLOR SLIDER_GetDefaultTickColor (void); |
csyang2 |
1:c0f972361605 | 182 | void SLIDER_SetDefaultBkColor (GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 183 | void SLIDER_SetDefaultBarColor (GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 184 | GUI_COLOR SLIDER_SetDefaultFocusColor(GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 185 | void SLIDER_SetDefaultTickColor (GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 186 | |
csyang2 |
1:c0f972361605 | 187 | #if defined(__cplusplus) |
csyang2 |
1:c0f972361605 | 188 | } |
csyang2 |
1:c0f972361605 | 189 | #endif |
csyang2 |
1:c0f972361605 | 190 | |
csyang2 |
1:c0f972361605 | 191 | #endif // GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 192 | #endif // SLIDER_H |
csyang2 |
1:c0f972361605 | 193 | |
csyang2 |
1:c0f972361605 | 194 | /*************************** End of file ****************************/ |