RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SPINBOX_Private.h Source File

SPINBOX_Private.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights  in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product.  This file may
00016 only be used in accordance with the following terms:
00017 
00018 The software has been licensed to  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP End User License
00023 Agreement.
00024 Full source code is available at: www.segger.com
00025 
00026 We appreciate your understanding and fairness.
00027 ----------------------------------------------------------------------
00028 Licensing information
00029 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : SPINBOX_Private.h
00040 Purpose     : Private SPINBOX include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef SPINBOX_PRIVATE_H
00045 #define SPINBOX_PRIVATE_H
00046 
00047 #include "SPINBOX.h"
00048 #include "EDIT.h"
00049 #include "GUI_Private.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 /*********************************************************************
00054 *
00055 *       Private config defaults
00056 *
00057 **********************************************************************
00058 */
00059 
00060 /*********************************************************************
00061 *
00062 *       Object definition
00063 *
00064 **********************************************************************
00065 */
00066 typedef struct {
00067   WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
00068 } SPINBOX_SKIN_PRIVATE;
00069 
00070 typedef struct {
00071   GUI_COLOR            aButtonBkColor[3];    // Button background color for the states (disabled, pressed, unpressed).
00072   GUI_COLOR            aButtonUpperColor[3]; // Upper color for the button states (disabled, pressed, unpressed).
00073   GUI_COLOR            aButtonLowerColor[3]; // Lower color for the button states (disabled, pressed, unpressed).
00074   GUI_COLOR            aButtonOuterColor[3]; // Outer color for the button states (disabled, pressed, unpressed).
00075   GUI_COLOR            aTriangleColor[3];    // Color of the triangle for the button states (disabled, pressed, unpressed).
00076   GUI_COLOR            aBkColor[2];          // Background color for the states (enabled, disabled).
00077   GUI_COLOR            aTextColor[2];        // Text       color for the states (enabled, disabled).
00078   I32                  Min;                  // Minimum allowed value.
00079   I32                  Max;                  // Maximum allowed value.
00080   U16                  Step;                 // Value will be increased/decreased by this amount when a button is clicked.
00081   U16                  ButtonSize;           // Size of the button depending on the orientation.
00082   U8                   Edge;                 // Buttons reside on the left or right edge of the widget.
00083   SPINBOX_SKIN_PRIVATE SkinPrivate;          // Structure containing a pointer to the used DrawSkin-function.
00084 } SPINBOX_PROPS;
00085 
00086 typedef struct {
00087   WIDGET              Widget;
00088   SPINBOX_PROPS       Props;
00089   const WIDGET_SKIN * pWidgetSkin;
00090   EDIT_Handle         hEdit;
00091   GUI_TIMER_HANDLE    hTimer;
00092   I8                  TimerButton;
00093   I8                  LastButton;
00094   I8                  NoAction;
00095   U8                  State;       // Pressed state
00096 } SPINBOX_OBJ;
00097 
00098 /*********************************************************************
00099 *
00100 *       Macros for internal use
00101 *
00102 **********************************************************************
00103 */
00104 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00105   #define SPINBOX_INIT_ID(p) (p->Widget.DebugId = SPINBOX_ID)
00106 #else
00107   #define SPINBOX_INIT_ID(p)
00108 #endif
00109 
00110 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00111   SPINBOX_OBJ * SPINBOX_LockH(SPINBOX_Handle h);
00112   #define SPINBOX_LOCK_H(h)   SPINBOX_LockH(h)
00113 #else
00114   #define SPINBOX_LOCK_H(h)   (SPINBOX_OBJ *)GUI_LOCK_H(h)
00115 #endif
00116 
00117 #define SPINBOX_BUTTON_NONE     -1
00118 #define SPINBOX_BUTTON_0         0
00119 #define SPINBOX_BUTTON_1         1
00120 
00121 #define SPINBOX_TIMER_ID         1234
00122 
00123 /*********************************************************************
00124 *
00125 *       Private function prototypes
00126 *
00127 **********************************************************************
00128 */
00129 void SPINBOX__ApplyProps     (SPINBOX_Handle hObj, SPINBOX_SKINFLEX_PROPS * const * ppProps);
00130 void SPINBOX__DrawBk         (SPINBOX_Handle hObj, GUI_COLOR   Color);
00131 void SPINBOX__GetButtonRect  (SPINBOX_Handle hObj, GUI_RECT  * pButtonRect, U8  ButtonIndex);
00132 void SPINBOX__GetButtonRectEx(SPINBOX_Handle hObj, WIDGET_ITEM_DRAW_INFO * ItemInfo);
00133 int  SPINBOX__GetDefaultMax  (void);
00134 int  SPINBOX__GetDefaultMin  (void);
00135 
00136 /*********************************************************************
00137 *
00138 *       Module internal data
00139 *
00140 **********************************************************************
00141 */
00142 /*********************************************************************
00143 *
00144 *       Public data (internal defaults)
00145 *
00146 **********************************************************************
00147 */
00148 extern       SPINBOX_PROPS   SPINBOX__DefaultProps;
00149 extern const WIDGET_SKIN     SPINBOX__SkinClassic;
00150 extern       WIDGET_SKIN     SPINBOX__Skin;
00151 extern const WIDGET_SKIN   * SPINBOX__pSkinDefault;
00152 
00153 #endif  // GUI_WINSUPPORT
00154 #endif  // SPINBOX_PRIVATE_H
00155 
00156 /*************************** End of file ****************************/