checkbox.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __RTGUI_CHECKBOX_H__
  2. #define __RTGUI_CHECKBOX_H__
  3. #include <rtgui/rtgui.h>
  4. #define RTGUI_CHECKBOX_TYPE (rtgui_checkbox_type_get())
  5. #define RTGUI_CHECKBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_CHECKBOX_TYPE, rtgui_checkbox_t))
  6. #define RTGUI_IS_CHECKBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_CHECKBOX_TYPE))
  7. //#define RTGUI_CHECKBOX_STATUS_CHECKED 1
  8. //#define RTGUI_CHECKBOX_STATUS_UNCHECKED 0
  9. struct rtgui_checkbox
  10. {
  11. /* inherit from label */
  12. rtgui_label_t parent;
  13. /* check box status */
  14. int value;
  15. };
  16. typedef struct rtgui_checkbox rtgui_checkbox_t;
  17. rtgui_type_t *rtgui_checkbox_type_get(void);
  18. rtgui_checkbox_t* rtgui_checkbox_create(PVOID wdt,const char* text, rt_bool_t checked,rtgui_color_t fc,int left,int top);
  19. void rtgui_checkbox_destroy(rtgui_checkbox_t* checkbox);
  20. void rtgui_checkbox_set_checked(rtgui_checkbox_t* checkbox, rt_bool_t checked);
  21. rt_bool_t rtgui_checkbox_get_checked(rtgui_checkbox_t* checkbox);
  22. rt_bool_t rtgui_checkbox_event_handler(PVOID wdt, rtgui_event_t* event);
  23. void rtgui_checkbox_set_text(rtgui_checkbox_t *box, const char* text);
  24. #endif