⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui.h

📁 uCGUI
💻 H
📖 第 1 页 / 共 4 页
字号:
/*************************************************************************************************************
                                                   uC/GUI
                                               嵌入式通用图形软件
文    件: GUI.H
描    述: Include file for 2DGL incl. character related routines.
Attention   : 不要修改此文件!如果你这样做,你将无法更新到版本emWin !
************************************************************************************************************/
#ifndef  GUI_H
	#define  GUI_H
	#define __EMWIN_GSC__   /* Allow "C" to find out that emWin GSC is used */
	
	#if defined(__cplusplus)
		extern "C" {     /* Make sure we have C-declarations in C++ programs */
	#endif
	
	#include "GUITYPE.H"
	#include "GUICONF.H"
	#if GUI_WINSUPPORT
	  #include "WM.h"
	#endif
	#define GUI_VERSION 32404
	
	/*************************************************************************************************************
	* Defaults for config switches--默认配置开关
	*************************************************************************************************************/
	#ifndef GUI_SUPPORT_TOUCH
	  #define GUI_SUPPORT_TOUCH   0
	#endif
	
	#ifndef GUI_SUPPORT_MOUSE
	  #define GUI_SUPPORT_MOUSE   0
	#endif
	
	#ifndef GUI_SUPPORT_MEMDEV
	  #define GUI_SUPPORT_MEMDEV  0
	#endif
	
	#ifndef GUI_SUPPORT_CURSOR
	  #define GUI_SUPPORT_CURSOR  GUI_SUPPORT_MOUSE
	#endif
	
	#ifndef GUI_OS
	  #define GUI_OS              0
	#endif
	
	#ifndef GUI_DEFAULT_FONT
	  #define GUI_DEFAULT_FONT    &GUI_Font6x8
	#endif
	
	#ifndef GUI_DEFAULT_BKCOLOR
	  #define GUI_DEFAULT_BKCOLOR GUI_BLACK
	#endif
	
	#ifndef GUI_DEFAULT_COLOR
	  #define GUI_DEFAULT_COLOR   GUI_WHITE
	#endif
	
	#ifndef GUI_SUPPORT_UNICODE
	  #define GUI_SUPPORT_UNICODE 0
	#endif
	
	/* In order to avoid warnings for undefined parameters */
	#ifndef GUI_USE_PARA
	  #ifdef __BORLANDC__
	    #define GUI_USE_PARA(para)
	  #else
	    #define GUI_USE_PARA(para) para=para;
	  #endif
	#endif
	
	/************************************************************************************************************
	* GUI_FLASH allows to put constants into a special memory area For most CPUs, this is not necessary hence 
	* the default is "".
	* (This makes sense for CPUs like ATMEL AT90 or 8051, where default pointers are unable to reach ROM/FLASH 
	* memory in some memory models)
	************************************************************************************************************/
	#ifndef GUI_FLASH
	  #define GUI_FLASH
	#endif
	
	#ifndef GUI_FAR
	  #define GUI_FAR
	#endif
	
	/* Default for types */
	#ifndef GUI_TIMER_TIME
	  #define GUI_TIMER_TIME int  /* default is to use 16 bits for 16 bit CPUs, 32 bits on 32 bit CPUs for timing */
	#endif
	
	#ifndef GUI_COMPATIBLE_MODE
	  #define GUI_COMPATIBLE_MODE 1
	#endif
	
	/*************************************************************************************************************
	* Limitations for certain C51 Keil  (__C51__)
	*************************************************************************************************************/
	#if defined (__C51__) && GUI_SUPPORT_MEMDEV
	  #error __C51__ (Keil) can not support function pointers sufficiently !  -> Disable memory devices  -> GUI_SUPPORT_MEMDEV 0
	#endif
	
	/*************************************************************************************************************
	* macros, function replacement
	*************************************************************************************************************/
	#define GUI_COUNTOF(a) (sizeof(a) / sizeof(a[0]))
	
	/*************************************************************************************************************
	* GUI_KEY_... These ID values are basically meant to be used with widgets
	*************************************************************************************************************/
	#define GUI_KEY_BACKSPACE         8         /* ASCII: BACKSPACE Crtl-H */
	#define GUI_KEY_TAB               9         /* ASCII: TAB       Crtl-I */
	#define GUI_KEY_ENTER             13        /* ASCII: ENTER     Crtl-M */
	#define GUI_KEY_LEFT              16
	#define GUI_KEY_UP                17
	#define GUI_KEY_RIGHT             18
	#define GUI_KEY_DOWN              19
	#define GUI_KEY_HOME              23
	#define GUI_KEY_END               24
	#define GUI_KEY_SHIFT             25
	#define GUI_KEY_CONTROL           26
	#define GUI_KEY_ESCAPE            27        /* ASCII: ESCAPE    0x1b   */
	#define GUI_KEY_INSERT            29
	#define GUI_KEY_DELETE            30
	
	
	/*************************************************************************************************************
	* Dialog item IDs--对话框项目ID
	*  The IDs below are arbitrary values. They just have to be unique within the dialog.
	*  If you use your own Ids, we recommend to use values above GUI_ID_USER.
	*************************************************************************************************************/
	#define GUI_ID_OK                			1
	#define GUI_ID_CANCEL            			2
	#define GUI_ID_YES               			3
	#define GUI_ID_NO                			4
	#define GUI_ID_CLOSE             			5
	#define GUI_ID_HELP              			6
	
	#define GUI_ID_VSCROLL  							0xFE
	#define GUI_ID_HSCROLL  							0xFF
	                        							
	#define GUI_ID_EDIT0    							0x100
	#define GUI_ID_EDIT1    							0x101
	#define GUI_ID_EDIT2    							0x102
	#define GUI_ID_EDIT3    							0x103
	#define GUI_ID_EDIT4    							0x104
	#define GUI_ID_EDIT5    							0x105
	#define GUI_ID_EDIT6    							0x106
	#define GUI_ID_EDIT7    							0x107
	#define GUI_ID_EDIT8    							0x108
	#define GUI_ID_EDIT9    							0x109
	                        							
	#define GUI_ID_LISTBOX0 							0x110
	#define GUI_ID_LISTBOX1 							0x111
	#define GUI_ID_LISTBOX2 							0x112
	#define GUI_ID_LISTBOX3 							0x113
	#define GUI_ID_LISTBOX4 							0x114
	#define GUI_ID_LISTBOX5 							0x115
	#define GUI_ID_LISTBOX6 							0x116
	#define GUI_ID_LISTBOX7 							0x117
	#define GUI_ID_LISTBOX8 							0x118
	#define GUI_ID_LISTBOX9 							0x119
	                        							
	#define GUI_ID_CHECK0   							0x120
	#define GUI_ID_CHECK1   							0x121
	#define GUI_ID_CHECK2   							0x122
	#define GUI_ID_CHECK3   							0x123
	#define GUI_ID_CHECK4   							0x124
	#define GUI_ID_CHECK5   							0x125
	#define GUI_ID_CHECK6   							0x126
	#define GUI_ID_CHECK7   							0x127
	#define GUI_ID_CHECK8   							0x128
	                        							
	#define GUI_ID_SLIDER0  							0x130
	#define GUI_ID_SLIDER1  							0x131
	#define GUI_ID_SLIDER2  							0x132
	#define GUI_ID_SLIDER3  							0x133
	#define GUI_ID_SLIDER4  							0x134
	#define GUI_ID_SLIDER5  							0x135
	#define GUI_ID_SLIDER6  							0x136
	#define GUI_ID_SLIDER7  							0x137
	#define GUI_ID_SLIDER8  							0x138
	#define GUI_ID_SLIDER9  							0x139
	
	#define GUI_ID_SCROLLBAR0 						0x140
	#define GUI_ID_SCROLLBAR1 						0x141
	#define GUI_ID_SCROLLBAR2 						0x142
	#define GUI_ID_SCROLLBAR3 						0x142
	                          						
	#define GUI_ID_RADIO0 								0x150
	#define GUI_ID_RADIO1 								0x151
	#define GUI_ID_RADIO2 								0x152
	#define GUI_ID_RADIO3 								0x152
	                        							
	#define GUI_ID_USER     							0x800
	
	/*************************************************************************************************************
	* Constants  needed for GL
	*************************************************************************************************************/
	
	/*************************************************************************************************************
	* Linestyles
	*************************************************************************************************************/
	#define GUI_LS_SOLID        (0)
	#define GUI_LS_DASH         (1)
	#define GUI_LS_DOT          (2)
	#define GUI_LS_DASHDOT      (3)
	#define GUI_LS_DASHDOTDOT   (4)
		
	/*************************************************************************************************************
	* Pen shapes
	*************************************************************************************************************/
	#define GUI_PS_ROUND        (0)
	#define GUI_PS_FLAT         (1)
	#define GUI_PS_SQUARE       (2)
		
	/*************************************************************************************************************
	* Standard colors
	*************************************************************************************************************/
	#define GUI_BLACK           0x000000
	#define GUI_BLUE            0xFF0000
	#define GUI_GREEN           0x00ff00
	#define GUI_CYAN            0xffff00
	#define GUI_RED             0x0000FF
	#define GUI_MAGENTA         0x8b008b
	#define GUI_BROWN           0x2a2aa5
	#define GUI_DARKGRAY        0x404040
	#define GUI_GRAY            0x808080
	#define GUI_LIGHTGRAY       0xd3d3d3
	#define GUI_LIGHTBLUE       0xff8080
	#define GUI_LIGHTGREEN      0x80ff80
	#define GUI_LIGHTCYAN       0x80ffff
	#define GUI_LIGHTRED        0x8080ff
	#define GUI_LIGHTMAGENTA    0xff80ff
	#define GUI_YELLOW          0x00ffff
	#define GUI_WHITE           0xffffff
	#define GUI_INVALID_COLOR   0xfffffff      /* Invalid color - more than 24 bits */
	
	/*************************************************************************************************************
	* Coordinates
	*************************************************************************************************************/
	#define GUI_COORD_X 0
	#define GUI_COORD_Y 1
	
	/*************************************************************************************************************
	* UNICODE support macros
	*************************************************************************************************************/
	#define GUI_UC_STARTCHAR     0x1a
	#define GUI_UC_ENDCHAR       0xe2
	#define GUI_UC_STARTSTRING   "\x1a"
	#define GUI_UC_ENDSTRING     "\xe2"
	#define GUI_UC_START         GUI_UC_STARTSTRING
	#define GUI_UC_END           GUI_UC_ENDSTRING
	#define GUI_UC_NL            "\xe0\x0a"
	
	
	/*************************************************************************************************************
	* Standard Fonts supplied with emWin
	* Note: The external declarations for the fonts are now also included in this file.
	*************************************************************************************************************/
	/* Proportional fonts */
	extern const GUI_FONT GUI_Font8_ASCII,        GUI_Font8_1;
	extern const GUI_FONT GUI_Font10S_ASCII,      GUI_Font10S_1;
	extern const GUI_FONT GUI_Font10_ASCII,       GUI_Font10_1;
	extern const GUI_FONT GUI_Font13_ASCII,       GUI_Font13_1;
	extern const GUI_FONT GUI_Font13B_ASCII,      GUI_Font13B_1;
	extern const GUI_FONT GUI_Font13H_ASCII,      GUI_Font13H_1;
	extern const GUI_FONT GUI_Font13HB_ASCII,     GUI_Font13HB_1;
	extern const GUI_FONT GUI_Font16_ASCII,       GUI_Font16_1, GUI_Font16_HK, GUI_Font16_1HK;
	extern const GUI_FONT GUI_Font16B_ASCII,      GUI_Font16B_1;
	extern const GUI_FONT GUI_Font24_ASCII,       GUI_Font24_1;
	extern const GUI_FONT GUI_Font24B_ASCII,      GUI_Font24B_1;
	extern const GUI_FONT GUI_Font32_ASCII,       GUI_Font32_1;
	extern const GUI_FONT GUI_Font32B_ASCII,      GUI_Font32B_1;
	
	/* Monospaced */
	extern const GUI_FONT GUI_Font4x6;
	extern const GUI_FONT GUI_Font6x8,            GUI_Font6x9;
	extern const GUI_FONT GUI_Font8x8,            GUI_Font8x9;
	extern const GUI_FONT GUI_Font8x10_ASCII;
	extern const GUI_FONT GUI_Font8x12_ASCII;
	extern const GUI_FONT GUI_Font8x13_ASCII,     GUI_Font8x13_1;
	extern const GUI_FONT GUI_Font8x15B_ASCII,    GUI_Font8x15B_1;
	extern const GUI_FONT GUI_Font8x16,           GUI_Font8x17,       GUI_Font8x18;
	extern const GUI_FONT GUI_Font8x16x1x2,       GUI_Font8x16x2x2,   GUI_Font8x16x3x3;
	
	/* Digits */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -