NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TEXT.h Source File

TEXT.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        : TEXT.h
00040 Purpose     : TEXT include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef TEXT_H
00045 #define TEXT_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      /* Req. for Create indirect data structure */
00049 #include "WIDGET.h"
00050 #include "GUI_Debug.h"
00051 
00052 #if GUI_WINSUPPORT
00053 
00054 #if defined(__cplusplus)
00055   extern "C" {     /* Make sure we have C-declarations in C++ programs */
00056 #endif
00057 
00058 /************************************************************
00059 *
00060 *       #defines
00061 *
00062 *************************************************************
00063 */
00064 
00065 /************************************************************
00066 *
00067 *       Create / Status flags
00068 */
00069 #define TEXT_CF_LEFT    GUI_TA_LEFT
00070 #define TEXT_CF_RIGHT   GUI_TA_RIGHT
00071 #define TEXT_CF_HCENTER GUI_TA_HCENTER
00072 
00073 #define TEXT_CF_VCENTER GUI_TA_VCENTER
00074 #define TEXT_CF_TOP     GUI_TA_TOP
00075 #define TEXT_CF_BOTTOM  GUI_TA_BOTTOM
00076 
00077 
00078 /*********************************************************************
00079 *
00080 *       Public Types
00081 *
00082 **********************************************************************
00083 
00084 */
00085 typedef WM_HMEM TEXT_Handle;
00086 
00087 /*********************************************************************
00088 *
00089 *       Create functions
00090 *
00091 **********************************************************************
00092 */
00093 TEXT_Handle TEXT_Create        (int x0, int y0, int xSize, int ySize, int Id, int Flags, const char * s, int Align);
00094 TEXT_Handle TEXT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, const char * s, int Align);
00095 TEXT_Handle TEXT_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pText);
00096 TEXT_Handle TEXT_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pText, int NumExtraBytes);
00097 TEXT_Handle TEXT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00098 
00099 /*********************************************************************
00100 *
00101 *       The callback ...
00102 *
00103 * Do not call it directly ! It is only to be used from within an
00104 * overwritten callback.
00105 */
00106 void TEXT_Callback(WM_MESSAGE * pMsg);
00107 
00108 /*********************************************************************
00109 *
00110 *       Member functions
00111 *
00112 **********************************************************************
00113 */
00114 
00115 /* Methods changing properties */
00116 
00117 GUI_COLOR        TEXT_GetBkColor  (TEXT_Handle hObj); 
00118 const GUI_FONT * TEXT_GetFont     (TEXT_Handle hObj);
00119 int              TEXT_GetNumLines (TEXT_Handle hObj);
00120 int              TEXT_GetText     (TEXT_Handle hObj, char * pDest, U32 BufferSize);
00121 int              TEXT_GetTextAlign(TEXT_Handle hObj);
00122 GUI_COLOR        TEXT_GetTextColor(TEXT_Handle hObj);
00123 int              TEXT_GetUserData (TEXT_Handle hObj, void * pDest, int NumBytes);
00124 GUI_WRAPMODE     TEXT_GetWrapMode (TEXT_Handle hObj);
00125 void             TEXT_SetBkColor  (TEXT_Handle hObj, GUI_COLOR Color);
00126 void             TEXT_SetFont     (TEXT_Handle hObj, const GUI_FONT * pFont);
00127 int              TEXT_SetDec      (TEXT_Handle hObj, I32 v, U8 Len, U8 Shift, U8 Signed, U8 Space);
00128 int              TEXT_SetText     (TEXT_Handle hObj, const char * s);
00129 void             TEXT_SetTextAlign(TEXT_Handle hObj, int Align);
00130 void             TEXT_SetTextColor(TEXT_Handle hObj, GUI_COLOR Color);
00131 int              TEXT_SetUserData (TEXT_Handle hObj, const void * pSrc, int NumBytes);
00132 void             TEXT_SetWrapMode (TEXT_Handle hObj, GUI_WRAPMODE WrapMode);
00133 
00134 /*********************************************************************
00135 *
00136 *       Managing default values
00137 *
00138 **********************************************************************
00139 */
00140 
00141 const GUI_FONT * TEXT_GetDefaultFont     (void);
00142 GUI_COLOR        TEXT_GetDefaultTextColor(void);
00143 GUI_WRAPMODE     TEXT_GetDefaultWrapMode (void);
00144 void             TEXT_SetDefaultFont     (const GUI_FONT * pFont);
00145 void             TEXT_SetDefaultTextColor(GUI_COLOR Color);
00146 GUI_WRAPMODE     TEXT_SetDefaultWrapMode (GUI_WRAPMODE WrapMode);
00147 
00148 #if defined(__cplusplus)
00149   }
00150 #endif
00151 
00152 #endif  // GUI_WINSUPPORT
00153 #endif  // TEXT_H
00154 
00155 /*************************** End of file ****************************/