class_menubutton.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the MenuButton.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_MenuButton:
  6. MenuButton
  7. ==========
  8. **Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Special button that brings up a :ref:`PopupMenu<class_PopupMenu>` when clicked.
  13. Properties
  14. ----------
  15. +-------------------------+-------------------------------------------------------------------+-------+
  16. | :ref:`bool<class_bool>` | :ref:`switch_on_hover<class_MenuButton_property_switch_on_hover>` | false |
  17. +-------------------------+-------------------------------------------------------------------+-------+
  18. Methods
  19. -------
  20. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_popup<class_MenuButton_method_get_popup>` **(** **)** const |
  22. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_disable_shortcuts<class_MenuButton_method_set_disable_shortcuts>` **(** :ref:`bool<class_bool>` disabled **)** |
  24. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  25. Theme Properties
  26. ----------------
  27. +---------------------------------+---------------------+------------------------------+
  28. | :ref:`StyleBox<class_StyleBox>` | disabled | |
  29. +---------------------------------+---------------------+------------------------------+
  30. | :ref:`StyleBox<class_StyleBox>` | focus | |
  31. +---------------------------------+---------------------+------------------------------+
  32. | :ref:`Font<class_Font>` | font | |
  33. +---------------------------------+---------------------+------------------------------+
  34. | :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
  35. +---------------------------------+---------------------+------------------------------+
  36. | :ref:`Color<class_Color>` | font_color_disabled | Color( 1, 1, 1, 0.3 ) |
  37. +---------------------------------+---------------------+------------------------------+
  38. | :ref:`Color<class_Color>` | font_color_hover | Color( 0.94, 0.94, 0.94, 1 ) |
  39. +---------------------------------+---------------------+------------------------------+
  40. | :ref:`Color<class_Color>` | font_color_pressed | Color( 1, 1, 1, 1 ) |
  41. +---------------------------------+---------------------+------------------------------+
  42. | :ref:`StyleBox<class_StyleBox>` | hover | |
  43. +---------------------------------+---------------------+------------------------------+
  44. | :ref:`int<class_int>` | hseparation | 3 |
  45. +---------------------------------+---------------------+------------------------------+
  46. | :ref:`StyleBox<class_StyleBox>` | normal | |
  47. +---------------------------------+---------------------+------------------------------+
  48. | :ref:`StyleBox<class_StyleBox>` | pressed | |
  49. +---------------------------------+---------------------+------------------------------+
  50. Signals
  51. -------
  52. .. _class_MenuButton_signal_about_to_show:
  53. - **about_to_show** **(** **)**
  54. Emitted when :ref:`PopupMenu<class_PopupMenu>` of this MenuButton is about to show.
  55. Description
  56. -----------
  57. Special button that brings up a :ref:`PopupMenu<class_PopupMenu>` when clicked. That's pretty much all it does, as it's just a helper class when building GUIs.
  58. Property Descriptions
  59. ---------------------
  60. .. _class_MenuButton_property_switch_on_hover:
  61. - :ref:`bool<class_bool>` **switch_on_hover**
  62. +-----------+----------------------------+
  63. | *Default* | false |
  64. +-----------+----------------------------+
  65. | *Setter* | set_switch_on_hover(value) |
  66. +-----------+----------------------------+
  67. | *Getter* | is_switch_on_hover() |
  68. +-----------+----------------------------+
  69. If ``true``, when the cursor hovers above another MenuButton within the same parent which also has ``switch_on_hover`` enabled, it will close the current MenuButton and open the other one.
  70. Method Descriptions
  71. -------------------
  72. .. _class_MenuButton_method_get_popup:
  73. - :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** const
  74. Returns the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  75. .. _class_MenuButton_method_set_disable_shortcuts:
  76. - void **set_disable_shortcuts** **(** :ref:`bool<class_bool>` disabled **)**