label.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * File : label.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-10-16 Bernard first version
  13. */
  14. #ifndef __RTGUI_LABEL_H__
  15. #define __RTGUI_LABEL_H__
  16. #include <rtgui/rtgui.h>
  17. #include <rtgui/widgets/widget.h>
  18. /** Gets the type of a button */
  19. #define RTGUI_LABEL_TYPE (rtgui_label_type_get())
  20. /** Casts the object to an rtgui_button */
  21. #define RTGUI_LABEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LABEL_TYPE, rtgui_label_t))
  22. /** Checks if the object is an rtgui_button */
  23. #define RTGUI_IS_LABEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LABEL_TYPE))
  24. /*
  25. * the label widget
  26. */
  27. struct rtgui_label
  28. {
  29. struct rtgui_widget parent;
  30. /* label */
  31. unsigned char* text;
  32. };
  33. typedef struct rtgui_label rtgui_label_t;
  34. rtgui_type_t *rtgui_label_type_get(void);
  35. rtgui_label_t* rtgui_label_create(const unsigned char* text);
  36. void rtgui_label_destroy(rtgui_label_t* label);
  37. rt_bool_t rtgui_label_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
  38. void rtgui_label_set_text(rtgui_label_t* label, const unsigned char* text);
  39. unsigned char* rtgui_label_get_text(rtgui_label_t* label);
  40. #endif