12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /*
- * File : label.h
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2009-10-16 Bernard first version
- */
- #ifndef __RTGUI_LABEL_H__
- #define __RTGUI_LABEL_H__
- #include <rtgui/rtgui.h>
- #include <rtgui/widgets/widget.h>
- /** Gets the type of a button */
- #define RTGUI_LABEL_TYPE (rtgui_label_type_get())
- /** Casts the object to an rtgui_button */
- #define RTGUI_LABEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LABEL_TYPE, rtgui_label_t))
- /** Checks if the object is an rtgui_button */
- #define RTGUI_IS_LABEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LABEL_TYPE))
- /*
- * the label widget
- */
- struct rtgui_label
- {
- struct rtgui_widget parent;
- /* label */
- unsigned char* text;
- };
- typedef struct rtgui_label rtgui_label_t;
- rtgui_type_t *rtgui_label_type_get(void);
- rtgui_label_t* rtgui_label_create(const unsigned char* text);
- void rtgui_label_destroy(rtgui_label_t* label);
- rt_bool_t rtgui_label_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
- void rtgui_label_set_text(rtgui_label_t* label, const unsigned char* text);
- unsigned char* rtgui_label_get_text(rtgui_label_t* label);
- #endif
|