progressbar.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __RTGUI_PROGRESSBAR_H__
  2. #define __RTGUI_PROGRESSBAR_H__
  3. #include <rtgui/rtgui.h>
  4. typedef struct rtgui_progressbar rtgui_progressbar_t;
  5. /** Gets the type of a progressbar */
  6. #define RTGUI_PROGRESSBAR_TYPE (rtgui_progressbar_type_get())
  7. /** Casts the object to a rtgui_progressbar */
  8. #define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t))
  9. /** Checks if the object is a rtgui_progressbar */
  10. #define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE))
  11. #define DEFAULT_WIDTH 100
  12. #define DEFAULT_HEIGHT 20
  13. struct rtgui_progressbar
  14. {
  15. rtgui_widget_t parent;
  16. int orient;
  17. int range;
  18. int position;
  19. };
  20. rtgui_type_t *rtgui_progressbar_type_get(void);
  21. rtgui_progressbar_t* rtgui_progressbar_create(PVOID parent, int orient, int range, int left, int top, int w, int h);
  22. void rtgui_progressbar_destroy(rtgui_progressbar_t* p_bar);
  23. rt_bool_t rtgui_progressbar_event_handler(PVOID wdt, rtgui_event_t* event);
  24. void rtgui_progressbar_set_value(rtgui_progressbar_t *p_bar, int value);
  25. int rtgui_progressbar_get_value(rtgui_progressbar_t *p_bar);
  26. void rtgui_progressbar_set_range(rtgui_progressbar_t *p_bar, int range);
  27. int rtgui_progressbar_get_range(rtgui_progressbar_t *p_bar);
  28. #endif