From b157884f8d6c5d4e793a283340aa6d740dcda09d Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Wed, 28 Nov 2012 21:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/LCUI/LCUI_Font.h | 3 ++- include/LCUI/LCUI_ScrollBar.h | 19 +++++++++++++++++++ include/LCUI/LCUI_TextBox.h | 11 +++++++++-- include/LCUI/LCUI_Widget.h | 3 +++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/include/LCUI/LCUI_Font.h b/include/LCUI/LCUI_Font.h index eb365495..356dbd05 100755 --- a/include/LCUI/LCUI_Font.h +++ b/include/LCUI/LCUI_Font.h @@ -212,7 +212,8 @@ struct _LCUI_TextLayer BOOL using_style_tags :1; /* 指示是否处理样式标签 */ BOOL enable_word_wrap :1; /* 指示是否自动换行 */ BOOL enable_multiline :1; /* 指示是否为多行文本图层部件 */ - BOOL need_proc_buff :1; + BOOL need_proc_buff :1; /* 指示是否处理缓冲区内的文本 */ + BOOL need_scroll_layer :1; /* 指示是否需要滚动图层 */ BOOL have_select : 1; /* 标记,指示是否在文本图层中选择了文本 */ uint32_t start, end; /* 被选中的文本的范围 */ diff --git a/include/LCUI/LCUI_ScrollBar.h b/include/LCUI/LCUI_ScrollBar.h index 847c0a86..c4308f66 100644 --- a/include/LCUI/LCUI_ScrollBar.h +++ b/include/LCUI/LCUI_ScrollBar.h @@ -44,6 +44,17 @@ LCUI_BEGIN_HEADER +typedef struct _ScrollBar_Data +{ + /* 这两个控制滑块的位置 */ + int max_num; + int current_num; + /* 这两个控制滑块的宽度 */ + int max_size; + int current_size; +} +ScrollBar_Data; + LCUI_Widget * Get_ScrollBar( LCUI_Widget *widget ); @@ -62,6 +73,14 @@ ScrollBar_Set_CurrentSize( LCUI_Widget *widget, int current_size ); void ScrollBar_Set_Direction( LCUI_Widget *widget, int direction ); +void +ScrollBar_Connect( + LCUI_Widget *widget, + void (*callback_func)( ScrollBar_Data, void* ), + void *arg + ); +/* 将回调函数与滚动条部件连接 */ + LCUI_END_HEADER #endif diff --git a/include/LCUI/LCUI_TextBox.h b/include/LCUI/LCUI_TextBox.h index b0a3b3f7..ded4a905 100644 --- a/include/LCUI/LCUI_TextBox.h +++ b/include/LCUI/LCUI_TextBox.h @@ -55,6 +55,9 @@ TextBox_Get_Cursor( LCUI_Widget *widget ); void TextBox_Text(LCUI_Widget *widget, char *new_text); /* 设定文本框显示的文本 */ +void TextBox_TextLayer_Set_Offset( LCUI_Widget *widget, LCUI_Pos offset_pos ); +/* 为文本框内的文本图层设置偏移 */ + void TextBox_Text_Add(LCUI_Widget *widget, char *new_text); /* 在光标处添加文本 */ @@ -64,9 +67,13 @@ int TextBox_Text_Backspace(LCUI_Widget *widget, int n); int TextBox_Text_Delete(LCUI_Widget *widget, int n); /* 删除光标右边处n个字符 */ -void +LCUI_Pos TextBox_Cursor_Update( LCUI_Widget *widget ); -/* 更新文本框的光标 */ +/* 更新文本框的光标,返回该光标的像素坐标 */ + +void +TextBox_Cursor_Move( LCUI_Widget *widget, LCUI_Pos new_pos ); +/* 移动文本框内的光标 */ int TextBox_Get_Select_Text( LCUI_Widget *widget, char *out_text ); /* 获取文本框内被选中的文本 */ diff --git a/include/LCUI/LCUI_Widget.h b/include/LCUI/LCUI_Widget.h index ba25c0fa..1759bdb6 100755 --- a/include/LCUI/LCUI_Widget.h +++ b/include/LCUI/LCUI_Widget.h @@ -324,6 +324,9 @@ void Widget_AutoSize( LCUI_Widget *widget, BOOL flag, AUTOSIZE_MODE mode ); void Exec_Refresh_Widget(LCUI_Widget *widget); /* 功能:执行刷新显示指定部件的整个区域图形的操作 */ +void Exec_Update_Widget(LCUI_Widget *widget); +/* 功能:执行部件的更新操作 */ + void Exec_Draw_Widget(LCUI_Widget *widget); /* 功能:执行部件图形更新操作 */