RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SLIDER.h Source File

SLIDER.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        : 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 ****************************/