From 9a0db072e15e3a38e5d32a0fcdc97ba730044f69 Mon Sep 17 00:00:00 2001 From: Polarix Date: Sun, 9 Feb 2020 22:58:56 +0800 Subject: [PATCH] 2020-02-04: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正一些资源中的错误字符。 修正非ASCII无法正常解码和显示的BUG。 --- DemoProc/inc/DemoResource_GB2312.h | 4 ++-- DemoProc/inc/Resource.h | 7 +++++-- GUI/inc/SGUI_Config.h | 1 + GUI/inc/SGUI_Text.h | 1 - GUI/src/SGUI_Text.c | 2 +- VirtualSDK/Common/inc/Common.h | 8 ++++++++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/DemoProc/inc/DemoResource_GB2312.h b/DemoProc/inc/DemoResource_GB2312.h index 0bcc0f1..cfd379a 100644 --- a/DemoProc/inc/DemoResource_GB2312.h +++ b/DemoProc/inc/DemoResource_GB2312.h @@ -24,7 +24,7 @@ /* Screen 4: Variable box. */ #define SCR4_VAR_BOX_TITLE ("") -#define SCR4_HELP_NOTICE ("Press TAB to switch focus.\nUp&Down to change value\nSend \"SPACE\" to continue.") +#define SCR4_HELP_NOTICE ("Press TAB to switch focus.\nUp&Down to change value.\nSend \"SPACE\" to continue.") /* Screen 5: Realtime graph. */ #define SCR5_RT_GRAPH_TITLE ("Realtime graph") @@ -44,6 +44,6 @@ #define SCR6_SUB_MENU_ITEM4 ("Sub 4") /* Screen 7: Notice box. */ -#define SCR7_NOTICE_TEXT ("һϢʾûͼꡣ") +#define SCR7_NOTICE_TEXT ("ӭʹSimpleGUI") #endif // _INCLUDE_DEMO_RESOURCE_UTF8_H_ diff --git a/DemoProc/inc/Resource.h b/DemoProc/inc/Resource.h index ffc844a..e58dbf2 100644 --- a/DemoProc/inc/Resource.h +++ b/DemoProc/inc/Resource.h @@ -2,9 +2,12 @@ #define _INCLUDE_RESOURCE_H_ #include "SGUI_Typedef.h" -#include "DemoResource_UTF8.h" -//#include "DemoResource_ASCII.h" +#ifdef _SIMPLE_GUI_DEMO_ONLY_ASCII_ +#include "DemoResource_ASCII.h" +#else //#include "DemoResource_GB2312.h" +#include "DemoResource_UTF8.h" +#endif extern const SGUI_FONT_RES GB2312_FZXS12; diff --git a/GUI/inc/SGUI_Config.h b/GUI/inc/SGUI_Config.h index d77cfda..2f90283 100644 --- a/GUI/inc/SGUI_Config.h +++ b/GUI/inc/SGUI_Config.h @@ -10,6 +10,7 @@ #define _SIMPLE_GUI_ENCODE_TEXT_DEST_ ("GB2312") #endif // _SIMPLE_GUI_ENCODE_TEXT_ #define _SIMPLE_GUI_IN_VIRTUAL_SDK_ +//#define _SIMPLE_GUI_USE_SYS_PF_FUNCTIONS_ //=======================================================================// //= Used for SimpleGUI interface. =// diff --git a/GUI/inc/SGUI_Text.h b/GUI/inc/SGUI_Text.h index acf91b6..9b32f07 100644 --- a/GUI/inc/SGUI_Text.h +++ b/GUI/inc/SGUI_Text.h @@ -30,7 +30,6 @@ extern SGUI_CSZSTR SGUI_EMPTY_STRING; void SGUI_Text_GetTextExtent(SGUI_CSZSTR cszTextBuffer, const SGUI_FONT_RES* pstFontRes, SGUI_AREA_SIZE* pstTextExtent); void SGUI_Text_DrawText(SGUI_SCR_DEV* pstDeviceIF, SGUI_CSZSTR cszTextBuffer, const SGUI_FONT_RES* pstFontRes, SGUI_RECT* pstDisplayArea, SGUI_POINT* pstInnerPos, SGUI_DRAW_MODE eFontMode); SGUI_SIZE SGUI_Text_DrawMultipleLinesText(SGUI_SCR_DEV* pstDeviceIF, SGUI_CSZSTR szTextBuffer, const SGUI_FONT_RES* pstFontRes, SGUI_RECT* pstDisplayArea, SGUI_INT iTopOffset, SGUI_DRAW_MODE eFontMode); -SGUI_SIZE SGUI_Text_GetTextGraphicsWidth(SGUI_CSZSTR szText, const SGUI_FONT_RES* pstFontRes); SGUI_SIZE SGUI_Text_GetMultiLineTextLines(SGUI_CSZSTR cszText, const SGUI_FONT_RES* pstFontRes, SGUI_SIZE uiDisplayAreaWidth); SGUI_SIZE SGUI_Text_GetCharacterData(const SGUI_FONT_RES* pstFontRes, SGUI_UINT32 uiCode, SGUI_BYTE* pDataBuffer, SGUI_SIZE sBufferSize); diff --git a/GUI/src/SGUI_Text.c b/GUI/src/SGUI_Text.c index f32d52c..b3d8306 100644 --- a/GUI/src/SGUI_Text.c +++ b/GUI/src/SGUI_Text.c @@ -56,7 +56,7 @@ void SGUI_Text_GetTextExtent(SGUI_CSZSTR cszText, const SGUI_FONT_RES* pstFontRe { uiCharacterCode = 0; pcChar = pstFontRes->fnStepNext(pcChar, &uiCharacterCode); - if(SGUI_IS_VISIBLE_CHAR(uiCharacterCode)) + if('\0' !=uiCharacterCode) { pstTextExtent->iWidth+=(pstFontRes->fnIsFullWidth(uiCharacterCode)?pstFontRes->iFullWidth:pstFontRes->iHalfWidth); } diff --git a/VirtualSDK/Common/inc/Common.h b/VirtualSDK/Common/inc/Common.h index a4bd579..ef423a9 100644 --- a/VirtualSDK/Common/inc/Common.h +++ b/VirtualSDK/Common/inc/Common.h @@ -12,9 +12,17 @@ //=======================================================================// #define _TRANS_TEXT(STR) _(STR) +// OLED +/* #define LCD_COLOR_OBJ_PIX (0xFFF8FE99) #define LCD_COLOR_OBJ_BKG (0xFF2C1916) #define LCD_COLOR_OBJ_GRID (0xFF482F0C) +*/ + +#define LCD_COLOR_OBJ_PIX (0xFFFEF159) +#define LCD_COLOR_OBJ_BKG (0xFFFF3C24) +#define LCD_COLOR_OBJ_GRID (0xFFCC1209) + #define PARAM_DEFAULT_PIXEL_NUM_H (128) #define PARAM_DEFAULT_PIXEL_NUM_V (64)