Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
emWin/Include/SPINBOX_Private.h@10:c8165817d92a, 6 months ago (annotated)
- Committer:
- csyang2
- Date:
- Mon Mar 04 15:47:41 2024 +0800
- Revision:
- 10:c8165817d92a
- Parent:
- 1:c0f972361605
Support NuMaker-IoT-M467
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 : SPINBOX_Private.h |
csyang2 |
1:c0f972361605 | 40 | Purpose : Private SPINBOX include |
csyang2 |
1:c0f972361605 | 41 | --------------------END-OF-HEADER------------------------------------- |
csyang2 |
1:c0f972361605 | 42 | */ |
csyang2 |
1:c0f972361605 | 43 | |
csyang2 |
1:c0f972361605 | 44 | #ifndef SPINBOX_PRIVATE_H |
csyang2 |
1:c0f972361605 | 45 | #define SPINBOX_PRIVATE_H |
csyang2 |
1:c0f972361605 | 46 | |
csyang2 |
1:c0f972361605 | 47 | #include "SPINBOX.h" |
csyang2 |
1:c0f972361605 | 48 | #include "EDIT.h" |
csyang2 |
1:c0f972361605 | 49 | #include "GUI_Private.h" |
csyang2 |
1:c0f972361605 | 50 | |
csyang2 |
1:c0f972361605 | 51 | #if GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 52 | |
csyang2 |
1:c0f972361605 | 53 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 54 | * |
csyang2 |
1:c0f972361605 | 55 | * Private config defaults |
csyang2 |
1:c0f972361605 | 56 | * |
csyang2 |
1:c0f972361605 | 57 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 58 | */ |
csyang2 |
1:c0f972361605 | 59 | |
csyang2 |
1:c0f972361605 | 60 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 61 | * |
csyang2 |
1:c0f972361605 | 62 | * Object definition |
csyang2 |
1:c0f972361605 | 63 | * |
csyang2 |
1:c0f972361605 | 64 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 65 | */ |
csyang2 |
1:c0f972361605 | 66 | typedef struct { |
csyang2 |
1:c0f972361605 | 67 | WIDGET_DRAW_ITEM_FUNC * pfDrawSkin; |
csyang2 |
1:c0f972361605 | 68 | } SPINBOX_SKIN_PRIVATE; |
csyang2 |
1:c0f972361605 | 69 | |
csyang2 |
1:c0f972361605 | 70 | typedef struct { |
csyang2 |
1:c0f972361605 | 71 | GUI_COLOR aButtonBkColor[3]; // Button background color for the states (disabled, pressed, unpressed). |
csyang2 |
1:c0f972361605 | 72 | GUI_COLOR aButtonUpperColor[3]; // Upper color for the button states (disabled, pressed, unpressed). |
csyang2 |
1:c0f972361605 | 73 | GUI_COLOR aButtonLowerColor[3]; // Lower color for the button states (disabled, pressed, unpressed). |
csyang2 |
1:c0f972361605 | 74 | GUI_COLOR aButtonOuterColor[3]; // Outer color for the button states (disabled, pressed, unpressed). |
csyang2 |
1:c0f972361605 | 75 | GUI_COLOR aTriangleColor[3]; // Color of the triangle for the button states (disabled, pressed, unpressed). |
csyang2 |
1:c0f972361605 | 76 | GUI_COLOR aBkColor[2]; // Background color for the states (enabled, disabled). |
csyang2 |
1:c0f972361605 | 77 | GUI_COLOR aTextColor[2]; // Text color for the states (enabled, disabled). |
csyang2 |
1:c0f972361605 | 78 | I32 Min; // Minimum allowed value. |
csyang2 |
1:c0f972361605 | 79 | I32 Max; // Maximum allowed value. |
csyang2 |
1:c0f972361605 | 80 | U16 Step; // Value will be increased/decreased by this amount when a button is clicked. |
csyang2 |
1:c0f972361605 | 81 | U16 ButtonSize; // Size of the button depending on the orientation. |
csyang2 |
1:c0f972361605 | 82 | U8 Edge; // Buttons reside on the left or right edge of the widget. |
csyang2 |
1:c0f972361605 | 83 | SPINBOX_SKIN_PRIVATE SkinPrivate; // Structure containing a pointer to the used DrawSkin-function. |
csyang2 |
1:c0f972361605 | 84 | } SPINBOX_PROPS; |
csyang2 |
1:c0f972361605 | 85 | |
csyang2 |
1:c0f972361605 | 86 | typedef struct { |
csyang2 |
1:c0f972361605 | 87 | WIDGET Widget; |
csyang2 |
1:c0f972361605 | 88 | SPINBOX_PROPS Props; |
csyang2 |
1:c0f972361605 | 89 | const WIDGET_SKIN * pWidgetSkin; |
csyang2 |
1:c0f972361605 | 90 | EDIT_Handle hEdit; |
csyang2 |
1:c0f972361605 | 91 | GUI_TIMER_HANDLE hTimer; |
csyang2 |
1:c0f972361605 | 92 | I8 TimerButton; |
csyang2 |
1:c0f972361605 | 93 | I8 LastButton; |
csyang2 |
1:c0f972361605 | 94 | I8 NoAction; |
csyang2 |
1:c0f972361605 | 95 | U8 State; // Pressed state |
csyang2 |
1:c0f972361605 | 96 | } SPINBOX_OBJ; |
csyang2 |
1:c0f972361605 | 97 | |
csyang2 |
1:c0f972361605 | 98 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 99 | * |
csyang2 |
1:c0f972361605 | 100 | * Macros for internal use |
csyang2 |
1:c0f972361605 | 101 | * |
csyang2 |
1:c0f972361605 | 102 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 103 | */ |
csyang2 |
1:c0f972361605 | 104 | #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL |
csyang2 |
1:c0f972361605 | 105 | #define SPINBOX_INIT_ID(p) (p->Widget.DebugId = SPINBOX_ID) |
csyang2 |
1:c0f972361605 | 106 | #else |
csyang2 |
1:c0f972361605 | 107 | #define SPINBOX_INIT_ID(p) |
csyang2 |
1:c0f972361605 | 108 | #endif |
csyang2 |
1:c0f972361605 | 109 | |
csyang2 |
1:c0f972361605 | 110 | #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL |
csyang2 |
1:c0f972361605 | 111 | SPINBOX_OBJ * SPINBOX_LockH(SPINBOX_Handle h); |
csyang2 |
1:c0f972361605 | 112 | #define SPINBOX_LOCK_H(h) SPINBOX_LockH(h) |
csyang2 |
1:c0f972361605 | 113 | #else |
csyang2 |
1:c0f972361605 | 114 | #define SPINBOX_LOCK_H(h) (SPINBOX_OBJ *)GUI_LOCK_H(h) |
csyang2 |
1:c0f972361605 | 115 | #endif |
csyang2 |
1:c0f972361605 | 116 | |
csyang2 |
1:c0f972361605 | 117 | #define SPINBOX_BUTTON_NONE -1 |
csyang2 |
1:c0f972361605 | 118 | #define SPINBOX_BUTTON_0 0 |
csyang2 |
1:c0f972361605 | 119 | #define SPINBOX_BUTTON_1 1 |
csyang2 |
1:c0f972361605 | 120 | |
csyang2 |
1:c0f972361605 | 121 | #define SPINBOX_TIMER_ID 1234 |
csyang2 |
1:c0f972361605 | 122 | |
csyang2 |
1:c0f972361605 | 123 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 124 | * |
csyang2 |
1:c0f972361605 | 125 | * Private function prototypes |
csyang2 |
1:c0f972361605 | 126 | * |
csyang2 |
1:c0f972361605 | 127 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 128 | */ |
csyang2 |
1:c0f972361605 | 129 | void SPINBOX__ApplyProps (SPINBOX_Handle hObj, SPINBOX_SKINFLEX_PROPS * const * ppProps); |
csyang2 |
1:c0f972361605 | 130 | void SPINBOX__DrawBk (SPINBOX_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 131 | void SPINBOX__GetButtonRect (SPINBOX_Handle hObj, GUI_RECT * pButtonRect, U8 ButtonIndex); |
csyang2 |
1:c0f972361605 | 132 | void SPINBOX__GetButtonRectEx(SPINBOX_Handle hObj, WIDGET_ITEM_DRAW_INFO * ItemInfo); |
csyang2 |
1:c0f972361605 | 133 | int SPINBOX__GetDefaultMax (void); |
csyang2 |
1:c0f972361605 | 134 | int SPINBOX__GetDefaultMin (void); |
csyang2 |
1:c0f972361605 | 135 | |
csyang2 |
1:c0f972361605 | 136 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 137 | * |
csyang2 |
1:c0f972361605 | 138 | * Module internal data |
csyang2 |
1:c0f972361605 | 139 | * |
csyang2 |
1:c0f972361605 | 140 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 141 | */ |
csyang2 |
1:c0f972361605 | 142 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 143 | * |
csyang2 |
1:c0f972361605 | 144 | * Public data (internal defaults) |
csyang2 |
1:c0f972361605 | 145 | * |
csyang2 |
1:c0f972361605 | 146 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 147 | */ |
csyang2 |
1:c0f972361605 | 148 | extern SPINBOX_PROPS SPINBOX__DefaultProps; |
csyang2 |
1:c0f972361605 | 149 | extern const WIDGET_SKIN SPINBOX__SkinClassic; |
csyang2 |
1:c0f972361605 | 150 | extern WIDGET_SKIN SPINBOX__Skin; |
csyang2 |
1:c0f972361605 | 151 | extern const WIDGET_SKIN * SPINBOX__pSkinDefault; |
csyang2 |
1:c0f972361605 | 152 | |
csyang2 |
1:c0f972361605 | 153 | #endif // GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 154 | #endif // SPINBOX_PRIVATE_H |
csyang2 |
1:c0f972361605 | 155 | |
csyang2 |
1:c0f972361605 | 156 | /*************************** End of file ****************************/ |