NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EDIT_Private.h Source File

EDIT_Private.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        : EDIT_Private.h
00040 Purpose     : Internal header file
00041 ---------------------------END-OF-HEADER------------------------------
00042 */
00043 
00044 #ifndef EDIT_PRIVATE_H
00045 #define EDIT_PRIVATE_H
00046 
00047 #include "EDIT.h"
00048 
00049 #if GUI_WINSUPPORT
00050 
00051 #include "WIDGET.h"
00052 
00053 /*********************************************************************
00054 *
00055 *       Defines
00056 *
00057 **********************************************************************
00058 */
00059 #define EDIT_REALLOC_SIZE  16
00060 
00061 #ifndef EDIT_XOFF
00062   #define EDIT_XOFF        1
00063 #endif
00064 
00065 /*********************************************************************
00066 *
00067 *       Types
00068 *
00069 **********************************************************************
00070 */
00071 typedef struct EDIT_Obj_struct EDIT_Obj;
00072 
00073 typedef struct {
00074   int              Align;
00075   int              Border;
00076   const GUI_FONT * pFont;
00077   GUI_COLOR        aTextColor[3];
00078   GUI_COLOR        aBkColor[3];
00079 } EDIT_PROPS;
00080 
00081 struct EDIT_Obj_struct {
00082   WIDGET               Widget;
00083   WM_HMEM              hpText;
00084   I16                  MaxLen;
00085   U16                  BufferSize;
00086   I32                  Min, Max;        // Min max values as normalized floats (integers)
00087   U8                   NumDecs;         // Number of decimals
00088   I32                  CurrentValue;    // Current value
00089   int                  CursorPos;       // Cursor position. 0 means left most
00090   unsigned             SelSize;         // Number of selected characters
00091   U8                   EditMode;        // Insert or overwrite mode
00092   U8                   XSizeCursor;     // Size of cursor when working in insert mode
00093   U8                   Flags;
00094   tEDIT_AddKeyEx     * pfAddKeyEx;      // Handle key input
00095   tEDIT_UpdateBuffer * pfUpdateBuffer;  // Update textbuffer
00096   EDIT_PROPS           Props;
00097   WM_HTIMER            hTimer;
00098   U8                   MinMaxMode;
00099   int                  TimerPeriod;
00100 };
00101 
00102 /*********************************************************************
00103 *
00104 *       Macros for internal use
00105 *
00106 **********************************************************************
00107 */
00108 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00109   #define EDIT_INIT_ID(p) (p->Widget.DebugId = EDIT_ID)
00110 #else
00111   #define EDIT_INIT_ID(p)
00112 #endif
00113 
00114 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00115   EDIT_Obj * EDIT_LockH(EDIT_Handle h);
00116   #define EDIT_LOCK_H(h)   EDIT_LockH(h)
00117 #else
00118   #define EDIT_LOCK_H(h)   (EDIT_Obj *)GUI_LOCK_H(h)
00119 #endif
00120 
00121 /*********************************************************************
00122 *
00123 *       Public data (internal defaults)
00124 *
00125 **********************************************************************
00126 */
00127 extern EDIT_PROPS EDIT__DefaultProps;
00128 
00129 /*********************************************************************
00130 *
00131 *       Public functions (internal)
00132 *
00133 **********************************************************************
00134 */
00135 U16  EDIT__GetCurrentChar  (EDIT_Obj * pObj);
00136 void EDIT__SetCursorPos    (EDIT_Handle hObj, int CursorPos);
00137 void EDIT__SetValueUnsigned(EDIT_Handle hObj, I32 Value);
00138 
00139 #endif // GUI_WINSUPPORT
00140 
00141 #endif // EDIT_PRIVATE_H
00142 
00143 /*************************** End of file ****************************/