2010-03-14 21:47:49 +08:00
|
|
|
|
/*
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嵥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD>view<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>ťʱ<EFBFBD>ͬ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
|
2010-01-18 07:41:59 +08:00
|
|
|
|
#include <rtgui/rtgui.h>
|
|
|
|
|
#include <rtgui/rtgui_system.h>
|
|
|
|
|
#include <rtgui/widgets/window.h>
|
|
|
|
|
#include <rtgui/widgets/label.h>
|
|
|
|
|
#include <rtgui/widgets/button.h>
|
|
|
|
|
#include "demo_view.h"
|
|
|
|
|
|
|
|
|
|
static struct rtgui_timer *timer;
|
|
|
|
|
static struct rtgui_label* label;
|
2010-01-21 18:05:06 +08:00
|
|
|
|
static struct rtgui_win* msgbox = RT_NULL;
|
2010-01-18 07:41:59 +08:00
|
|
|
|
static rt_uint8_t label_text[80];
|
2010-02-04 08:07:08 +08:00
|
|
|
|
static rt_uint8_t cnt = 5;
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><>ȡһ<C8A1><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>ڱ<EFBFBD><DAB1><EFBFBD> */
|
2010-02-04 08:07:08 +08:00
|
|
|
|
static char* get_win_title()
|
|
|
|
|
{
|
|
|
|
|
static rt_uint8_t win_no = 0;
|
|
|
|
|
static char win_title[16];
|
|
|
|
|
|
|
|
|
|
rt_sprintf(win_title, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d", ++win_no);
|
|
|
|
|
return win_title;
|
|
|
|
|
}
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD>ڹر<DAB9>ʱ<EFBFBD><CAB1><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD> */
|
2010-01-26 07:40:18 +08:00
|
|
|
|
void window_demo_close(struct rtgui_widget* widget, rtgui_event_t *even)
|
|
|
|
|
{
|
|
|
|
|
rtgui_win_t* win;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB6A5><EFBFBD>ؼ<EFBFBD> */
|
|
|
|
|
win = RTGUI_WIN(rtgui_widget_get_toplevel(widget));
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD>ٴ<EFBFBD><D9B4><EFBFBD> */
|
|
|
|
|
rtgui_win_destroy(win);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* <20>رնԻ<D5B6><D4BB><EFBFBD>ʱ<EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
void diag_close(struct rtgui_timer* timer, void* parameter)
|
|
|
|
|
{
|
2010-03-14 14:36:46 +08:00
|
|
|
|
cnt --;
|
2010-01-18 07:41:59 +08:00
|
|
|
|
sprintf(label_text, "closed then %d second!", cnt);
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD>ñ<EFBFBD>ǩ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¿ؼ<C2BF> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
rtgui_label_set_text(label, label_text);
|
|
|
|
|
rtgui_widget_update(RTGUI_WIDGET(label));
|
2010-03-14 14:36:46 +08:00
|
|
|
|
|
2010-01-18 07:41:59 +08:00
|
|
|
|
if (cnt == 0)
|
|
|
|
|
{
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><>ʱ<EFBFBD><CAB1><EFBFBD>رնԻ<D5B6><D4BB><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
rtgui_win_destroy(msgbox);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
|
|
|
|
|
/* ֹͣ<CDA3><D6B9>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
rtgui_timer_stop(timer);
|
|
|
|
|
rtgui_timer_destory(timer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-26 07:40:18 +08:00
|
|
|
|
static rt_uint16_t delta_x = 20;
|
|
|
|
|
static rt_uint16_t delta_y = 40;
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ */
|
|
|
|
|
static void demo_win_onbutton(struct rtgui_widget* widget, rtgui_event_t* event)
|
2010-01-18 07:41:59 +08:00
|
|
|
|
{
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_win_t *win;
|
|
|
|
|
rtgui_label_t *label;
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rtgui_toplevel_t *parent;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_rect_t rect = {0, 0, 150, 80};
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
parent = RTGUI_TOPLEVEL(rtgui_widget_get_toplevel(widget));
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_rect_moveto(&rect, delta_x, delta_y);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
delta_x += 20;
|
|
|
|
|
delta_y += 20;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
win = rtgui_win_create(parent,
|
2010-02-04 08:07:08 +08:00
|
|
|
|
get_win_title(), &rect, RTGUI_WIN_STYLE_DEFAULT);
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 20;
|
|
|
|
|
rect.x2 -= 5;
|
|
|
|
|
rect.y1 += 5;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
2010-03-14 21:47:49 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ǩ */
|
2010-01-26 07:40:18 +08:00
|
|
|
|
label = rtgui_label_create("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(label));
|
|
|
|
|
|
|
|
|
|
/* <20><>ģ̬<C4A3><CCAC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_win_show(win, RT_FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ */
|
|
|
|
|
static void demo_autowin_onbutton(struct rtgui_widget* widget, rtgui_event_t* event)
|
|
|
|
|
{
|
|
|
|
|
rtgui_toplevel_t *parent;
|
2010-03-14 21:47:49 +08:00
|
|
|
|
struct rtgui_rect rect ={50, 50, 200, 200};
|
2010-03-14 14:36:46 +08:00
|
|
|
|
|
|
|
|
|
parent = RTGUI_TOPLEVEL(rtgui_widget_get_toplevel(widget));
|
|
|
|
|
msgbox = rtgui_win_create(parent, "Information", &rect, RTGUI_WIN_STYLE_DEFAULT);
|
|
|
|
|
if (msgbox != RT_NULL)
|
|
|
|
|
{
|
|
|
|
|
cnt = 5;
|
|
|
|
|
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(msgbox), RTGUI_WIDGET(label));
|
|
|
|
|
|
|
|
|
|
rtgui_win_show(msgbox, RT_FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> */
|
|
|
|
|
timer = rtgui_timer_create(100, RT_TIMER_FLAG_PERIODIC, diag_close, RT_NULL);
|
|
|
|
|
rtgui_timer_start(timer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>ģ̬<C4A3><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ */
|
|
|
|
|
static void demo_modalwin_onbutton(struct rtgui_widget* widget, rtgui_event_t* event)
|
2010-01-26 07:40:18 +08:00
|
|
|
|
{
|
|
|
|
|
rtgui_win_t *win;
|
|
|
|
|
rtgui_label_t *label;
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rtgui_toplevel_t *parent;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_rect_t rect = {0, 0, 150, 80};
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
parent = RTGUI_TOPLEVEL(rtgui_widget_get_toplevel(widget));
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_rect_moveto(&rect, delta_x, delta_y);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
delta_x += 20;
|
|
|
|
|
delta_y += 20;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
win = rtgui_win_create(parent,
|
2010-02-04 08:07:08 +08:00
|
|
|
|
get_win_title(), &rect, RTGUI_WIN_STYLE_DEFAULT);
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 20;
|
|
|
|
|
rect.x2 -= 5;
|
|
|
|
|
rect.y1 += 5;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
|
|
|
|
label = rtgui_label_create("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(label));
|
|
|
|
|
|
|
|
|
|
/* ģ̬<C4A3><CCAC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_win_show(win, RT_TRUE);
|
2010-02-13 00:02:58 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>ģ̬<C4A3><CCAC>ʾ<EFBFBD><CABE><EFBFBD>ڣ<EFBFBD><DAA3>ر<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_win_destroy(win);
|
2010-01-26 07:40:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޱ<EFBFBD><DEB1>ⴰ<EFBFBD><E2B4B0><EFBFBD><EFBFBD>ʾ */
|
|
|
|
|
static void demo_ntitlewin_onbutton(struct rtgui_widget* widget, rtgui_event_t* event)
|
2010-01-26 07:40:18 +08:00
|
|
|
|
{
|
|
|
|
|
rtgui_win_t *win;
|
|
|
|
|
rtgui_label_t *label;
|
|
|
|
|
rtgui_button_t *button;
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rtgui_toplevel_t *parent;
|
2010-02-03 18:27:47 +08:00
|
|
|
|
rtgui_rect_t widget_rect, rect = {0, 0, 150, 80};
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
parent = RTGUI_TOPLEVEL(rtgui_widget_get_toplevel(widget));
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_rect_moveto(&rect, delta_x, delta_y);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
delta_x += 20;
|
|
|
|
|
delta_y += 20;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ޱ<EFBFBD><DEB1>⼰<EFBFBD>ޱ߿<DEB1> */
|
2010-01-26 07:40:18 +08:00
|
|
|
|
win = rtgui_win_create(parent,
|
|
|
|
|
"no title", &rect, RTGUI_WIN_STYLE_NO_TITLE | RTGUI_WIN_STYLE_NO_BORDER);
|
|
|
|
|
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(win)) = white;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ǩ */
|
|
|
|
|
label = rtgui_label_create("<EFBFBD>ޱ߿<EFBFBD>");
|
2010-02-03 18:27:47 +08:00
|
|
|
|
rtgui_font_get_metrics(RTGUI_WIDGET_FONT(RTGUI_WIDGET(label)), "<EFBFBD>ޱ߿<EFBFBD>", &widget_rect);
|
|
|
|
|
rtgui_rect_moveto_align(&rect, &widget_rect, RTGUI_ALIGN_CENTER_HORIZONTAL);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
widget_rect.y1 += 20;
|
|
|
|
|
widget_rect.y2 += 20;
|
2010-02-03 18:27:47 +08:00
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(label), &widget_rect);
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(label));
|
2010-02-03 18:27:47 +08:00
|
|
|
|
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>رհ<D8B1>ť */
|
2010-03-14 14:36:46 +08:00
|
|
|
|
widget_rect.x1 = 0;
|
|
|
|
|
widget_rect.y1 = 0;
|
|
|
|
|
widget_rect.x2 = 40;
|
|
|
|
|
widget_rect.y2 = 20;
|
2010-02-03 18:27:47 +08:00
|
|
|
|
rtgui_rect_moveto_align(&rect, &widget_rect, RTGUI_ALIGN_CENTER_HORIZONTAL);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
widget_rect.y1 += 40;
|
|
|
|
|
widget_rect.y2 += 40;
|
2010-01-26 07:40:18 +08:00
|
|
|
|
button = rtgui_button_create("<EFBFBD>ر<EFBFBD>");
|
2010-02-03 18:27:47 +08:00
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(button), &widget_rect);
|
2010-01-26 07:40:18 +08:00
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(button));
|
|
|
|
|
rtgui_button_set_onbutton(button, window_demo_close);
|
|
|
|
|
|
|
|
|
|
/* <20><>ģ̬<C4A3><CCAC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_win_show(win, RT_FALSE);
|
2010-01-18 07:41:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtgui_view_t* demo_view_window(rtgui_workbench_t* workbench)
|
|
|
|
|
{
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rtgui_rect_t rect;
|
|
|
|
|
rtgui_view_t* view;
|
|
|
|
|
rtgui_button_t *button;
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ͼ */
|
|
|
|
|
view = demo_view(workbench, "Window Demo");
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
|
|
|
|
demo_view_get_rect(view, &rect);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 5;
|
|
|
|
|
rect.x2 = rect.x1 + 100;
|
|
|
|
|
rect.y1 += 5;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
button = rtgui_button_create("Normal Win");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(button), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(button));
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>onbuttonΪdemo_win_onbutton<6F><6E><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_button_set_onbutton(button, demo_win_onbutton);
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
|
|
|
|
demo_view_get_rect(view, &rect);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 5;
|
|
|
|
|
rect.x2 = rect.x1 + 100;
|
|
|
|
|
rect.y1 += 5 + 25;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾһ<CABE><D2BB><EFBFBD>Զ<EFBFBD><D4B6>رյĴ<D5B5><C4B4><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
button = rtgui_button_create("Auto Win");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(button), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(button));
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>onbuttonΪdemo_autowin_onbutton<6F><6E><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_button_set_onbutton(button, demo_autowin_onbutton);
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
|
|
|
|
demo_view_get_rect(view, &rect);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 5;
|
|
|
|
|
rect.x2 = rect.x1 + 100;
|
|
|
|
|
rect.y1 += 5 + 25 + 25;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>һ<EFBFBD><D2BB>ģʽ<C4A3><CABD><EFBFBD><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
button = rtgui_button_create("Modal Win");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(button), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(button));
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>onbuttonΪdemo_modalwin_onbutton<6F><6E><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_button_set_onbutton(button, demo_modalwin_onbutton);
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
|
|
|
|
demo_view_get_rect(view, &rect);
|
2010-03-14 14:36:46 +08:00
|
|
|
|
rect.x1 += 5;
|
|
|
|
|
rect.x2 = rect.x1 + 100;
|
|
|
|
|
rect.y1 += 5 + 25 + 25 + 25;
|
|
|
|
|
rect.y2 = rect.y1 + 20;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD> */
|
2010-01-18 07:41:59 +08:00
|
|
|
|
button = rtgui_button_create("NoTitle Win");
|
|
|
|
|
rtgui_widget_set_rect(RTGUI_WIDGET(button), &rect);
|
|
|
|
|
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(button));
|
2010-03-14 14:36:46 +08:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD>onbuttonΪdemo_ntitlewin_onbutton<6F><6E><EFBFBD><EFBFBD> */
|
|
|
|
|
rtgui_button_set_onbutton(button, demo_ntitlewin_onbutton);
|
2010-01-18 07:41:59 +08:00
|
|
|
|
|
2010-03-14 14:36:46 +08:00
|
|
|
|
return view;
|
2010-01-18 07:41:59 +08:00
|
|
|
|
}
|