rt-thread/examples/rtgui_win/demo_gui_rttab.c

121 lines
4.8 KiB
C
Raw Normal View History

/*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rttab<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>rttab<EFBFBD>ؼ<EFBFBD>
*/
#include "demo_view.h"
#include <rtgui/widgets/label.h>
#include <rtgui/widgets/button.h>
#include <rtgui/widgets/rttab.h>
#include <rtgui/widgets/propel.h>
const unsigned char image_tool[] = {
'H', 'D', 'C', 0x00,
0x10, 0x00, 0x10, 0x00,
0x10, 0x00, 0x10, 0x00,
0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x10, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x04,
0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
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾrttab<61>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>ͼ */
rtgui_view_t* demo_gui_rttab(rtgui_view_t* parent_view)
{
rtgui_view_t* view;
rtgui_image_t* image;
rtgui_rttab_t* tab;
rtgui_container_t* box;
/* <20>ȴ<EFBFBD><C8B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ͼ */
view = demo_view_create(parent_view, "RTTAB View");
image = rtgui_image_create_from_mem("hdc",image_tool,sizeof(image_tool),RT_TRUE);
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>rttab<61>ؼ<EFBFBD> */
tab = rtgui_rttab_create(view, "TAB", 10, 40, 210, 160);
/* <20><><EFBFBD>ӱ<EFBFBD>ǩҳ */
rtgui_rttab_add_tag(tab, "Editor", image);
box = rtgui_rttab_get_container_by_index(tab, 0);
rtgui_label_create(box, "label1",5,5,100,20);
rtgui_rttab_add_tag(tab, "Other", RT_NULL);
box = rtgui_rttab_get_container_by_title(tab, "Other");
rtgui_label_create(box, "label3",5,5,100,20);
rtgui_rttab_add_tag(tab, "TAG1", image);
box = rtgui_rttab_get_container_by_title(tab, "TAG1");
rtgui_button_create(box, "button",5,5,80,25);
rtgui_rttab_add_tag(tab, "TAG2", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG3", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG4", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG5", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG6", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG7", RT_NULL);
rtgui_rttab_add_tag(tab, "TAG8", RT_NULL);
return view;
}