rtt-f030/examples/rtgui_win/demo_gui_radiobox.c

45 lines
1.3 KiB
C
Raw Normal View History

/*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>radiobox<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>radiobox<EFBFBD>ؼ<EFBFBD>
*/
#include "demo_view.h"
#include <rtgui/widgets/radiobox.h>
static rt_uint32_t bind_var;
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾradiobox<6F>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>ͼ */
rtgui_view_t* demo_gui_radiobox(rtgui_view_t* parent_view)
{
rtgui_view_t* view;
rtgui_radiobox_t *rbox;
rtgui_rb_group_t *group,*_group;
/* <20>ȴ<EFBFBD><C8B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ͼ */
view = demo_view_create(parent_view, "RadioBox View");
/* ʹ<>÷<EFBFBD><C3B7><EFBFBD>һ */
/* <20><><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> */
group = rtgui_radiobox_create_group();
rtgui_radiobox_create(view, "radio1", 5, 40, 100, 20, group);
rtgui_radiobox_create(view, "radio2", 5, 60, 100, 20, group);
/* ʹ<>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD> */
rbox = rtgui_radiobox_create(view, "radio-x", 5, 90, 100, 20, RT_NULL);
/* Ҳ<><D2B2><EFBFBD>Դ<EFBFBD>radiobox<6F>ؼ<EFBFBD><D8BC>л<EFBFBD><D0BB><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
group = rtgui_radiobox_get_group(rbox);
_group = rtgui_radiobox_create_group();
rtgui_radiobox_create(view, "radio_m", 20,110, 100, 20, _group);
rtgui_radiobox_create(view, "radio_n", 20,130, 100, 20, _group);
/* <20>һ<E8B6A8><D2BB><EFBFBD><EFBFBD>ʼֵ */
rtgui_rb_group_set_sel(_group, 1);
rtgui_radiobox_create(view, "radio-y", 5, 150, 100, 20, group);
/* <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>øñ<C3B8><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>group<75>ĵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD> */
rtgui_rb_group_bind(group, &bind_var);
return view;
}