RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SCROLLBAR.h Source File

SCROLLBAR.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        : SCROLLBAR.h
00040 Purpose     : SCROLLBAR include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef SCROLLBAR_H
00045 #define SCROLLBAR_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 #define SCROLLBAR_CI_THUMB 0
00064 #define SCROLLBAR_CI_SHAFT 1
00065 #define SCROLLBAR_CI_ARROW 2
00066 
00067 /*********************************************************************
00068 *
00069 *       States
00070 */
00071 #define SCROLLBAR_STATE_PRESSED   WIDGET_STATE_USER0
00072 
00073 /*********************************************************************
00074 *
00075 *       Create / Status flags
00076 */
00077 #define SCROLLBAR_CF_VERTICAL     WIDGET_CF_VERTICAL
00078 #define SCROLLBAR_CF_FOCUSSABLE   WIDGET_STATE_FOCUSSABLE
00079 
00080 /************************************************************
00081 *
00082 *       Skinning property indices
00083 */
00084 #define SCROLLBAR_SKINFLEX_PI_PRESSED   0
00085 #define SCROLLBAR_SKINFLEX_PI_UNPRESSED 1
00086 
00087 /*********************************************************************
00088 *
00089 *       Public Types
00090 *
00091 **********************************************************************
00092 */
00093 typedef WM_HMEM SCROLLBAR_Handle;
00094 
00095 typedef struct {
00096   GUI_COLOR aColorFrame[3];
00097   GUI_COLOR aColorUpper[2];
00098   GUI_COLOR aColorLower[2];
00099   GUI_COLOR aColorShaft[2];
00100   GUI_COLOR ColorArrow;
00101   GUI_COLOR ColorGrasp;
00102 } SCROLLBAR_SKINFLEX_PROPS;
00103 
00104 typedef struct {
00105   int IsVertical;
00106   int State;
00107 } SCROLLBAR_SKINFLEX_INFO;
00108 
00109 /*********************************************************************
00110 *
00111 *       Create functions
00112 *
00113 **********************************************************************
00114 */
00115 SCROLLBAR_Handle SCROLLBAR_Create        (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags);
00116 SCROLLBAR_Handle SCROLLBAR_CreateAttached(WM_HWIN hParent, int SpecialFlags);
00117 SCROLLBAR_Handle SCROLLBAR_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
00118 SCROLLBAR_Handle SCROLLBAR_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
00119 SCROLLBAR_Handle SCROLLBAR_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00120 
00121 /*********************************************************************
00122 *
00123 *       The callback ...
00124 *
00125 * Do not call it directly ! It is only to be used from within an
00126 * overwritten callback.
00127 */
00128 void SCROLLBAR_Callback(WM_MESSAGE * pMsg);
00129 
00130 /*********************************************************************
00131 *
00132 *       Member functions
00133 *
00134 **********************************************************************
00135 */
00136 
00137 /* Methods changing properties */
00138 
00139 void      SCROLLBAR_AddValue   (SCROLLBAR_Handle hObj, int Add);
00140 void      SCROLLBAR_Dec        (SCROLLBAR_Handle hObj);
00141 void      SCROLLBAR_Inc        (SCROLLBAR_Handle hObj);
00142 int       SCROLLBAR_GetUserData(SCROLLBAR_Handle hObj, void * pDest, int NumBytes);
00143 GUI_COLOR SCROLLBAR_SetColor   (SCROLLBAR_Handle hObj, int Index, GUI_COLOR Color);
00144 void      SCROLLBAR_SetNumItems(SCROLLBAR_Handle hObj, int NumItems);
00145 void      SCROLLBAR_SetPageSize(SCROLLBAR_Handle hObj, int PageSize);
00146 void      SCROLLBAR_SetValue   (SCROLLBAR_Handle hObj, int v);
00147 int       SCROLLBAR_SetWidth   (SCROLLBAR_Handle hObj, int Width);
00148 void      SCROLLBAR_SetState   (SCROLLBAR_Handle hObj, const WM_SCROLL_STATE* pState);
00149 int       SCROLLBAR_SetUserData(SCROLLBAR_Handle hObj, const void * pSrc, int NumBytes);
00150 
00151 /*********************************************************************
00152 *
00153 *       Member functions: Skinning
00154 *
00155 **********************************************************************
00156 */
00157 void SCROLLBAR_GetSkinFlexProps     (SCROLLBAR_SKINFLEX_PROPS * pProps, int Index);
00158 void SCROLLBAR_SetSkinClassic       (SCROLLBAR_Handle hObj);
00159 void SCROLLBAR_SetSkin              (SCROLLBAR_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00160 int  SCROLLBAR_DrawSkinFlex         (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00161 void SCROLLBAR_SetSkinFlexProps     (const SCROLLBAR_SKINFLEX_PROPS * pProps, int Index);
00162 void SCROLLBAR_SetDefaultSkinClassic(void);
00163 WIDGET_DRAW_ITEM_FUNC * SCROLLBAR_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00164 
00165 #define SCROLLBAR_SKIN_FLEX    SCROLLBAR_DrawSkinFlex
00166 
00167 /*********************************************************************
00168 *
00169 *       Managing default values
00170 *
00171 **********************************************************************
00172 */
00173 int       SCROLLBAR_GetDefaultWidth(void);
00174 GUI_COLOR SCROLLBAR_SetDefaultColor(GUI_COLOR Color, unsigned int Index); /* Not yet documented */
00175 int       SCROLLBAR_SetDefaultWidth(int DefaultWidth);
00176 
00177 /*********************************************************************
00178 *
00179 *       Global functions
00180 *
00181 **********************************************************************
00182 */
00183 int       SCROLLBAR_GetThumbSizeMin(void);
00184 int       SCROLLBAR_SetThumbSizeMin(int ThumbSizeMin);
00185 
00186 /*********************************************************************
00187 *
00188 *       Query state
00189 *
00190 **********************************************************************
00191 */
00192 int SCROLLBAR_GetNumItems(SCROLLBAR_Handle hObj);
00193 int SCROLLBAR_GetPageSize(SCROLLBAR_Handle hObj);
00194 int SCROLLBAR_GetValue   (SCROLLBAR_Handle hObj);
00195 
00196 /*********************************************************************
00197 *
00198 *       Macros for compatibility
00199 *
00200 **********************************************************************
00201 */
00202 #define SCROLLBAR_BKCOLOR0_DEFAULT SCROLLBAR_COLOR_ARROW_DEFAULT
00203 #define SCROLLBAR_BKCOLOR1_DEFAULT SCROLLBAR_COLOR_SHAFT_DEFAULT
00204 #define SCROLLBAR_COLOR0_DEFAULT   SCROLLBAR_COLOR_THUMB_DEFAULT
00205 
00206 #if defined(__cplusplus)
00207   }
00208 #endif
00209 
00210 #endif  // GUI_WINSUPPORT
00211 #endif  // SCROLLBAR_H
00212 
00213 /*************************** End of file ****************************/