Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG_patch mbed-rtos mbed
BUTTON.h
00001 /********************************************************************* 00002 * SEGGER Microcontroller GmbH & Co. KG * 00003 * Solutions for real time microcontroller applications * 00004 ********************************************************************** 00005 * * 00006 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG * 00007 * * 00008 * Internet: www.segger.com Support: support@segger.com * 00009 * * 00010 ********************************************************************** 00011 00012 ** emWin V5.28 - 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 STMicroelectronics International 00019 N.V. a Dutch company with a Swiss branch and its headquarters in Plan- 00020 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the 00021 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_ 00022 troller products commercialized by Licensee only, sublicensed and dis_ 00023 tributed under the terms and conditions of the End User License Agree_ 00024 ment supplied by STMicroelectronics International N.V. 00025 Full source code is available at: www.segger.com 00026 00027 We appreciate your understanding and fairness. 00028 ---------------------------------------------------------------------- 00029 File : BUTTON.h 00030 Purpose : BUTTON public header file (API) 00031 --------------------END-OF-HEADER------------------------------------- 00032 */ 00033 00034 #ifndef BUTTON_H 00035 #define BUTTON_H 00036 00037 #include "WM.h" 00038 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ 00039 #include "WIDGET.h" 00040 00041 #if GUI_WINSUPPORT 00042 00043 #if defined(__cplusplus) 00044 extern "C" { /* Make sure we have C-declarations in C++ programs */ 00045 #endif 00046 00047 /********************************************************************* 00048 * 00049 * Create flags 00050 */ 00051 /* For compatibility only ! */ 00052 #define BUTTON_CF_HIDE WM_CF_HIDE 00053 #define BUTTON_CF_SHOW WM_CF_SHOW 00054 #define BUTTON_CF_MEMDEV WM_CF_MEMDEV 00055 00056 /********************************************************************* 00057 * 00058 * Color indices 00059 */ 00060 #define BUTTON_CI_UNPRESSED 0 00061 #define BUTTON_CI_PRESSED 1 00062 #define BUTTON_CI_DISABLED 2 00063 00064 /********************************************************************* 00065 * 00066 * Bitmap indices 00067 */ 00068 #define BUTTON_BI_UNPRESSED 0 00069 #define BUTTON_BI_PRESSED 1 00070 #define BUTTON_BI_DISABLED 2 00071 00072 /********************************************************************* 00073 * 00074 * States 00075 */ 00076 #define BUTTON_STATE_FOCUS WIDGET_STATE_FOCUS 00077 #define BUTTON_STATE_PRESSED WIDGET_STATE_USER0 00078 00079 /********************************************************************* 00080 * 00081 * Skinning property indices 00082 */ 00083 #define BUTTON_SKINFLEX_PI_PRESSED 0 00084 #define BUTTON_SKINFLEX_PI_FOCUSSED 1 00085 #define BUTTON_SKINFLEX_PI_ENABLED 2 00086 #define BUTTON_SKINFLEX_PI_DISABLED 3 00087 00088 /********************************************************************* 00089 * 00090 * Types 00091 * 00092 ********************************************************************** 00093 */ 00094 typedef WM_HMEM BUTTON_Handle; 00095 00096 typedef struct { 00097 GUI_COLOR aColorFrame[3]; 00098 GUI_COLOR aColorUpper[2]; 00099 GUI_COLOR aColorLower[2]; 00100 int Radius; 00101 } BUTTON_SKINFLEX_PROPS; 00102 00103 /********************************************************************* 00104 * 00105 * Create function(s) 00106 00107 Note: the parameters to a create function may vary. 00108 Some widgets may have multiple create functions 00109 */ 00110 00111 BUTTON_Handle BUTTON_Create (int x0, int y0, int xSize, int ySize, int ID, int Flags); 00112 BUTTON_Handle BUTTON_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); 00113 BUTTON_Handle BUTTON_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); 00114 BUTTON_Handle BUTTON_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); 00115 BUTTON_Handle BUTTON_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); 00116 00117 /********************************************************************* 00118 * 00119 * Standard member functions 00120 * 00121 ********************************************************************** 00122 */ 00123 GUI_COLOR BUTTON_GetDefaultBkColor (unsigned Index); 00124 const GUI_FONT * BUTTON_GetDefaultFont (void); 00125 int BUTTON_GetDefaultTextAlign (void); 00126 GUI_COLOR BUTTON_GetDefaultTextColor (unsigned Index); 00127 void BUTTON_SetDefaultBkColor (GUI_COLOR Color, unsigned Index); 00128 GUI_COLOR BUTTON_SetDefaultFocusColor(GUI_COLOR Color); 00129 void BUTTON_SetDefaultFont (const GUI_FONT * pFont); 00130 void BUTTON_SetDefaultTextAlign (int Align); 00131 void BUTTON_SetDefaultTextColor (GUI_COLOR Color, unsigned Index); 00132 00133 #define BUTTON_EnableMemdev(hObj) WM_EnableMemdev (hObj) 00134 #define BUTTON_DisableMemdev(hObj) WM_DisableMemdev (hObj) 00135 #define BUTTON_Delete(hObj) WM_DeleteWindow (hObj) 00136 #define BUTTON_Paint(hObj) WM_Paint (hObj) 00137 #define BUTTON_Invalidate(hObj) WM_InvalidateWindow(hObj) 00138 00139 /********************************************************************* 00140 * 00141 * The callback ... 00142 * 00143 * Do not call it directly ! It is only to be used from within an 00144 * overwritten callback. 00145 */ 00146 void BUTTON_Callback(WM_MESSAGE *pMsg); 00147 00148 /********************************************************************* 00149 * 00150 * Member functions 00151 * 00152 ********************************************************************** 00153 */ 00154 GUI_COLOR BUTTON_GetBkColor (BUTTON_Handle hObj, unsigned int Index); 00155 const GUI_BITMAP * BUTTON_GetBitmap(BUTTON_Handle hObj,unsigned int Index); 00156 const GUI_FONT * BUTTON_GetFont (BUTTON_Handle hObj); 00157 GUI_COLOR BUTTON_GetFrameColor (BUTTON_Handle hObj); 00158 WIDGET * BUTTON_GetpWidget (BUTTON_Handle hObj); 00159 void BUTTON_GetText (BUTTON_Handle hObj, char * pBuffer, int MaxLen); 00160 GUI_COLOR BUTTON_GetTextColor (BUTTON_Handle hObj, unsigned int Index); 00161 int BUTTON_GetTextAlign (BUTTON_Handle hObj); 00162 int BUTTON_GetUserData (BUTTON_Handle hObj, void * pDest, int NumBytes); 00163 unsigned BUTTON_IsPressed (BUTTON_Handle hObj); 00164 void BUTTON_SetBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap); 00165 void BUTTON_SetBitmapEx (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap, int x, int y); 00166 void BUTTON_SetBkColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color); 00167 void BUTTON_SetBMP (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap); 00168 void BUTTON_SetBMPEx (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap, int x, int y); 00169 void BUTTON_SetFont (BUTTON_Handle hObj, const GUI_FONT * pfont); 00170 void BUTTON_SetFrameColor (BUTTON_Handle hObj, GUI_COLOR Color); 00171 void BUTTON_SetState (BUTTON_Handle hObj, int State); /* Not to be doc. */ 00172 void BUTTON_SetPressed (BUTTON_Handle hObj, int State); 00173 GUI_COLOR BUTTON_SetFocusColor (BUTTON_Handle hObj, GUI_COLOR Color); 00174 void BUTTON_SetFocussable (BUTTON_Handle hObj, int State); 00175 void BUTTON_SetStreamedBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap); 00176 void BUTTON_SetStreamedBitmapEx(BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap, int x, int y); 00177 int BUTTON_SetText (BUTTON_Handle hObj, const char* s); 00178 void BUTTON_SetTextAlign (BUTTON_Handle hObj, int Align); 00179 void BUTTON_SetTextColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color); 00180 void BUTTON_SetTextOffset (BUTTON_Handle hObj, int xPos, int yPos); 00181 void BUTTON_SetSelfDrawEx (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw, int x, int y); /* Not to be doc. */ 00182 void BUTTON_SetSelfDraw (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw); /* Not to be doc. */ 00183 void BUTTON_SetReactOnLevel (void); 00184 void BUTTON_SetReactOnTouch (void); 00185 int BUTTON_SetUserData (BUTTON_Handle hObj, const void * pSrc, int NumBytes); 00186 00187 /********************************************************************* 00188 * 00189 * Member functions: Skinning 00190 * 00191 ********************************************************************** 00192 */ 00193 void BUTTON_GetSkinFlexProps (BUTTON_SKINFLEX_PROPS * pProps, int Index); 00194 void BUTTON_SetSkinClassic (BUTTON_Handle hObj); 00195 void BUTTON_SetSkin (BUTTON_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00196 int BUTTON_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); 00197 void BUTTON_SetSkinFlexProps (const BUTTON_SKINFLEX_PROPS * pProps, int Index); 00198 void BUTTON_SetDefaultSkinClassic(void); 00199 WIDGET_DRAW_ITEM_FUNC * BUTTON_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00200 00201 #define BUTTON_SKIN_FLEX BUTTON_DrawSkinFlex 00202 00203 #if defined(__cplusplus) 00204 } 00205 #endif 00206 00207 #endif // GUI_WINSUPPORT 00208 #endif // BUTTON_H 00209 00210 /*************************** End of file ****************************/
Generated on Tue Jul 12 2022 14:57:24 by
1.7.2