本文整理汇总了C++中rtgui_widget_update函数的典型用法代码示例。如果您正苦于以下问题:C++ rtgui_widget_update函数的具体用法?C++ rtgui_widget_update怎么用?C++ rtgui_widget_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtgui_widget_update函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: picture_show_prev
static void picture_show_prev(void)
{
DIR* dir;
struct dirent* entry;
rt_bool_t is_last;
char fn[32];
fn[0] = '\0';
is_last = RT_FALSE;
dir = opendir(PICTURE_DIR);
if (dir == RT_NULL)
{
rt_kprintf("open directory failed\n");
return;
}
do
{
entry = readdir(dir);
if (entry != RT_NULL)
{
if (strstr(entry->d_name, ".hdc") != RT_NULL ||
strstr(entry->d_name, ".HDC") != RT_NULL ||
strstr(entry->d_name, ".bmp") != RT_NULL ||
strstr(entry->d_name, ".BMP") != RT_NULL)
{
/* it's a HDC image */
if ((strcmp(entry->d_name, current_fn) == 0) &&
is_last != RT_TRUE)
{
if (fn[0] == '\0')
{
/* it should be the last image */
is_last = RT_TRUE;
}
else
{
/* display image */
strcpy(current_fn, fn);
rtgui_widget_update(RTGUI_WIDGET(container));
closedir(dir);
return;
}
}
strcpy(fn, entry->d_name);
}
}
}
while(entry != RT_NULL);
/* close directory */
closedir(dir);
if ((is_last == RT_TRUE) && fn[0] != '\0')
{
strcpy(current_fn, fn);
rtgui_widget_update(RTGUI_WIDGET(container));
}
}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:60,代码来源:picture.c
示例2: picture_show_prev
static void picture_show_prev(struct rtgui_widget* widget)
{
DIR* dir;
struct dirent* entry;
rt_bool_t is_last;
char fn[32];
struct rtgui_image_engine* engine;
fn[0] = '\0';
is_last = RT_FALSE;
dir = opendir(PICTURE_DIR);
if (dir == RT_NULL)
{
rt_kprintf("open directory failed\n");
return;
}
do
{
entry = readdir(dir);
if (entry != RT_NULL)
{
engine = rtgui_image_get_engine_by_filename(entry->d_name);
if (engine != RT_NULL)
{
/* it's a HDC image */
if ((strcmp(entry->d_name, current_fn) == 0) &&
is_last != RT_TRUE)
{
if (fn[0] == '\0')
{
/* it should be the last image */
is_last = RT_TRUE;
}
else
{
/* display image */
strcpy(current_fn, fn);
rtgui_widget_update(widget);
closedir(dir);
return;
}
}
strcpy(fn, entry->d_name);
}
}
} while(entry != RT_NULL);
/* close directory */
closedir(dir);
if ((is_last == RT_TRUE) && fn[0] != '\0')
{
strcpy(current_fn, fn);
rtgui_widget_update(widget);
}
}
开发者ID:amsl,项目名称:RTGUI,代码行数:58,代码来源:picture.c
示例3: rtgui_combobox_onmouse_button
static rt_bool_t rtgui_combobox_onmouse_button(struct rtgui_combobox* box, struct rtgui_event_mouse* event)
{
struct rtgui_rect rect;
/* get widget rect */
rect = RTGUI_WIDGET(box)->extent;
/* move to the pull down button */
rect.x1 = rect.x2 - RTGUI_COMBOBOX_BUTTON_WIDTH;
if (rtgui_rect_contains_point(&rect, event->x, event->y) == RT_EOK)
{
/* handle mouse button on pull down button */
if (event->button & RTGUI_MOUSE_BUTTON_LEFT &&
event->button & RTGUI_MOUSE_BUTTON_DOWN)
{
box->pd_pressed = RT_TRUE;
rtgui_widget_update(RTGUI_WIDGET(box));
}
else if (event->button & RTGUI_MOUSE_BUTTON_LEFT &&
event->button & RTGUI_MOUSE_BUTTON_UP)
{
box->pd_pressed = RT_FALSE;
rtgui_widget_update(RTGUI_WIDGET(box));
/* pop pull down window */
if (box->pd_win == RT_NULL)
{
rtgui_listbox_t *list;
/* create pull down window */
rect = RTGUI_WIDGET(box)->extent;
rect.y1 = rect.y2;
rect.y2 = rect.y1 + 5 * (2 + rtgui_theme_get_selected_height());
box->pd_win = rtgui_win_create(RT_NULL, "combo", &rect, RTGUI_WIN_STYLE_NO_TITLE);
rtgui_win_set_ondeactivate(RTGUI_WIN(box->pd_win), rtgui_combobox_pulldown_hide);
/* set user data to parent combobox */
box->pd_win->user_data = (rt_uint32_t)box;
/* create list box */
rtgui_rect_inflate(&rect, -1);
list = rtgui_listbox_create(box->items, box->items_count, &rect);
rtgui_container_add_child(RTGUI_CONTAINER(box->pd_win), RTGUI_WIDGET(list));
rtgui_widget_focus(RTGUI_WIDGET(list));
rtgui_listbox_set_onitem(list, rtgui_combobox_pdwin_onitem);
rtgui_win_set_ondeactivate(box->pd_win, rtgui_combobox_pdwin_ondeactive);
}
/* show combo box pull down window */
rtgui_win_show(RTGUI_WIN(box->pd_win), RT_FALSE);
}
return RT_TRUE;
}
return RT_FALSE;
}
开发者ID:pengdonglin137,项目名称:iboot,代码行数:57,代码来源:combobox.c
示例4: rtgui_workbench_show_view
void rtgui_workbench_show_view(rtgui_workbench_t* workbench, rtgui_view_t* view)
{
RT_ASSERT(workbench != RT_NULL);
RT_ASSERT(view != RT_NULL);
/* already shown */
if (workbench->current_view == view) return;
if (workbench->current_view != RT_NULL)
{
/* hide old view */
RTGUI_WIDGET_HIDE(RTGUI_WIDGET(workbench->current_view));
}
/* show view */
RTGUI_WIDGET_UNHIDE(RTGUI_WIDGET(view));
workbench->current_view = view;
/* update workbench clip */
rtgui_toplevel_update_clip(RTGUI_TOPLEVEL(workbench));
if (!RTGUI_WIDGET_IS_HIDE(RTGUI_WIDGET(workbench)))
{
rtgui_widget_update(RTGUI_WIDGET(view));
}
}
开发者ID:520lly,项目名称:-android-source-code,代码行数:26,代码来源:workbench.c
示例5: demo_bitmap_open
void demo_bitmap_open(struct rtgui_object* object, struct rtgui_event* event)
{
char *str;
rtgui_button_t *button = RTGUI_BUTTON(object);
/* 从textbox控件中取得文件名 */
str = (char*)rtgui_textbox_get_value(bmpdt.box);
if(str == RT_NULL) return;
if(*str == '/' && (rt_strstr(str, ".bmp")!=RT_NULL || rt_strstr(str, ".BMP")!=RT_NULL))
{ /* 如果是bmp文件, 且文件名有效, 则读入图像数据 */
if(bmpdt.filename != RT_NULL)
rt_free(bmpdt.filename);
bmpdt.filename = rt_strdup(str);
if(bmpdt.image != RT_NULL)
rtgui_image_destroy(bmpdt.image);
bmpdt.image = rtgui_image_create_from_file("bmp", bmpdt.filename, RT_TRUE);
if(bmpdt.image != RT_NULL)
{
bmpdt.showimg = bmpdt.image;
bmpdt.scale = 1.0;
bmpdt.angle = 0.0;
rtgui_widget_update(RTGUI_WIDGET(bmpdt.showbox));
}
}
else
rt_kprintf("Bad filename!");
}
开发者ID:201409366,项目名称:RTGUI,代码行数:29,代码来源:demo_view_bmp.c
示例6: _rtgui_notebook_ondraw
static void _rtgui_notebook_ondraw(struct rtgui_notebook *notebook)
{
struct rtgui_dc* dc;
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(notebook));
if (dc == RT_NULL) return;
if (notebook->count == 0)
{
rtgui_rect_t rect;
rtgui_widget_get_rect(RTGUI_WIDGET(notebook), &rect);
rtgui_dc_fill_rect(dc, &rect);
}
else
{
if (notebook->current == RTGUI_NOT_FOUND)
notebook->current = 0;
_rtgui_notebook_draw_bar(notebook, dc);
/* draw current tab */
rtgui_widget_update(notebook->childs[notebook->current].widget);
}
rtgui_dc_end_drawing(dc);
}
开发者ID:fengye0316,项目名称:RTT_GPS_STUSB,代码行数:25,代码来源:notebook.c
示例7: rtgui_scrollbar_set_value
void rtgui_scrollbar_set_value(struct rtgui_scrollbar* bar, rt_int16_t position)
{
RT_ASSERT(bar != RT_NULL);
bar->thumb_position = position;
rtgui_widget_update(RTGUI_WIDGET(bar));
}
开发者ID:pengdonglin137,项目名称:iboot,代码行数:7,代码来源:scrollbar.c
示例8: rtgui_combobox_pulldown_hide
static rt_bool_t rtgui_combobox_pulldown_hide(struct rtgui_object* object, struct rtgui_event* event)
{
struct rtgui_widget *widget;
struct rtgui_combobox *box;
RT_ASSERT(object != RT_NULL);
RT_ASSERT(event != RT_NULL);
widget = RTGUI_WIDGET(object);
box = RTGUI_COMBOBOX(object);
if (widget == RT_NULL) return RT_TRUE;
box = (struct rtgui_combobox*) (((struct rtgui_win*)widget)->user_data);
if (box == RT_NULL) return RT_TRUE;
/* hide pull down window */
rtgui_win_hiden(RTGUI_WIN(box->pd_win));
/* clear pull down button state */
box->pd_pressed = RT_FALSE;
rtgui_widget_update(RTGUI_WIDGET(box));
return RT_TRUE;
}
开发者ID:cahill123,项目名称:shenzhou-iv-stm32f107-rt-thread,代码行数:25,代码来源:combobox.c
示例9: rtgui_scrollbar_set_value
/* use VALUE change be binding widget's frist item. */
void rtgui_scrollbar_set_value(rtgui_scrollbar_t* bar, rt_int16_t value)
{
RT_ASSERT(bar != RT_NULL);
bar->value = value;
if(bar->value < 0) bar->value = 0;
rtgui_widget_update(RTGUI_WIDGET(bar));
}
开发者ID:BernardXiong,项目名称:realtouch,代码行数:11,代码来源:scrollbar.c
示例10: picture_show_next
static void picture_show_next(void)
{
DIR* dir;
struct dirent* entry;
rt_bool_t found, has_image;
found = RT_FALSE;
has_image = RT_FALSE;
__restart:
dir = opendir(PICTURE_DIR);
if (dir == RT_NULL)
{
rt_kprintf("open directory failed\n");
return;
}
do
{
entry = readdir(dir);
if (entry != RT_NULL)
{
if (strstr(entry->d_name, ".hdc") != RT_NULL ||
strstr(entry->d_name, ".HDC") != RT_NULL ||
strstr(entry->d_name, ".bmp") != RT_NULL ||
strstr(entry->d_name, ".BMP") != RT_NULL)
{
/* this directory includes image */
has_image = RT_TRUE;
if (found == RT_TRUE || current_fn[0] == '\0')
{
strcpy(current_fn, entry->d_name);
rtgui_widget_update(RTGUI_WIDGET(container));
closedir(dir);
return;
}
/* it's a HDC image */
if (strcmp(entry->d_name, current_fn) == 0)
found = RT_TRUE;
}
}
}
while(entry != RT_NULL);
/* close directory */
closedir(dir);
if (has_image != RT_TRUE) return;
current_fn[0] = '\0';
goto __restart;
}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:54,代码来源:picture.c
示例11: rtgui_listbox_set_items
void rtgui_listbox_set_items(rtgui_listbox_t* box, struct rtgui_listbox_item* items, rt_uint16_t count)
{
rtgui_rect_t rect;
box->items = items;
box->items_count = count;
box->current_item = 0;
rtgui_widget_get_rect(RTGUI_WIDGET(box), &rect);
box->page_items = rtgui_rect_height(rect) / (2 + rtgui_theme_get_selected_height());
rtgui_widget_update(RTGUI_WIDGET(box));
}
开发者ID:18337129968,项目名称:-android-source-code,代码行数:13,代码来源:listbox.c
示例12: rtgui_terminal_set_text
void rtgui_terminal_set_text(rtgui_terminal_t* tma, const char* text)
{
RT_ASSERT(tma != RT_NULL);
/* calculate line width and line page count */
rtgui_terminal_calc_width(tma);
/* set text */
rtgui_terminal_calc_line(tma, text);
/* update widget */
rtgui_widget_update(RTGUI_WIDGET(tma));
}
开发者ID:amsl,项目名称:RTGUI,代码行数:13,代码来源:terminal.c
示例13: rtgui_textview_set_text
void rtgui_textview_set_text(rtgui_textview_t* textview, const char* text)
{
RT_ASSERT(textview != RT_NULL);
/* calculate line width and line page count */
_calc_width(textview);
/* set text */
_calc_line(textview, text);
/* update widget */
rtgui_widget_update(RTGUI_WIDGET(textview));
}
开发者ID:Paolo-Maffei,项目名称:rt-thread-stm32f4discovery,代码行数:13,代码来源:textview.c
示例14: rtgui_listctrl_set_items
void rtgui_listctrl_set_items(rtgui_listctrl_t* ctrl, rt_uint32_t items, rt_uint16_t count)
{
rtgui_rect_t rect;
ctrl->items = items;
ctrl->items_count = count;
ctrl->current_item = 0;
rtgui_widget_get_rect(RTGUI_WIDGET(ctrl), &rect);
ctrl->page_items = rtgui_rect_height(rect) / (2 + rtgui_theme_get_selected_height());
rtgui_widget_update(RTGUI_WIDGET(ctrl));
}
开发者ID:lyyyuna,项目名称:rtt_ex,代码行数:13,代码来源:listctrl.c
示例15: picture_show_next
static void picture_show_next(struct rtgui_widget* widget)
{
DIR* dir;
struct dirent* entry;
rt_bool_t found, has_image;
struct rtgui_image_engine* engine;
found = RT_FALSE; has_image = RT_FALSE;
__restart:
dir = opendir(PICTURE_DIR);
if (dir == RT_NULL)
{
rt_kprintf("open directory failed\n");
return;
}
do
{
entry = readdir(dir);
if (entry != RT_NULL)
{
engine = rtgui_image_get_engine_by_filename(entry->d_name);
if (engine != RT_NULL)
{
/* this directory includes image */
has_image = RT_TRUE;
if (found == RT_TRUE || current_fn[0] == '\0')
{
strcpy(current_fn, entry->d_name);
rtgui_widget_update(widget);
closedir(dir);
return;
}
/* it's a HDC image */
if (strcmp(entry->d_name, current_fn) == 0)
found = RT_TRUE;
}
}
} while(entry != RT_NULL);
/* close directory */
closedir(dir);
if (has_image != RT_TRUE) return;
current_fn[0] = '\0';
goto __restart;
}
开发者ID:amsl,项目名称:RTGUI,代码行数:51,代码来源:picture.c
示例16: rtgui_form_event_handler
static rt_bool_t rtgui_form_event_handler(struct rtgui_widget *widget, struct rtgui_event *event)
{
struct rtgui_form* form;
//struct rtgui_event_command* ecmd;
form = RTGUI_FORM(widget);
switch (event->type) {
case RTGUI_EVENT_PAINT:
rtgui_form_ondraw(form);
break;
#if 0
case RTGUI_EVENT_COMMAND:
ecmd = (struct rtgui_event_command*)event;
switch (ecmd->command_id) {
case SE_FORM_UPDATE:
if (RTGUI_WIDGET_IS_FOCUSED(RTGUI_WIDGET(se_form)))
rtgui_widget_update(RTGUI_WIDGET(se_form));
break;
case RE_FORM_UPDATE:
rtgui_widget_update(RTGUI_WIDGET(re_form));
break;
case SYS_FORM_UPDATE:
rtgui_widget_update(RTGUI_WIDGET(sys_form));
break;
}
break;
#endif
default:
/* use form event handler */
return rtgui_widget_event_handler(widget, event);
}
return RT_FALSE;
}
开发者ID:malooei,项目名称:yeejoin-workspace,代码行数:37,代码来源:form.c
示例17: diag_close
/* 关闭对话框时的回调函数 */
void diag_close(struct rtgui_timer *timer, void *parameter)
{
cnt --;
rt_sprintf(label_text, "closed then %d second!", cnt);
/* 设置标签文本并更新控件 */
rtgui_label_set_text(label, label_text);
rtgui_widget_update(RTGUI_WIDGET(label));
if (cnt == 0)
{
/* 超时,关闭对话框 */
rtgui_win_destroy(autowin);
}
}
开发者ID:EvanZheng,项目名称:RTGUI,代码行数:16,代码来源:demo_view_window.c
示例18: rtgui_listctrl_update_current
static void rtgui_listctrl_update_current(struct rtgui_listctrl *ctrl, rt_uint16_t old_item)
{
struct rtgui_dc *dc;
rtgui_rect_t rect, item_rect;
if (old_item / ctrl->page_items != ctrl->current_item / ctrl->page_items)
{
/* it's not a same page, update all */
rtgui_widget_update(RTGUI_WIDGET(ctrl));
return;
}
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(ctrl));
if (dc == RT_NULL) return;
_rtgui_listctrl_get_rect(ctrl, &rect);
rect.x2 -= 1;
rect.y2 -= 1;
item_rect = rect;
/* get old item's rect */
item_rect.x1 += 1;
item_rect.x2 -= 1;
item_rect.y1 += 2;
item_rect.y1 += (old_item % ctrl->page_items) * (2 + ctrl->item_height);
item_rect.y2 = item_rect.y1 + (2 + ctrl->item_height);
/* draw old item */
rtgui_dc_fill_rect(dc, &item_rect);
if (ctrl->on_item_draw != RT_NULL)
ctrl->on_item_draw(ctrl, dc, &item_rect, old_item);
/* draw current item */
item_rect = rect;
/* get current item's rect */
item_rect.x1 += 1;
item_rect.x2 -= 1;
item_rect.y1 += 2;
item_rect.y1 += (ctrl->current_item % ctrl->page_items) * (2 + ctrl->item_height);
item_rect.y2 = item_rect.y1 + (2 + ctrl->item_height);
/* draw current item */
rtgui_theme_draw_selected(dc, &item_rect);
if (ctrl->on_item_draw != RT_NULL)
ctrl->on_item_draw(ctrl, dc, &item_rect, ctrl->current_item);
rtgui_dc_end_drawing(dc);
}
开发者ID:KodakWang,项目名称:RTGUI,代码行数:48,代码来源:listctrl.c
示例19: rtgui_notebook_remove
void rtgui_notebook_remove(struct rtgui_notebook* notebook, rt_uint16_t index)
{
struct rtgui_notebook_tab tab;
rt_bool_t need_update = RT_FALSE;
RT_ASSERT(notebook != RT_NULL);
if (index < notebook->count)
{
if (notebook->count == 1)
{
tab = notebook->childs[0];
rtgui_free(notebook->childs);
notebook->childs = RT_NULL;
notebook->count = 0;
}
else
{
if (notebook->current == index)
need_update = RT_TRUE;
tab = notebook->childs[index];
for (;index < notebook->count - 1; index++)
{
notebook->childs[index] = notebook->childs[index + 1];
}
notebook->count -= 1;
notebook->childs = (struct rtgui_notebook_tab*) rtgui_realloc(notebook->childs,
sizeof(struct rtgui_notebook_tab) * notebook->count);
}
rt_free(tab.title);
if (need_update)
{
if (notebook->current > notebook->count - 1)
notebook->current = notebook->count - 1;
rtgui_widget_hide(tab.widget);
rtgui_widget_show(notebook->childs[notebook->current].widget);
rtgui_widget_update(RTGUI_WIDGET(notebook));
rtgui_widget_set_parent(tab.widget, RT_NULL);
}
}
}
开发者ID:fengye0316,项目名称:RTT_GPS_STUSB,代码行数:46,代码来源:notebook.c
示例20: rtgui_combobox_pdwin_onitem
void rtgui_combobox_pdwin_onitem(struct rtgui_widget* widget, struct rtgui_event* event)
{
rtgui_win_t* pd_win;
rtgui_combobox_t* combo;
rtgui_listbox_t* list;
list = RTGUI_LISTBOX(widget);
pd_win = RTGUI_WIN(rtgui_widget_get_toplevel(widget));
combo = RTGUI_COMBOBOX(pd_win->user_data);
combo->current_item = list->current_item;
if (combo->on_selected != RT_NULL)
combo->on_selected(RTGUI_WIDGET(combo), RT_NULL);
rtgui_win_hiden(pd_win);
rtgui_widget_update(RTGUI_WIDGET(combo));
return ;
}
开发者ID:pengdonglin137,项目名称:iboot,代码行数:19,代码来源:combobox.c
注:本文中的rtgui_widget_update函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论