From 0e93e6809c7beac4597148edc1dc09bcdf9a2ab3 Mon Sep 17 00:00:00 2001 From: "iamyhw@gmail.com" Date: Thu, 24 Mar 2011 14:00:19 +0000 Subject: add rtgui_win subfield,Highlight the ease of use git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1345 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- .../rtgui_win/include/rtgui/widgets/progressbar.h | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 components/rtgui_win/include/rtgui/widgets/progressbar.h (limited to 'components/rtgui_win/include/rtgui/widgets/progressbar.h') diff --git a/components/rtgui_win/include/rtgui/widgets/progressbar.h b/components/rtgui_win/include/rtgui/widgets/progressbar.h new file mode 100644 index 0000000000..c2133a93dd --- /dev/null +++ b/components/rtgui_win/include/rtgui/widgets/progressbar.h @@ -0,0 +1,40 @@ +#ifndef __RTGUI_PROGRESSBAR_H__ +#define __RTGUI_PROGRESSBAR_H__ + +#include + +typedef struct rtgui_progressbar rtgui_progressbar_t; + +/** Gets the type of a progressbar */ +#define RTGUI_PROGRESSBAR_TYPE (rtgui_progressbar_type_get()) +/** Casts the object to a rtgui_progressbar */ +#define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t)) +/** Checks if the object is a rtgui_progressbar */ +#define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE)) + +#define DEFAULT_WIDTH 100 +#define DEFAULT_HEIGHT 20 + +struct rtgui_progressbar +{ + rtgui_widget_t parent; + + int orient; + + int range; + int position; +}; + +rtgui_type_t *rtgui_progressbar_type_get(void); + +rtgui_progressbar_t* rtgui_progressbar_create(PVOID parent, int orient, int range, int left, int top, int w, int h); +void rtgui_progressbar_destroy(rtgui_progressbar_t* p_bar); + +rt_bool_t rtgui_progressbar_event_handler(PVOID wdt, rtgui_event_t* event); + +void rtgui_progressbar_set_value(rtgui_progressbar_t *p_bar, int value); +int rtgui_progressbar_get_value(rtgui_progressbar_t *p_bar); +void rtgui_progressbar_set_range(rtgui_progressbar_t *p_bar, int range); +int rtgui_progressbar_get_range(rtgui_progressbar_t *p_bar); + +#endif -- cgit v1.3.1