Headers for emWin lib
Dependents: DISCO-F746NG_rtos_test
emWin_header/SPINBOX.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 : SPINBOX.h |
redbird | 0:1bf8f02b0770 | 29 | Purpose : SPINBOX header file |
redbird | 0:1bf8f02b0770 | 30 | --------------------END-OF-HEADER------------------------------------- |
redbird | 0:1bf8f02b0770 | 31 | */ |
redbird | 0:1bf8f02b0770 | 32 | |
redbird | 0:1bf8f02b0770 | 33 | #ifndef SPINBOX_H |
redbird | 0:1bf8f02b0770 | 34 | #define SPINBOX_H |
redbird | 0:1bf8f02b0770 | 35 | |
redbird | 0:1bf8f02b0770 | 36 | #include "WM.h" |
redbird | 0:1bf8f02b0770 | 37 | #include "DIALOG_Intern.h" // Required for Create indirect data structure |
redbird | 0:1bf8f02b0770 | 38 | #include "WIDGET.h" |
redbird | 0:1bf8f02b0770 | 39 | #include "GUI_Debug.h" |
redbird | 0:1bf8f02b0770 | 40 | #include "EDIT.h" |
redbird | 0:1bf8f02b0770 | 41 | |
redbird | 0:1bf8f02b0770 | 42 | #if GUI_WINSUPPORT |
redbird | 0:1bf8f02b0770 | 43 | |
redbird | 0:1bf8f02b0770 | 44 | #if defined(__cplusplus) |
redbird | 0:1bf8f02b0770 | 45 | extern "C" { // Make sure we have C-declarations in C++ programs |
redbird | 0:1bf8f02b0770 | 46 | #endif |
redbird | 0:1bf8f02b0770 | 47 | |
redbird | 0:1bf8f02b0770 | 48 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 49 | * |
redbird | 0:1bf8f02b0770 | 50 | * Defines |
redbird | 0:1bf8f02b0770 | 51 | * |
redbird | 0:1bf8f02b0770 | 52 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 53 | */ |
redbird | 0:1bf8f02b0770 | 54 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 55 | * |
redbird | 0:1bf8f02b0770 | 56 | * States |
redbird | 0:1bf8f02b0770 | 57 | */ |
redbird | 0:1bf8f02b0770 | 58 | #define SPINBOX_STATE_PRESSED(x) (U8)(1 << (U8)x) // These flags are stored in (SPINBOX_OBJ->State) | x must be 0 or 1 |
redbird | 0:1bf8f02b0770 | 59 | #define SPINBOX_STATE_FOCUS WIDGET_STATE_FOCUS // This is read from (SPINBOX_OBJ->Widget.State) |
redbird | 0:1bf8f02b0770 | 60 | |
redbird | 0:1bf8f02b0770 | 61 | #define SPINBOX_EDGE_RIGHT 0 |
redbird | 0:1bf8f02b0770 | 62 | #define SPINBOX_EDGE_LEFT 1 |
redbird | 0:1bf8f02b0770 | 63 | #define SPINBOX_EDGE_CENTER 2 |
redbird | 0:1bf8f02b0770 | 64 | |
redbird | 0:1bf8f02b0770 | 65 | #define SPINBOX_EM_STEP 0 |
redbird | 0:1bf8f02b0770 | 66 | #define SPINBOX_EM_EDIT 1 |
redbird | 0:1bf8f02b0770 | 67 | |
redbird | 0:1bf8f02b0770 | 68 | #ifndef SPINBOX_EM_DEFAULT |
redbird | 0:1bf8f02b0770 | 69 | #define SPINBOX_EM_DEFAULT SPINBOX_EM_STEP |
redbird | 0:1bf8f02b0770 | 70 | #endif |
redbird | 0:1bf8f02b0770 | 71 | |
redbird | 0:1bf8f02b0770 | 72 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 73 | * |
redbird | 0:1bf8f02b0770 | 74 | * Color indices |
redbird | 0:1bf8f02b0770 | 75 | */ |
redbird | 0:1bf8f02b0770 | 76 | #define SPINBOX_CI_DISABLED EDIT_CI_DISABLED |
redbird | 0:1bf8f02b0770 | 77 | #define SPINBOX_CI_ENABLED EDIT_CI_ENABLED |
redbird | 0:1bf8f02b0770 | 78 | #define SPINBOX_CI_PRESSED 2 |
redbird | 0:1bf8f02b0770 | 79 | |
redbird | 0:1bf8f02b0770 | 80 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 81 | * |
redbird | 0:1bf8f02b0770 | 82 | * Skinning property indices |
redbird | 0:1bf8f02b0770 | 83 | */ |
redbird | 0:1bf8f02b0770 | 84 | #define SPINBOX_SKIN_FLEX SPINBOX_DrawSkinFlex |
redbird | 0:1bf8f02b0770 | 85 | |
redbird | 0:1bf8f02b0770 | 86 | #define SPINBOX_SKINFLEX_PI_PRESSED 0 |
redbird | 0:1bf8f02b0770 | 87 | #define SPINBOX_SKINFLEX_PI_FOCUSSED 1 |
redbird | 0:1bf8f02b0770 | 88 | #define SPINBOX_SKINFLEX_PI_ENABLED 2 |
redbird | 0:1bf8f02b0770 | 89 | #define SPINBOX_SKINFLEX_PI_DISABLED 3 |
redbird | 0:1bf8f02b0770 | 90 | #define SPINBOX_SKIN_FLEX_RADIUS 2 |
redbird | 0:1bf8f02b0770 | 91 | |
redbird | 0:1bf8f02b0770 | 92 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 93 | * |
redbird | 0:1bf8f02b0770 | 94 | * Public Types |
redbird | 0:1bf8f02b0770 | 95 | * |
redbird | 0:1bf8f02b0770 | 96 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 97 | */ |
redbird | 0:1bf8f02b0770 | 98 | typedef WM_HMEM SPINBOX_Handle; |
redbird | 0:1bf8f02b0770 | 99 | |
redbird | 0:1bf8f02b0770 | 100 | typedef struct { |
redbird | 0:1bf8f02b0770 | 101 | GUI_COLOR aColorFrame[2]; // [0] Outer color of surrounding frame. [1] Inner color of surrounding frame. |
redbird | 0:1bf8f02b0770 | 102 | GUI_COLOR aColorUpper[2]; // [0] Upper color of gradient for upper button. [1] Lower color of gradient for upper button. |
redbird | 0:1bf8f02b0770 | 103 | GUI_COLOR aColorLower[2]; // [0] Upper color of gradient for lower button. [1] Lower color of gradient for lower button. |
redbird | 0:1bf8f02b0770 | 104 | GUI_COLOR ColorArrow; // Color of the button arrow. |
redbird | 0:1bf8f02b0770 | 105 | GUI_COLOR ColorBk; // Color of the background. // See WIDGET_ITEM_CREATE in SPINBOX_DrawSkinFlex() |
redbird | 0:1bf8f02b0770 | 106 | GUI_COLOR ColorText; // Color of the text. // See WIDGET_ITEM_CREATE in SPINBOX_DrawSkinFlex() |
redbird | 0:1bf8f02b0770 | 107 | GUI_COLOR ColorButtonFrame; // Color of the button frame. |
redbird | 0:1bf8f02b0770 | 108 | } SPINBOX_SKINFLEX_PROPS; |
redbird | 0:1bf8f02b0770 | 109 | |
redbird | 0:1bf8f02b0770 | 110 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 111 | * |
redbird | 0:1bf8f02b0770 | 112 | * Prototypes |
redbird | 0:1bf8f02b0770 | 113 | * |
redbird | 0:1bf8f02b0770 | 114 | ********************************************************************** |
redbird | 0:1bf8f02b0770 | 115 | */ |
redbird | 0:1bf8f02b0770 | 116 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 117 | * |
redbird | 0:1bf8f02b0770 | 118 | * Creation |
redbird | 0:1bf8f02b0770 | 119 | */ |
redbird | 0:1bf8f02b0770 | 120 | SPINBOX_Handle SPINBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int Min, int Max); |
redbird | 0:1bf8f02b0770 | 121 | SPINBOX_Handle SPINBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int Min, int Max, int NumExtraBytes); |
redbird | 0:1bf8f02b0770 | 122 | SPINBOX_Handle SPINBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
redbird | 0:1bf8f02b0770 | 123 | |
redbird | 0:1bf8f02b0770 | 124 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 125 | * |
redbird | 0:1bf8f02b0770 | 126 | * Callback, should be called only from within a custom callback. |
redbird | 0:1bf8f02b0770 | 127 | */ |
redbird | 0:1bf8f02b0770 | 128 | void SPINBOX_Callback(WM_MESSAGE * pMsg); |
redbird | 0:1bf8f02b0770 | 129 | |
redbird | 0:1bf8f02b0770 | 130 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 131 | * |
redbird | 0:1bf8f02b0770 | 132 | * Get / Set properties |
redbird | 0:1bf8f02b0770 | 133 | */ |
redbird | 0:1bf8f02b0770 | 134 | void SPINBOX_EnableBlink (SPINBOX_Handle hObj, int Period, int OnOff); |
redbird | 0:1bf8f02b0770 | 135 | GUI_COLOR SPINBOX_GetBkColor (SPINBOX_Handle hObj, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 136 | GUI_COLOR SPINBOX_GetButtonBkColor(SPINBOX_Handle hObj, unsigned int Index); |
redbird | 0:1bf8f02b0770 | 137 | EDIT_Handle SPINBOX_GetEditHandle (SPINBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 138 | int SPINBOX_GetUserData (SPINBOX_Handle hObj, void * pDest, int NumBytes); |
redbird | 0:1bf8f02b0770 | 139 | I32 SPINBOX_GetValue (SPINBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 140 | void SPINBOX_SetBkColor (SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 141 | void SPINBOX_SetButtonBkColor(SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 142 | void SPINBOX_SetButtonSize (SPINBOX_Handle hObj, unsigned ButtonSize); |
redbird | 0:1bf8f02b0770 | 143 | void SPINBOX_SetEdge (SPINBOX_Handle hObj, U8 Edge); |
redbird | 0:1bf8f02b0770 | 144 | void SPINBOX_SetEditMode (SPINBOX_Handle hObj, U8 EditMode); |
redbird | 0:1bf8f02b0770 | 145 | void SPINBOX_SetFont (SPINBOX_Handle hObj, const GUI_FONT * pFont); |
redbird | 0:1bf8f02b0770 | 146 | void SPINBOX_SetRange (SPINBOX_Handle hObj, I32 Min, I32 Max); |
redbird | 0:1bf8f02b0770 | 147 | U16 SPINBOX_SetStep (SPINBOX_Handle hObj, U16 Step); |
redbird | 0:1bf8f02b0770 | 148 | void SPINBOX_SetTextColor (SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); |
redbird | 0:1bf8f02b0770 | 149 | int SPINBOX_SetUserData (SPINBOX_Handle hObj, const void * pSrc, int NumBytes); |
redbird | 0:1bf8f02b0770 | 150 | void SPINBOX_SetValue (SPINBOX_Handle hObj, I32 Value); |
redbird | 0:1bf8f02b0770 | 151 | |
redbird | 0:1bf8f02b0770 | 152 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 153 | * |
redbird | 0:1bf8f02b0770 | 154 | * Default value management |
redbird | 0:1bf8f02b0770 | 155 | */ |
redbird | 0:1bf8f02b0770 | 156 | U16 SPINBOX_GetDefaultButtonSize(void); |
redbird | 0:1bf8f02b0770 | 157 | void SPINBOX_SetDefaultButtonSize(U16 ButtonSize); |
redbird | 0:1bf8f02b0770 | 158 | |
redbird | 0:1bf8f02b0770 | 159 | /********************************************************************* |
redbird | 0:1bf8f02b0770 | 160 | * |
redbird | 0:1bf8f02b0770 | 161 | * Skinning |
redbird | 0:1bf8f02b0770 | 162 | */ |
redbird | 0:1bf8f02b0770 | 163 | void SPINBOX_GetSkinFlexProps (SPINBOX_SKINFLEX_PROPS * pProps, int Index); |
redbird | 0:1bf8f02b0770 | 164 | void SPINBOX_SetSkinClassic (SPINBOX_Handle hObj); |
redbird | 0:1bf8f02b0770 | 165 | void SPINBOX_SetSkin (SPINBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
redbird | 0:1bf8f02b0770 | 166 | int SPINBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
redbird | 0:1bf8f02b0770 | 167 | void SPINBOX_SetSkinFlexProps (const SPINBOX_SKINFLEX_PROPS * pProps, int Index); |
redbird | 0:1bf8f02b0770 | 168 | void SPINBOX_SetDefaultSkinClassic(void); |
redbird | 0:1bf8f02b0770 | 169 | WIDGET_DRAW_ITEM_FUNC * SPINBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
redbird | 0:1bf8f02b0770 | 170 | |
redbird | 0:1bf8f02b0770 | 171 | #if defined(__cplusplus) |
redbird | 0:1bf8f02b0770 | 172 | } |
redbird | 0:1bf8f02b0770 | 173 | #endif |
redbird | 0:1bf8f02b0770 | 174 | |
redbird | 0:1bf8f02b0770 | 175 | #endif // GUI_WINSUPPORT |
redbird | 0:1bf8f02b0770 | 176 | #endif // SPINBOX_H |
redbird | 0:1bf8f02b0770 | 177 | |
redbird | 0:1bf8f02b0770 | 178 | /*************************** End of file ****************************/ |