4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 16:43:31 +08:00
rt-thread-official/examples/rtgui_win/demo_gui_scrollbar.c
iamyhw@gmail.com 967f6f6eef translation examples to rtgui_win
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1350 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-03-26 16:05:51 +00:00

29 lines
898 B
C

#include "demo_view.h"
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/label.h>
#include <rtgui/widgets/scrollbar.h>
rtgui_view_t *demo_gui_scrollbar(rtgui_view_t* parent_view)
{
rtgui_view_t *view;
rtgui_scrollbar_t* hbar;
rtgui_scrollbar_t* vbar;
/* create a demo view */
view = demo_view_create(parent_view, "ScrollBar View");
rtgui_label_create(view, "horizontal bar:", 5, 40, 150, 20);
hbar = rtgui_scrollbar_create(view, 5, 70, 20, 100, RTGUI_HORIZONTAL);
rtgui_scrollbar_set_range(hbar, 10);
rtgui_scrollbar_set_page_step(hbar, 5);
rtgui_scrollbar_set_line_step(hbar, 1);
rtgui_label_create(view, "vertical bar:", 5, 100, 150, 20);
vbar = rtgui_scrollbar_create(view, 10, 140, 20, 80, RTGUI_VERTICAL);
rtgui_scrollbar_set_range(vbar, 5);
rtgui_scrollbar_set_page_step(vbar, 3);
rtgui_scrollbar_set_line_step(vbar, 1);
return view;
}