rt-thread/examples/gui/demo_view_mywidget.c

43 lines
1.1 KiB
C
Raw Normal View History

/*
2013-02-01 10:27:10 +08:00
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD>ʾ
*
2013-02-01 10:27:10 +08:00
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>container<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
*/
#include "demo_view.h"
#include "mywidget.h"
2013-02-01 10:27:10 +08:00
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>ͼ */
rtgui_container_t *demo_view_mywidget(void)
{
rtgui_container_t *container;
rtgui_rect_t rect;
rtgui_mywidget_t *mywidget;
2013-02-01 10:27:10 +08:00
/* <20>ȴ<EFBFBD><C8B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ͼ */
container = demo_view("MyWidget View");
2013-02-01 10:27:10 +08:00
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϣ */
demo_view_get_rect(container, &rect);
rect.x1 += 5;
rect.x2 = rect.y1 + 80;
rect.y1 += 5;
rect.y2 = rect.y1 + 80;
2013-02-01 10:27:10 +08:00
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ؼ<EFBFBD> */
mywidget = rtgui_mywidget_create(&rect);
2013-02-01 10:27:10 +08:00
/* container<65><72>һ<EFBFBD><D2BB>container<65>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>add_child<6C><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կؼ<D4BF> */
rtgui_container_add_child(container, RTGUI_WIDGET(mywidget));
2013-02-01 10:27:10 +08:00
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϣ */
demo_view_get_rect(container, &rect);
rect.x1 += 25;
rect.x2 = rect.y1 + 40;
rect.y1 += 5 + 100;
rect.y2 = rect.y1 + 40;
2013-02-01 10:27:10 +08:00
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ؼ<EFBFBD> */
mywidget = rtgui_mywidget_create(&rect);
2013-02-01 10:27:10 +08:00
/* container<65><72>һ<EFBFBD><D2BB>container<65>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>add_child<6C><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կؼ<D4BF> */
rtgui_container_add_child(container, RTGUI_WIDGET(mywidget));
return container;
}