RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CHECKBOX.h Source File

CHECKBOX.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        : 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 
00154 int       CHECKBOX_GetState     (CHECKBOX_Handle hObj);
00155 int       CHECKBOX_GetText      (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen);
00156 int       CHECKBOX_IsChecked    (CHECKBOX_Handle hObj);
00157 void      CHECKBOX_SetBkColor   (CHECKBOX_Handle hObj, GUI_COLOR Color);
00158 GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index);
00159 GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color);
00160 void      CHECKBOX_SetFont      (CHECKBOX_Handle hObj, const GUI_FONT * pFont);
00161 void      CHECKBOX_SetImage     (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index);
00162 void      CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates);
00163 void      CHECKBOX_SetSpacing   (CHECKBOX_Handle hObj, unsigned Spacing);
00164 void      CHECKBOX_SetState     (CHECKBOX_Handle hObj, unsigned State);
00165 void      CHECKBOX_SetText      (CHECKBOX_Handle hObj, const char * pText);
00166 void      CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align);
00167 void      CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
00168 int       CHECKBOX_SetUserData  (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes);
00169 
00170 /*********************************************************************
00171 *
00172 *       Member functions: Skinning
00173 *
00174 **********************************************************************
00175 */
00176 void CHECKBOX_GetSkinFlexProps      (CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
00177 void CHECKBOX_SetSkinClassic        (CHECKBOX_Handle hObj);
00178 void CHECKBOX_SetSkin               (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00179 int  CHECKBOX_DrawSkinFlex          (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00180 void CHECKBOX_SetSkinFlexProps      (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
00181 void CHECKBOX_SetDefaultSkinClassic (void);
00182 int  CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj);
00183 void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize);
00184 WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00185 
00186 #define CHECKBOX_SKIN_FLEX    CHECKBOX_DrawSkinFlex
00187 
00188 /*********************************************************************
00189 *
00190 *       Macros for compatibility
00191 *
00192 **********************************************************************
00193 */
00194 
00195 #define CHECKBOX_Check(hObj)   CHECKBOX_SetState(hObj, 1)
00196 #define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0)
00197 
00198 #define CHECKBOX_BI_INACTIV    CHECKBOX_BI_INACTIV_CHECKED
00199 #define CHECKBOX_BI_ACTIV      CHECKBOX_BI_ACTIV_CHECKED
00200 
00201 #if defined(__cplusplus)
00202   }
00203 #endif
00204 
00205 #endif  // GUI_WINSUPPORT
00206 #endif  // CHECKBOX_H
00207 
00208 /*************************** End of file ****************************/