Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
Embed:
(wiki syntax)
Show/hide line numbers
CHECKBOX.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 : CHECKBOX.h 00040 Purpose : CHECKBOX include 00041 --------------------END-OF-HEADER------------------------------------- 00042 */ 00043 00044 #ifndef CHECKBOX_H 00045 #define CHECKBOX_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 * 00066 * Color indices 00067 */ 00068 #define CHECKBOX_CI_DISABLED 0 00069 #define CHECKBOX_CI_ENABLED 1 00070 00071 /********************************************************************* 00072 * 00073 * Bitmap indices 00074 */ 00075 #define CHECKBOX_BI_INACTIV_UNCHECKED 0 00076 #define CHECKBOX_BI_ACTIV_UNCHECKED 1 00077 #define CHECKBOX_BI_INACTIV_CHECKED 2 00078 #define CHECKBOX_BI_ACTIV_CHECKED 3 00079 #define CHECKBOX_BI_INACTIV_3STATE 4 00080 #define CHECKBOX_BI_ACTIV_3STATE 5 00081 00082 /********************************************************************* 00083 * 00084 * Skinning property indices 00085 */ 00086 #define CHECKBOX_SKINFLEX_PI_ENABLED 0 00087 #define CHECKBOX_SKINFLEX_PI_DISABLED 1 00088 00089 /********************************************************************* 00090 * 00091 * Public Types 00092 * 00093 ********************************************************************** 00094 */ 00095 typedef WM_HMEM CHECKBOX_Handle; 00096 00097 typedef struct { 00098 GUI_COLOR aColorFrame[3]; 00099 GUI_COLOR aColorInner[2]; 00100 GUI_COLOR ColorCheck; 00101 int ButtonSize; 00102 } CHECKBOX_SKINFLEX_PROPS; 00103 00104 /********************************************************************* 00105 * 00106 * Create functions 00107 * 00108 ********************************************************************** 00109 */ 00110 CHECKBOX_Handle CHECKBOX_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); 00111 CHECKBOX_Handle CHECKBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); 00112 CHECKBOX_Handle CHECKBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); 00113 CHECKBOX_Handle CHECKBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); 00114 00115 /********************************************************************* 00116 * 00117 * The callback ... 00118 * 00119 * Do not call it directly ! It is only to be used from within an 00120 * overwritten callback. 00121 */ 00122 void CHECKBOX_Callback(WM_MESSAGE * pMsg); 00123 00124 /********************************************************************* 00125 * 00126 * Managing default values 00127 * 00128 ********************************************************************** 00129 */ 00130 00131 int CHECKBOX_GetDefaultAlign (void); 00132 GUI_COLOR CHECKBOX_GetDefaultBkColor (void); 00133 const GUI_FONT * CHECKBOX_GetDefaultFont (void); 00134 int CHECKBOX_GetDefaultSpacing (void); 00135 int CHECKBOX_GetDefaultTextAlign (void); 00136 GUI_COLOR CHECKBOX_GetDefaultTextColor (void); 00137 int CHECKBOX_GetUserData (CHECKBOX_Handle hObj, void * pDest, int NumBytes); 00138 void CHECKBOX_SetDefaultAlign (int Align); 00139 void CHECKBOX_SetDefaultBkColor (GUI_COLOR Color); 00140 GUI_COLOR CHECKBOX_SetDefaultFocusColor(GUI_COLOR Color); 00141 void CHECKBOX_SetDefaultFont (const GUI_FONT * pFont); 00142 void CHECKBOX_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index); 00143 void CHECKBOX_SetDefaultSpacing (int Spacing); 00144 void CHECKBOX_SetDefaultTextAlign (int Align); 00145 void CHECKBOX_SetDefaultTextColor (GUI_COLOR Color); 00146 00147 /********************************************************************* 00148 * 00149 * Member functions 00150 * 00151 ********************************************************************** 00152 */ 00153 GUI_COLOR CHECKBOX_GetBkColor (CHECKBOX_Handle hObj); 00154 GUI_COLOR CHECKBOX_GetBoxBkColor(CHECKBOX_Handle hObj, int Index); 00155 GUI_COLOR CHECKBOX_GetFocusColor(CHECKBOX_Handle hObj); 00156 const GUI_FONT * CHECKBOX_GetFont (CHECKBOX_Handle hObj); 00157 const GUI_BITMAP * CHECKBOX_GetImage (CHECKBOX_Handle hObj, unsigned int Index); 00158 int CHECKBOX_GetState (CHECKBOX_Handle hObj); 00159 int CHECKBOX_GetText (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen); 00160 int CHECKBOX_GetTextAlign (CHECKBOX_Handle hObj); 00161 GUI_COLOR CHECKBOX_GetTextColor (CHECKBOX_Handle hObj); 00162 int CHECKBOX_IsChecked (CHECKBOX_Handle hObj); 00163 void CHECKBOX_SetBkColor (CHECKBOX_Handle hObj, GUI_COLOR Color); 00164 GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index); 00165 GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color); 00166 void CHECKBOX_SetFont (CHECKBOX_Handle hObj, const GUI_FONT * pFont); 00167 void CHECKBOX_SetImage (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index); 00168 void CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates); 00169 void CHECKBOX_SetSpacing (CHECKBOX_Handle hObj, unsigned Spacing); 00170 void CHECKBOX_SetState (CHECKBOX_Handle hObj, unsigned State); 00171 void CHECKBOX_SetText (CHECKBOX_Handle hObj, const char * pText); 00172 void CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align); 00173 void CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color); 00174 int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes); 00175 00176 /********************************************************************* 00177 * 00178 * Member functions: Skinning 00179 * 00180 ********************************************************************** 00181 */ 00182 void CHECKBOX_GetSkinFlexProps (CHECKBOX_SKINFLEX_PROPS * pProps, int Index); 00183 void CHECKBOX_SetSkinClassic (CHECKBOX_Handle hObj); 00184 void CHECKBOX_SetSkin (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00185 int CHECKBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); 00186 void CHECKBOX_SetSkinFlexProps (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index); 00187 void CHECKBOX_SetDefaultSkinClassic (void); 00188 int CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj); 00189 void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize); 00190 WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00191 00192 #define CHECKBOX_SKIN_FLEX CHECKBOX_DrawSkinFlex 00193 00194 /********************************************************************* 00195 * 00196 * Macros for compatibility 00197 * 00198 ********************************************************************** 00199 */ 00200 00201 #define CHECKBOX_Check(hObj) CHECKBOX_SetState(hObj, 1) 00202 #define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0) 00203 00204 #define CHECKBOX_BI_INACTIV CHECKBOX_BI_INACTIV_CHECKED 00205 #define CHECKBOX_BI_ACTIV CHECKBOX_BI_ACTIV_CHECKED 00206 00207 #if defined(__cplusplus) 00208 } 00209 #endif 00210 00211 #endif // GUI_WINSUPPORT 00212 #endif // CHECKBOX_H 00213 00214 /*************************** End of file ****************************/
Generated on Mon Mar 4 2024 07:48:13 by 1.7.2