• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rtgui_widget_set_rect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rtgui_widget_set_rect函数的典型用法代码示例。如果您正苦于以下问题:C++ rtgui_widget_set_rect函数的具体用法?C++ rtgui_widget_set_rect怎么用?C++ rtgui_widget_set_rect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rtgui_widget_set_rect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rtgui_combo_add_string

void rtgui_combo_add_string(rtgui_combo_t* cbo,const char* string)
{
	if(cbo->lbox != RT_NULL)
	{
		rtgui_listbox_item_t item;
		rtgui_rect_t rect;
		rt_uint32_t h,count;

		item.name = (char*)string;
		item.image = RT_NULL;
		rtgui_listbox_add_item(cbo->lbox, &item, 1);

		rtgui_widget_get_rect(cbo->lbox, &rect);
		count = rtgui_listbox_get_count(cbo->lbox);

		h = RTGUI_WIDGET_BORDER_SIZE(cbo->lbox)*2+(RTGUI_SEL_H + 2)*count;

		if(h>RC_H(rect))
		{
			if(cbo->lbox->item_per_page<5)/* change when less than five */
			{
				rect.y2 = rect.y1+h;
				rtgui_widget_rect_to_device(cbo->lbox,&rect);
				rtgui_widget_set_rect(cbo->lbox,&rect);/* update listbox extent */
				cbo->lbox->item_per_page = RC_H(rect) / (RTGUI_SEL_H+2);

				if(cbo->lbox->scroll != RT_NULL)/* update scrollbar extent */
				{
					rtgui_widget_get_rect(cbo->lbox->scroll, &rect);
					rect.y2 = rect.y1+h-RTGUI_WIDGET_BORDER_SIZE(cbo->lbox)*2;
					rtgui_widget_rect_to_device(cbo->lbox->scroll,&rect);
					rtgui_widget_set_rect(cbo->lbox->scroll,&rect);

					if(cbo->lbox->item_count > cbo->lbox->item_per_page)
					{
						RTGUI_WIDGET_SHOW(cbo->lbox->scroll);
						rtgui_scrollbar_set_line_step(cbo->lbox->scroll, 1);
						rtgui_scrollbar_set_page_step(cbo->lbox->scroll, cbo->lbox->item_per_page);
						rtgui_scrollbar_set_range(cbo->lbox->scroll, cbo->lbox->item_count);
					}
					else
					{
						RTGUI_WIDGET_HIDE(cbo->lbox->scroll);
					}
					rtgui_widget_update_clip(cbo->lbox);
				}
			}
		}
	}
}
开发者ID:amsl,项目名称:RTGUI,代码行数:50,代码来源:combobox.c


示例2: rtgui_win_create

rtgui_win_t* rtgui_win_create(rtgui_toplevel_t* parent_toplevel, const char* title, rtgui_rect_t *rect, rt_uint8_t style)
{
	struct rtgui_win* win;

	/* allocate win memory */
	win = (struct rtgui_win*) rtgui_widget_create (RTGUI_WIN_TYPE);
	if (win != RT_NULL)
	{
		/* set parent toplevel */
		win->parent_toplevel = parent_toplevel;

		/* set title, rect and style */
		if (title != RT_NULL) win->title = rt_strdup(title);
		else win->title = RT_NULL;

		rtgui_widget_set_rect(RTGUI_WIDGET(win), rect);
		win->style = style;

		if (_rtgui_win_create_in_server(win) == RT_FALSE)
		{
			rtgui_widget_destroy(RTGUI_WIDGET(win));
			return RT_NULL;
		}
	}

	return win;
}
开发者ID:520lly,项目名称:-android-source-code,代码行数:27,代码来源:window.c


示例3: demo_autowin_onbutton

/* 触发自动窗口显示 */
static void demo_autowin_onbutton(struct rtgui_object *object, rtgui_event_t *event)
{
    struct rtgui_rect rect = {50, 50, 200, 200};

    /* don't create the window twice */
    if (autowin)
        return;

    autowin = rtgui_win_create(main_win, "Information",
                              &rect, RTGUI_WIN_STYLE_DEFAULT | RTGUI_WIN_STYLE_DESTROY_ON_CLOSE);
    if (autowin == RT_NULL)
        return;

    cnt = 5;
    rt_sprintf(label_text, "closed then %d second!", cnt);
    label = rtgui_label_create(label_text);
    rect.x1 += 5;
    rect.x2 -= 5;
    rect.y1 += 5;
    rect.y2 = rect.y1 + 20;
    rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
    rtgui_container_add_child(RTGUI_CONTAINER(autowin),
                              RTGUI_WIDGET(label));

    /* 设置关闭窗口时的动作 */
    rtgui_win_set_onclose(autowin, auto_window_close);

    rtgui_win_show(autowin, RT_FALSE);
    /* 创建一个定时器 */
    timer = rtgui_timer_create(100, RT_TIMER_FLAG_PERIODIC, diag_close, RT_NULL);
    rtgui_timer_start(timer);
}
开发者ID:EvanZheng,项目名称:RTGUI,代码行数:33,代码来源:demo_view_window.c


示例4: while

/*
 * head_name[] -- 最后一个元素必须是NULL
 * rows -- 包含表头在内
 */
rtgui_form_t *rtgui_form_create(const char *head_name[], int rows, int cols, rtgui_rect_t *rect)
{
	int i, len;
	struct rtgui_form *form;

	if (NULL==head_name || NULL==rect)
		return NULL;

	form = (struct rtgui_form *)rtgui_widget_create(RTGUI_FORM_TYPE);
	if (NULL == form)
		return NULL;

	i = 0;
	while (NULL != head_name[i])
		++i;

	if (i != cols) {
		form_debug(("%s(), head items (%d) not same as cols(%d)!\n", __FUNCTION__, i, cols));
		goto err_entry;
	}

	form_debug(("%s(), line:%d: rows:%d, cols:%d!\n", __FUNCTION__, __LINE__, rows, cols));

	len = 0;
	for (i=0; i<cols; ++i) {
		len += rt_strlen(head_name[i]);
	}
	len += cols * GAG_BETWEEN_COL;

	form->fbody = rt_calloc(len*(rows-1), 1); /* 不包含表格头部占用的存储空间 */
	if (NULL == form->fbody) {
		form_debug(("fun:%s(), line:%d:%d malloc fail!\n", __FUNCTION__, __LINE__, len*(rows-1)));
		goto err_entry;
	}

	form->head_name = rt_calloc(cols, sizeof(head_name[0]));
	if (NULL == form->head_name) {
		form_debug(("fun:%s(), line:%d:%d malloc fail!\n", __FUNCTION__, __LINE__, cols * sizeof(head_name[0])));
		rt_free(form->fbody);
		goto err_entry;
	}

	form_debug(("%s(), line:%d: fbody-len:%d, head-name-len:%d!\n", __FUNCTION__, __LINE__,
				len*(rows-1), cols * sizeof(head_name[0])));

	for (i=0; i<cols; ++i) {
		form->head_name[i] = head_name[i];
	}
	form->head_item_cnt		= cols;
	form->row_cnt_of_fbody	= rows - 1;
	form->bytes_of_row		= len;

	rtgui_widget_set_rect(RTGUI_WIDGET(form), rect);

	return form;

err_entry:
	rtgui_widget_destroy(RTGUI_WIDGET(form));
	return NULL;
}
开发者ID:malooei,项目名称:yeejoin-workspace,代码行数:64,代码来源:form.c


示例5: rtgui_win_create

rtgui_win_t* rtgui_win_create(struct rtgui_win* parent_window,
		                      const char* title,
							  rtgui_rect_t *rect,
							  rt_uint16_t style)
{
	struct rtgui_win* win;

	/* allocate win memory */
	win = RTGUI_WIN(rtgui_widget_create(RTGUI_WIN_TYPE));
	if (win == RT_NULL)
		return RT_NULL;

	/* set parent toplevel */
	win->parent_window = parent_window;

	/* set title, rect and style */
	if (title != RT_NULL)
		win->title = rt_strdup(title);
	else
		win->title = RT_NULL;

	rtgui_widget_set_rect(RTGUI_WIDGET(win), rect);
	win->style = style;

	if (_rtgui_win_create_in_server(win) == RT_FALSE)
	{
		goto __on_err;
	}
	return win;

__on_err:
	rtgui_widget_destroy(RTGUI_WIDGET(win));
	return RT_NULL;
}
开发者ID:zdgaoyu,项目名称:RTGUI,代码行数:34,代码来源:window.c


示例6: rtgui_menu_create

struct rtgui_menu* rtgui_menu_create(const char* title, struct rtgui_menu* parent_menu, 
	const struct rtgui_menu_item* items, rt_uint16_t count)
{
	rtgui_rect_t rect = {0, 0, 100, 100};
    struct rtgui_menu* menu;

    menu = (struct rtgui_menu*) rtgui_widget_create ( RTGUI_MENU_TYPE );
	if (menu != RT_NULL)
	{
		rtgui_win_set_title(RTGUI_WIN(menu), title);
		menu->parent_menu = parent_menu;
		menu->items = items;
		menu->items_count = count;

		rtgui_widget_set_rect(RTGUI_WIDGET(menu), &rect);
		rtgui_rect_inflate(&rect, -1);
		/* create menu item list */
		menu->items_list = rtgui_listctrl_create((rt_uint32_t)items, count, &rect, _rtgui_menu_item_ondraw); 
		RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(menu->items_list)) = rtgui_theme_default_bc();
		rtgui_container_add_child(RTGUI_CONTAINER(menu), RTGUI_WIDGET(menu->items_list));
		rtgui_listctrl_set_onitem(menu->items_list, _rtgui_menu_onitem);
	}

	return menu;
}
开发者ID:pengdonglin137,项目名称:iboot,代码行数:25,代码来源:menu.c


示例7: show_modal_info

rt_bool_t show_modal_info(struct rtgui_widget *object, struct rtgui_event *event)
{
	rtgui_label_t *label;
	struct rtgui_win *win;
	rtgui_rect_t rect = {0, 60, 150, 100};
	win = rtgui_win_create(main_win,
						   "Info",
						   &rect,
						   RTGUI_WIN_STYLE_DEFAULT);

	rect.x1 += 20;
	rect.x2 -= 5;
	rect.y1 += 5;
	rect.y2 = rect.y1 + 20;

	label = rtgui_label_create("modal mode info");
	rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
	rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(label));

	rtgui_win_show(win, RT_TRUE);

	rtgui_win_destroy(win);

	return RT_TRUE;
}
开发者ID:EvanZheng,项目名称:RTGUI,代码行数:25,代码来源:swin_focus.c


示例8: rtgui_checkbox_create

struct rtgui_checkbox* rtgui_checkbox_create(const char* text, rt_bool_t checked)
{
    struct rtgui_checkbox* box;

    box = (struct rtgui_checkbox*) rtgui_widget_create (RTGUI_CHECKBOX_TYPE);
    if (box != RT_NULL)
    {
		rtgui_rect_t rect;

		/* set default rect */
		rtgui_font_get_metrics(rtgui_font_default(), text, &rect);
		rect.x2 += RTGUI_BORDER_DEFAULT_WIDTH + 5 + (RTGUI_BORDER_DEFAULT_WIDTH << 1);
		rect.y2 += (RTGUI_BORDER_DEFAULT_WIDTH << 1);

		rtgui_widget_set_rect(RTGUI_WIDGET(box), &rect);
		rtgui_label_set_text(RTGUI_LABEL(box), text);
		
		if (checked == RT_TRUE)
			box->status_down = RTGUI_CHECKBOX_STATUS_CHECKED;
		else
			box->status_down = RTGUI_CHECKBOX_STATUS_UNCHECKED;
	}

	return box;
}
开发者ID:bbw2008good,项目名称:RTGUI,代码行数:25,代码来源:checkbox.c


示例9: rtgui_menu_pop

void rtgui_menu_pop(struct rtgui_menu* menu, int x, int y)
{
	rtgui_rect_t rect;
	struct rtgui_event_resize eresize;

	if (menu == RT_NULL) return;

	/* set window extent */
	rect.x1 = 0; rect.y1 = 0;
	rect.x2 = 100; rect.y2 = menu->items_count * (rtgui_theme_get_selected_height() + 2) + 5;
	rtgui_rect_moveto(&rect, x, y);
	rtgui_win_set_rect(RTGUI_WIN(menu), &rect);
	rtgui_rect_inflate(&rect, -1);
	rtgui_widget_set_rect(RTGUI_WIDGET(menu->items_list), &rect);

	eresize.parent.type = RTGUI_EVENT_RESIZE;
	eresize.x = rect.x1; eresize.y = rect.y1;
	eresize.h = rect.y2 - rect.y1; eresize.w = rect.x2 - rect.x1;
	rtgui_listctrl_event_handler(RTGUI_WIDGET(menu->items_list), &(eresize.parent));

	/* on menu pop handler */
	if (menu->on_menupop != RT_NULL)
	{
		menu->on_menupop(RTGUI_WIDGET(menu), RT_NULL);
	}

	/* show menu window */
	rtgui_win_show(RTGUI_WIN(menu), RT_FALSE);
}
开发者ID:pengdonglin137,项目名称:iboot,代码行数:29,代码来源:menu.c


示例10: _rtgui_filelist_view_constructor

static void _rtgui_filelist_view_constructor(struct rtgui_filelist_view *view)
{
    /* default rect */
    struct rtgui_rect rect = {0, 0, 200, 200};

    /* set default widget rect and set event handler */
    rtgui_object_set_event_handler(RTGUI_OBJECT(view), rtgui_filelist_view_event_handler);
    rtgui_widget_set_rect(RTGUI_WIDGET(view), &rect);

    RTGUI_WIDGET(view)->flag |= RTGUI_WIDGET_FLAG_FOCUSABLE;

    view->current_item = 0;
    view->items_count = 0;
    view->page_items = 0;

    view->on_changed = RT_NULL;
    view->current_directory = RT_NULL;
    view->pattern = RT_NULL;
    RTGUI_WIDGET_BACKGROUND(view) = white;
    RTGUI_WIDGET_TEXTALIGN(view) = RTGUI_ALIGN_CENTER_VERTICAL;

    _instance_count++;
    if (_instance_count == 1)
    {
        file_image = rtgui_image_create_from_mem("xpm", (rt_uint8_t *)file_xpm,
                                                 sizeof(file_xpm), RT_TRUE);
        folder_image = rtgui_image_create_from_mem("xpm", (rt_uint8_t *)folder_xpm,
                                                   sizeof(folder_xpm), RT_TRUE);
    }
}
开发者ID:KodakWang,项目名称:RTGUI,代码行数:30,代码来源:filelist_view.c


示例11: demo_modalwin_onbutton

/* 触发模态窗口显示 */
static void demo_modalwin_onbutton(struct rtgui_object *object, rtgui_event_t *event)
{
    rtgui_win_t *win;
    rtgui_label_t *label;
    rtgui_rect_t rect = {0, 0, 150, 80};

    rtgui_rect_moveto(&rect, delta_x, delta_y);
    delta_x += 20;
    delta_y += 20;

    /* 创建一个窗口 */
    win = rtgui_win_create(main_win,
                           get_win_title(), &rect, RTGUI_WIN_STYLE_DEFAULT);

    rect.x1 += 20;
    rect.x2 -= 5;
    rect.y1 += 5;
    rect.y2 = rect.y1 + 20;

    label = rtgui_label_create("这是一个模式窗口");
    rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
    rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(label));

    /* 模态显示窗口 */
    rtgui_win_show(win, RT_TRUE);

    /* 删除非自动删除窗口 */
    rtgui_win_destroy(win);
}
开发者ID:EvanZheng,项目名称:RTGUI,代码行数:30,代码来源:demo_view_window.c


示例12: listitem_action

/* 列表项的动作函数 */
static void listitem_action(rtgui_widget_t *widget, void *parameter)
{
    char label_text[32];
    rtgui_win_t *win;
    rtgui_label_t *label;
    rtgui_rect_t rect = {0, 0, 150, 80};
    int no = (int)parameter;

    rtgui_rect_moveto(&rect, 20, 50);

    /* 显示消息窗口 */
    win = rtgui_win_create(main_win,
                           "窗口", &rect, RTGUI_WIN_STYLE_DEFAULT);

    rect.x1 += 20;
    rect.x2 -= 5;
    rect.y1 += 5;
    rect.y2 = rect.y1 + 20;

    /* 添加相应的标签 */
    rt_sprintf(label_text, "动作 %d", no);
    label = rtgui_label_create(label_text);

    rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
    rtgui_container_add_child(win, RTGUI_WIDGET(label));

    /* 非模态显示窗口 */
    rtgui_win_show(win, RT_FALSE);
}
开发者ID:201409366,项目名称:RTGUI,代码行数:30,代码来源:demo_listview.c


示例13: _rtgui_textbox_constructor

static void _rtgui_textbox_constructor(rtgui_textbox_t *box)
{
	rtgui_rect_t rect = {0, 0, RTGUI_TEXTBOX_DEFAULT_WIDTH, RTGUI_TEXTBOX_DEFAULT_HEIGHT};
	rtgui_widget_set_rect(RTGUI_WIDGET(box), &rect);

	RTGUI_WIDGET(box)->flag |= RTGUI_WIDGET_FLAG_FOCUSABLE;
	rtgui_object_set_event_handler(RTGUI_OBJECT(box), rtgui_textbox_event_handler);
	rtgui_widget_set_onfocus(RTGUI_WIDGET(box), rtgui_textbox_onfocus);
	rtgui_widget_set_onunfocus(RTGUI_WIDGET(box), rtgui_textbox_onunfocus);

	/* set default text align */
	RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(box)) = RTGUI_ALIGN_CENTER_VERTICAL;

	/* set proper of control */
	box->caret_timer = rtgui_timer_create(RT_TICK_PER_SECOND, RT_TIMER_FLAG_PERIODIC, 
		_rtgui_textbox_caret_timeout, box);

	box->line = box->line_begin = box->position = 0;
	box->flag = RTGUI_TEXTBOX_SINGLE;

	/* allocate default line buffer */
	box->text = RT_NULL;

	rtgui_font_get_metrics(RTGUI_WIDGET(box)->gc.font, "h", &rect);
	box->font_width = rtgui_rect_width(rect);
}
开发者ID:bbw2008good,项目名称:RTGUI,代码行数:26,代码来源:textbox.c


示例14: main

int main(int argc, char** argv)
{
	struct rtgui_app* application;
	struct rtgui_win* win;
    struct rtgui_button *button;

	application = rtgui_app_create("button");
	if (application != RT_NULL)
	{
		rtgui_rect_t rect;

		win = rtgui_mainwin_create(RT_NULL, "button",
			RTGUI_WIN_STYLE_MAINWIN | RTGUI_WIN_STYLE_DESTROY_ON_CLOSE);
        rtgui_widget_get_extent(RTGUI_WIDGET(win), &rect);

		/* create lable in app window */
        button = rtgui_button_create("close");
		rtgui_button_set_onbutton(button, _on_close);
        rect.x2 -= 5; rect.y2 -= 5;
        rect.x1 = rect.x2 - 80; rect.y1 = rect.y2 - 25;
		rtgui_widget_set_rect(RTGUI_WIDGET(button), &rect);
		rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(button));

		rtgui_win_show(win, RT_TRUE);
		rtgui_app_destroy(application);
	}

    return 0;
}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:29,代码来源:button.c


示例15: demo_listview_icon_view

/* 创建用于演示列表视图的视图 */
rtgui_view_t* demo_listview_icon_view(rtgui_workbench_t* workbench)
{
	rtgui_rect_t rect;
	rtgui_view_t *view;
	rtgui_button_t* open_btn;

	view = demo_view(workbench, "图标视图演示");

	if (item_icon == RT_NULL)
		item_icon = rtgui_image_create_from_mem("xpm",
			(const rt_uint8_t*)image_xpm, sizeof(image_xpm), RT_TRUE);
	if (exit_icon == RT_NULL)
		exit_icon = rtgui_image_create_from_mem("xpm",
			(const rt_uint8_t*)exit_xpm, sizeof(exit_xpm), RT_TRUE);

	/* 添加动作按钮 */
	demo_view_get_rect(view, &rect);
	rect.x1 += 5;
	rect.x2 = rect.x1 + 80;
	rect.y1 += 30;
	rect.y2 = rect.y1 + 20;
	open_btn = rtgui_button_create("打开图标列表");
	rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(open_btn));
	rtgui_widget_set_rect(RTGUI_WIDGET(open_btn), &rect);
	rtgui_button_set_onbutton(open_btn, open_btn_onbutton);

	return view;
}
开发者ID:aspirefhaha,项目名称:ad7606_stm32107,代码行数:29,代码来源:demo_listview_icon.c


示例16: rtgui_terminal_create

rtgui_terminal_t* rtgui_terminal_create(pvoid parent,const char* text, int left,int top,int w,int h)
{
	rtgui_container_t *container;
	rtgui_terminal_t* tma;

	RT_ASSERT(parent != RT_NULL);
	container = RTGUI_CONTAINER(parent);

	tma = rtgui_widget_create(RTGUI_TERMINAL_TYPE);
	if(tma != RT_NULL)
	{
		rtgui_rect_t rect;
		rtgui_widget_get_rect(container, &rect);
		rtgui_widget_rect_to_device(container,&rect);
		rect.x1 += left;
		rect.y1 += top;
		rect.x2 = rect.x1+w;
		rect.y2 = rect.y1+h;
		rtgui_widget_set_rect(tma,&rect);
		rtgui_container_add_child(container, tma);

		/* calculate line width and line page count */
		rtgui_terminal_calc_width(tma);
		/* set text */
		rtgui_terminal_calc_line(tma, text);
	}

	return tma;
}
开发者ID:amsl,项目名称:RTGUI,代码行数:29,代码来源:terminal.c


示例17: rtgui_thread_get_server

rtgui_workbench_t *rtgui_workbench_create(const char* panel_name, const unsigned char* title)
{
	struct rtgui_workbench* workbench;

	/* the server thread id */
	rt_thread_t server = rtgui_thread_get_server();
	if (server == RT_NULL)
	{
		rt_kprintf("can't find rtgui server\n");
		return RT_NULL;
	}

	/* create workbench */
	workbench = (rtgui_workbench_t*) rtgui_widget_create (RTGUI_WORKBENCH_TYPE);
	if (workbench != RT_NULL)
	{
		/* the buffer uses to receive event */
		union
		{
			struct rtgui_event_panel_attach ecreate;
			struct rtgui_event_panel_info epanel;

			char buffer[256];	/* use to recv other information */
		} event;

		/* set workbench title */
		workbench->title = (unsigned char*)rt_strdup((char*)title);

		/* create application in server */
		RTGUI_EVENT_PANEL_ATTACH_INIT(&(event.ecreate));

		/* set the panel name and workbench */
		rt_strncpy(event.ecreate.panel_name, panel_name, RTGUI_NAME_MAX);
		event.ecreate.workbench = workbench;

		/* send PANEL ATTACH to server */
		if (rtgui_thread_send_sync(server,
			&(event.ecreate.parent), sizeof(struct rtgui_event_panel_attach)) != RTGUI_STATUS_OK)
		{
			return RT_NULL;
		}

		/* get PANEL INFO */
		rtgui_thread_recv_filter(RTGUI_EVENT_PANEL_INFO, &(event.epanel.parent), sizeof(event));

		/* set panel */
		workbench->panel = (struct rtgui_panel*)event.epanel.panel;

		/* connected */
		RTGUI_TOPLEVEL(workbench)->server = server;

		/* set extent of workbench */
		rtgui_widget_set_rect(RTGUI_WIDGET(workbench), &(event.epanel.extent));

		/* set workbench in thread */
		rtgui_thread_set_widget(RTGUI_WIDGET(workbench));
	}

	return workbench;
}
开发者ID:520lly,项目名称:-android-source-code,代码行数:60,代码来源:workbench.c


示例18: rtgui_win_set_box

void rtgui_win_set_box(rtgui_win_t* win, rtgui_box_t* box)
{
    if (win == RT_NULL || box == RT_NULL) return;

    rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(box));
    rtgui_widget_set_rect(RTGUI_WIDGET(box), &(RTGUI_WIDGET(win)->extent));
}
开发者ID:zhangjinxing,项目名称:RTGUI,代码行数:7,代码来源:window.c


示例19: rtgui_edit_adjust_scroll

void rtgui_edit_adjust_scroll(rtgui_scrollbar_t *bar)
{
	struct rtgui_edit *edit;
	
	RT_ASSERT(bar != RT_NULL);
	
	if(bar->WIDGET_GROUP != RT_NULL)
	{
		rtgui_rect_t rect;
		rt_uint32_t _left=0,_top=0,_width=RTGUI_DEFAULT_SB_WIDTH,_len=0;

		edit = bar->WIDGET_GROUP;
		rtgui_widget_get_rect(edit, &rect);
		rtgui_widget_rect_to_device(edit,&rect);
		if(bar->orient==RTGUI_HORIZONTAL)
		{
			if(RTGUI_WIDGET_IS_HIDE(edit->hscroll))
			{
				if(edit->max_rows > edit->row_per_page)
				{
					RTGUI_WIDGET_SHOW(edit->hscroll);
					rtgui_scrollbar_set_line_step(edit->hscroll, 1);
					rtgui_scrollbar_set_page_step(edit->hscroll, edit->row_per_page);
					rtgui_scrollbar_set_range(edit->hscroll, edit->max_rows);
				}
				else
					RTGUI_WIDGET_HIDE(edit->vscroll);
				rtgui_widget_update_clip(RTGUI_WIDGET(edit));
			}
			else
			{
				_left = RTGUI_WIDGET_BORDER_SIZE(edit);
				_top = rtgui_rect_height(rect)-RTGUI_WIDGET_BORDER_SIZE(edit)-_width;
				_len = rtgui_rect_width(rect)-RTGUI_WIDGET_BORDER_SIZE(edit)*2;
				
				if(!RTGUI_WIDGET_IS_HIDE(edit->vscroll)) 
					_len -= _width;
				rect.x1 += _left;
				rect.y1 += _top;
				rect.x2 = rect.x1+_len;
				rect.y2 = rect.y1+_width;
			}
		}
		else if(bar->orient==RTGUI_VERTICAL)
		{
			_left = rtgui_rect_width(rect)-RTGUI_WIDGET_BORDER_SIZE(edit)-_width;
			_top = RTGUI_WIDGET_BORDER_SIZE(edit);
			_len = rtgui_rect_height(rect)-RTGUI_WIDGET_BORDER_SIZE(edit)*2;
			
			if(!RTGUI_WIDGET_IS_HIDE(edit->hscroll))  
				_len -= _width;
			rect.x1 += _left;
			rect.y1 += _top;
			rect.x2 = rect.x1+_width;
			rect.y2 = rect.y1+_len;
		}
		rtgui_widget_set_rect(bar,&rect);
	}
}
开发者ID:amsl,项目名称:RTGUI,代码行数:59,代码来源:edit.c


示例20: rtgui_notebook_event_handler

rt_bool_t rtgui_notebook_event_handler(struct rtgui_object *object, struct rtgui_event *event)
{
    int page_index;
    rtgui_rect_t rect;
    struct rtgui_notebook *notebook;

    RT_ASSERT(object != RT_NULL);
    RT_ASSERT(event != RT_NULL);

    notebook = RTGUI_NOTEBOOK(object);

    switch (event->type)
    {
	case RTGUI_EVENT_COMMAND:
		/* broadcast on each tab */
		_rtgui_notebook_ontab(notebook, event);
		break;
    case RTGUI_EVENT_PAINT:
        _rtgui_notebook_ondraw(notebook);
        break;
    case RTGUI_EVENT_MOUSE_BUTTON:
        _rtgui_notebook_onmouse(notebook, (struct rtgui_event_mouse *)event);
        break;
    case RTGUI_EVENT_SHOW:
        /* show myself */
        rtgui_widget_onshow(object, event);
        /* show the tab widget */
        return _rtgui_notebook_current_widget_handle(notebook, event);
    case RTGUI_EVENT_HIDE:
        /* hide myself */
        rtgui_widget_onhide(object, event);
        /* hide the tab widget */
        return _rtgui_notebook_current_widget_handle(notebook, event);
    case RTGUI_EVENT_KBD:
        return _rtgui_notebook_current_widget_handle(notebook, event);
    case RTGUI_EVENT_UPDATE_TOPLVL:
        /* update myself */
        rtgui_widget_onupdate_toplvl(object, event);
        /* update all the widgets in myself */
        _rtgui_notebook_all_widget_handle(notebook, event);
        return RT_FALSE;

    case RTGUI_EVENT_RESIZE:
        /* re-size page widget */
        _rtgui_notebook_get_page_rect(notebook, &rect);
        rtgui_widget_rect_to_device(RTGUI_WIDGET(notebook), &rect);
        for (page_index = 0; page_index < notebook->count; page_index ++)
        {
            rtgui_widget_set_rect(notebook->childs[page_index].widget, &rect);
        }
        break;

    default:
        /* use parent event handler */
        return rtgui_widget_event_handler(object, event);
    }

    return RT_FALSE;
}
开发者ID:firetechmlf,项目名称:RTGUI,代码行数:59,代码来源:notebook.c



注:本文中的rtgui_widget_set_rect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rtgui_widget_update函数代码示例发布时间:2022-05-30
下一篇:
C++ rtgui_rect_height函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap