add get_path routine in filelist view.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@341 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
b1e6049e8c
commit
5a71b3c5fa
|
@ -479,8 +479,8 @@ void rtgui_theme_draw_textbox(rtgui_textbox_t* box)
|
|||
rt_size_t len = rt_strlen(box->text);
|
||||
if (len > 0)
|
||||
{
|
||||
char *text_mask = rtgui_malloc(len);
|
||||
rt_memset(text_mask, '*', len);
|
||||
char *text_mask = rtgui_malloc(len + 1);
|
||||
rt_memset(text_mask, '*', len + 1);
|
||||
text_mask[len] = 0;
|
||||
rtgui_dc_draw_text(dc, text_mask, &rect);
|
||||
rt_free(text_mask);
|
||||
|
|
|
@ -53,4 +53,6 @@ void rtgui_filelist_view_clear(rtgui_filelist_view_t* view);
|
|||
rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
|
||||
void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory);
|
||||
|
||||
void rtgui_filelist_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -683,3 +683,11 @@ __return:
|
|||
/* update view */
|
||||
rtgui_widget_update(RTGUI_WIDGET(view));
|
||||
}
|
||||
|
||||
void rtgui_filelist_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len)
|
||||
{
|
||||
RT_ASSERT(view != RT_NULL);
|
||||
|
||||
rt_sprintf(path, "%s/%s", view->current_directory,
|
||||
view->items[view->current_item].name);
|
||||
}
|
|
@ -110,4 +110,7 @@ void rtgui_label_set_text(rtgui_label_t* label, const unsigned char* text)
|
|||
|
||||
if (text != RT_NULL) label->text = (unsigned char*)rt_strdup((const char*)text);
|
||||
else label->text = RT_NULL;
|
||||
|
||||
/* update widget */
|
||||
rtgui_theme_draw_label(label);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue