gx_menu.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**************************************************************************/
  2. /* */
  3. /* Copyright (c) Microsoft Corporation. All rights reserved. */
  4. /* */
  5. /* This software is licensed under the Microsoft Software License */
  6. /* Terms for Microsoft Azure RTOS. Full text of the license can be */
  7. /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
  8. /* and in the root directory of this software. */
  9. /* */
  10. /**************************************************************************/
  11. /**************************************************************************/
  12. /**************************************************************************/
  13. /** */
  14. /** GUIX Component */
  15. /** */
  16. /** Menu Management (Menu) */
  17. /** */
  18. /**************************************************************************/
  19. /**************************************************************************/
  20. /**************************************************************************/
  21. /* */
  22. /* COMPONENT DEFINITION RELEASE */
  23. /* */
  24. /* gx_menu.h PORTABLE C */
  25. /* 6.0 */
  26. /* AUTHOR */
  27. /* */
  28. /* Kenneth Maxwell, Microsoft Corporation */
  29. /* */
  30. /* DESCRIPTION */
  31. /* */
  32. /* This file defines the GUIX menu component, including all data types */
  33. /* and external references. It is assumed that gx_api.h and gx_port.h */
  34. /* have already been included. */
  35. /* */
  36. /* RELEASE HISTORY */
  37. /* */
  38. /* DATE NAME DESCRIPTION */
  39. /* */
  40. /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
  41. /* */
  42. /**************************************************************************/
  43. #ifndef GX_MENU_H
  44. #define GX_MENU_H
  45. /* Define menu management function prototypes. */
  46. #define GX_MENU_ANIMATION_OPEN 0x01
  47. #define GX_MENU_ANIMATION_CLOSE 0x02
  48. #define GX_MENU_OPEN_TIMER 0xf0
  49. #define GX_MENU_CLOSE_TIMER 0xf1
  50. UINT _gx_accordion_menu_create(GX_ACCORDION_MENU *accordion, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  51. ULONG style, USHORT accordion_menu_id, GX_CONST GX_RECTANGLE *size);
  52. VOID _gx_accordion_menu_draw(GX_ACCORDION_MENU *menu);
  53. UINT _gx_accordion_menu_event_process(GX_ACCORDION_MENU *accordion, GX_EVENT *event_ptr);
  54. UINT _gx_accordion_menu_position(GX_ACCORDION_MENU *accordion);
  55. UINT _gx_menu_create(GX_MENU *menu, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  56. GX_RESOURCE_ID text_id, GX_RESOURCE_ID fill_id,
  57. ULONG style, USHORT menu_id, GX_CONST GX_RECTANGLE *size);
  58. VOID _gx_menu_draw(GX_MENU *menu);
  59. UINT _gx_menu_insert(GX_MENU *menu, GX_WIDGET *widget);
  60. UINT _gx_menu_one_level_position(GX_MENU *menu, GX_VALUE indentation);
  61. UINT _gx_menu_position(GX_MENU *menu, GX_VALUE indentation);
  62. UINT _gx_menu_remove(GX_MENU *menu, GX_WIDGET *widget);
  63. VOID _gx_menu_text_draw(GX_MENU *menu);
  64. UINT _gx_menu_text_offset_set(GX_MENU *menu, GX_VALUE x_offset, GX_VALUE y_offset);
  65. /* error checking versions of menu API functions. */
  66. UINT _gxe_accordion_menu_create(GX_ACCORDION_MENU *accordion, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  67. ULONG style, USHORT accordion_menu_id, GX_CONST GX_RECTANGLE *size, UINT control_block_size);
  68. UINT _gxe_accordion_menu_event_process(GX_ACCORDION_MENU *accordion, GX_EVENT *event_ptr);
  69. UINT _gxe_accordion_menu_position(GX_ACCORDION_MENU *accordion);
  70. UINT _gxe_menu_create(GX_MENU *menu, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  71. GX_RESOURCE_ID text_id, GX_RESOURCE_ID fill_id,
  72. ULONG style, USHORT menu_id, GX_CONST GX_RECTANGLE *size, UINT control_block_size);
  73. UINT _gxe_menu_insert(GX_MENU *menu, GX_WIDGET *widget);
  74. UINT _gxe_menu_remove(GX_MENU *menu, GX_WIDGET *widget);
  75. UINT _gxe_menu_text_offset_set(GX_MENU *menu, GX_VALUE x_offset, GX_VALUE y_offset);
  76. #endif