提交 2aeee86c 编写于 作者: B bernard.xiong

fix backspace issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1257 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 1f46f9da
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2009-10-16 Bernard first version * 2009-10-16 Bernard first version
* 2011-01-224 Bernard fix backspace issue.
*/ */
#include <rtgui/dc.h> #include <rtgui/dc.h>
#include <rtgui/rtgui_theme.h> #include <rtgui/rtgui_theme.h>
...@@ -166,7 +167,7 @@ static void rtgui_textbox_onkey(struct rtgui_textbox* box, struct rtgui_event_kb ...@@ -166,7 +167,7 @@ static void rtgui_textbox_onkey(struct rtgui_textbox* box, struct rtgui_event_kb
} }
else if (event->key == RTGUIK_BACKSPACE) else if (event->key == RTGUIK_BACKSPACE)
{ {
if (box->position == length - 1) if ((box->position == length - 1) && length != 1)
{ {
box->text[box->position] = '\0'; box->text[box->position] = '\0';
box->position --; box->position --;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册