NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SLIDER.h Source File

SLIDER.h

00001 /*********************************************************************
00002 *                 SEGGER Software GmbH                               *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2018  SEGGER Microcontroller GmbH                *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.48 - 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 by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
00019 for the purposes  of  creating  libraries  for its 
00020 Arm Cortex-M and  Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
00021 under  the terms and conditions  of  an  End  User  
00022 License  Agreement  supplied  with  the libraries.
00023 Full source code is available at: www.segger.com
00024 
00025 We appreciate your understanding and fairness.
00026 ----------------------------------------------------------------------
00027 Licensing information
00028 Licensor:                 SEGGER Software GmbH
00029 Licensed to:              Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
00030 Licensed SEGGER software: emWin
00031 License number:           GUI-00735
00032 License model:            emWin License Agreement, signed February 27, 2018
00033 Licensed platform:        Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
00034 ----------------------------------------------------------------------
00035 Support and Update Agreement (SUA)
00036 SUA period:               2018-03-26 - 2019-03-27
00037 Contact to extend SUA:    sales@segger.com
00038 ----------------------------------------------------------------------
00039 File        : SLIDER.h
00040 Purpose     : SLIDER include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef SLIDER_H
00045 #define SLIDER_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      /* Req. for Create indirect data structure */
00049 #include "WIDGET.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 #if defined(__cplusplus)
00054   extern "C" {     /* Make sure we have C-declarations in C++ programs */
00055 #endif
00056 
00057 /************************************************************
00058 *
00059 *       Defines
00060 *
00061 *************************************************************
00062 */
00063 /************************************************************
00064 *
00065 *       States
00066 */
00067 #define SLIDER_STATE_PRESSED    WIDGET_STATE_USER0
00068 
00069 /************************************************************
00070 *
00071 *       Create / Status flags
00072 */
00073 #define SLIDER_CF_HORIZONTAL 0
00074 #define SLIDER_CF_VERTICAL   WIDGET_CF_VERTICAL
00075 
00076 /************************************************************
00077 *
00078 *       Skinning property indices
00079 */
00080 #define SLIDER_SKINFLEX_PI_PRESSED   0
00081 #define SLIDER_SKINFLEX_PI_UNPRESSED 1
00082 
00083 /*********************************************************************
00084 *
00085 *       Public Types
00086 *
00087 **********************************************************************
00088 */
00089 typedef WM_HMEM SLIDER_Handle;
00090 
00091 typedef struct {
00092   GUI_COLOR aColorFrame[2];
00093   GUI_COLOR aColorInner[2];
00094   GUI_COLOR aColorShaft[3];
00095   GUI_COLOR ColorTick;
00096   GUI_COLOR ColorFocus;
00097   int TickSize;
00098   int ShaftSize;
00099 } SLIDER_SKINFLEX_PROPS;
00100 
00101 typedef struct {
00102   int Width;
00103   int NumTicks;
00104   int Size;
00105   int IsPressed;
00106   int IsVertical;
00107 } SLIDER_SKINFLEX_INFO;
00108 
00109 /*********************************************************************
00110 *
00111 *       Create functions
00112 *
00113 **********************************************************************
00114 */
00115 SLIDER_Handle SLIDER_Create        (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags);
00116 SLIDER_Handle SLIDER_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
00117 SLIDER_Handle SLIDER_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
00118 SLIDER_Handle SLIDER_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00119 
00120 /*********************************************************************
00121 *
00122 *       The callback ...
00123 *
00124 * Do not call it directly ! It is only to be used from within an
00125 * overwritten callback.
00126 */
00127 void SLIDER_Callback(WM_MESSAGE * pMsg);
00128 
00129 /*********************************************************************
00130 *
00131 *       Member functions
00132 *
00133 **********************************************************************
00134 */
00135 void      SLIDER_Dec            (SLIDER_Handle hObj);
00136 void      SLIDER_EnableFocusRect(SLIDER_Handle hObj, int OnOff);
00137 GUI_COLOR SLIDER_GetBarColor    (SLIDER_Handle hObj);
00138 GUI_COLOR SLIDER_GetBkColor     (SLIDER_Handle hObj);
00139 U8        SLIDER_GetFlag        (SLIDER_Handle hObj, U8 Flag);
00140 GUI_COLOR SLIDER_GetFocusColor  (SLIDER_Handle hObj);
00141 void      SLIDER_GetRange       (SLIDER_Handle hObj, int * pMin, int * pMax);
00142 GUI_COLOR SLIDER_GetTickColor   (SLIDER_Handle hObj);
00143 int       SLIDER_GetUserData    (SLIDER_Handle hObj, void * pDest, int NumBytes);
00144 int       SLIDER_GetValue       (SLIDER_Handle hObj);
00145 void      SLIDER_Inc            (SLIDER_Handle hObj);
00146 void      SLIDER_SetBarColor    (SLIDER_Handle hObj, GUI_COLOR Color);
00147 void      SLIDER_SetBkColor     (SLIDER_Handle hObj, GUI_COLOR Color);
00148 GUI_COLOR SLIDER_SetFocusColor  (SLIDER_Handle hObj, GUI_COLOR Color);
00149 void      SLIDER_SetNumTicks    (SLIDER_Handle hObj, int NumTicks);
00150 void      SLIDER_SetRange       (SLIDER_Handle hObj, int Min, int Max);
00151 void      SLIDER_SetTickColor   (SLIDER_Handle hObj, GUI_COLOR Color);
00152 int       SLIDER_SetUserData    (SLIDER_Handle hObj, const void * pSrc, int NumBytes);
00153 void      SLIDER_SetValue       (SLIDER_Handle hObj, int v);
00154 void      SLIDER_SetWidth       (SLIDER_Handle hObj, int Width);
00155 
00156 /*********************************************************************
00157 *
00158 *       Member functions: Skinning
00159 *
00160 **********************************************************************
00161 */
00162 void SLIDER_GetSkinFlexProps     (SLIDER_SKINFLEX_PROPS * pProps, int Index);
00163 void SLIDER_SetSkinClassic       (SLIDER_Handle hObj);
00164 void SLIDER_SetSkin              (SLIDER_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00165 int  SLIDER_DrawSkinFlex         (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00166 void SLIDER_SetSkinFlexProps     (const SLIDER_SKINFLEX_PROPS * pProps, int Index);
00167 void SLIDER_SetDefaultSkinClassic(void);
00168 WIDGET_DRAW_ITEM_FUNC * SLIDER_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00169 
00170 #define SLIDER_SKIN_FLEX    SLIDER_DrawSkinFlex
00171 
00172 /*********************************************************************
00173 *
00174 *       Managing default values
00175 *
00176 **********************************************************************
00177 */
00178 GUI_COLOR SLIDER_GetDefaultBkColor   (void);
00179 GUI_COLOR SLIDER_GetDefaultBarColor  (void);
00180 GUI_COLOR SLIDER_GetDefaultFocusColor(void);
00181 GUI_COLOR SLIDER_GetDefaultTickColor (void);
00182 void      SLIDER_SetDefaultBkColor   (GUI_COLOR Color);
00183 void      SLIDER_SetDefaultBarColor  (GUI_COLOR Color);
00184 GUI_COLOR SLIDER_SetDefaultFocusColor(GUI_COLOR Color);
00185 void      SLIDER_SetDefaultTickColor (GUI_COLOR Color);
00186 
00187 #if defined(__cplusplus)
00188   }
00189 #endif
00190 
00191 #endif  // GUI_WINSUPPORT
00192 #endif  // SLIDER_H
00193 
00194 /*************************** End of file ****************************/