view.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * File : view.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_VIEW_H__
  15. #define __RTGUI_VIEW_H__
  16. #include <rtgui/widgets/container.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /** Gets the type of a view */
  21. #define RTGUI_VIEW_TYPE (rtgui_view_type_get())
  22. /** Casts the object to an rtgui_view_t */
  23. #define RTGUI_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_VIEW_TYPE, rtgui_view_t))
  24. /** Checks if the object is an rtgui_view_t */
  25. #define RTGUI_IS_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_VIEW_TYPE))
  26. /*
  27. * the view widget
  28. */
  29. struct rtgui_view
  30. {
  31. /* inherit from box */
  32. rtgui_container_t parent;
  33. /* private field */
  34. char* title;
  35. };
  36. typedef struct rtgui_view rtgui_view_t;
  37. rtgui_type_t *rtgui_view_type_get(void);
  38. rtgui_view_t *rtgui_view_create(PVOID wdt,const char* title,int left,int top,int w,int h);
  39. void rtgui_view_destroy(rtgui_view_t* view);
  40. rt_bool_t rtgui_view_event_handler(PVOID wdt, rtgui_event_t* event);
  41. rt_bool_t rtgui_view_show(rtgui_view_t* view);
  42. void rtgui_view_hide(rtgui_view_t* view);
  43. char* rtgui_view_get_title(rtgui_view_t* view);
  44. void rtgui_view_set_title(rtgui_view_t* view, const char* title);
  45. void rtgui_view_show_child(PVOID wdt,const char* name);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif