rt-thread-official/examples/rtgui_win/demo_gui_button.c

41 lines
1.0 KiB
C
Raw Normal View History

/*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>button<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>button<EFBFBD>ؼ<EFBFBD>
*/
#include "demo_view.h"
#include <rtgui/widgets/button.h>
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾbutton<6F>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>ͼ */
rtgui_view_t* demo_gui_button(rtgui_view_t* parent_view)
{
rtgui_view_t* view;
rtgui_button_t* button;
rtgui_font_t* font;
/* <20>ȴ<EFBFBD><C8B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ͼ */
view = demo_view_create(parent_view, "Button View");
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>button<6F>ؼ<EFBFBD> */
button = rtgui_button_create(view, "Red", 5, 40, 100, 25);
/* <20><><EFBFBD><EFBFBD>label<65>ؼ<EFBFBD><D8BC><EFBFBD>ǰ<EFBFBD><C7B0>ɫΪ<C9AB><CEAA>ɫ */
RTGUI_WIDGET_FOREGROUND(button) = red;
button = rtgui_button_create(view, "Blue", 5, 70, 100, 25);
RTGUI_WIDGET_FOREGROUND(button) = blue;
button = rtgui_button_create(view, "12 font", 5, 100, 100, 25);
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ12<31><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>asc<73><63><EFBFBD><EFBFBD> */
font = rtgui_font_refer("asc", 12);
RTGUI_WIDGET_FONT(button) = font;
button = rtgui_button_create(view, "16 font", 5, 130, 100, 25);
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ16<31><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD>asc<73><63><EFBFBD><EFBFBD> */
font = rtgui_font_refer("asc", 16);
RTGUI_WIDGET_FONT(button) = font;
return view;
}