class_menubutton.rst 4.3 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>` |
  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 |
  35. +---------------------------------+---------------------+
  36. | :ref:`Color<class_Color>` | font_color_disabled |
  37. +---------------------------------+---------------------+
  38. | :ref:`Color<class_Color>` | font_color_hover |
  39. +---------------------------------+---------------------+
  40. | :ref:`Color<class_Color>` | font_color_pressed |
  41. +---------------------------------+---------------------+
  42. | :ref:`StyleBox<class_StyleBox>` | hover |
  43. +---------------------------------+---------------------+
  44. | :ref:`int<class_int>` | hseparation |
  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. | *Setter* | set_switch_on_hover(value) |
  64. +----------+----------------------------+
  65. | *Getter* | is_switch_on_hover() |
  66. +----------+----------------------------+
  67. 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.
  68. Method Descriptions
  69. -------------------
  70. .. _class_MenuButton_method_get_popup:
  71. - :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** const
  72. Returns the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  73. ----
  74. .. _class_MenuButton_method_set_disable_shortcuts:
  75. - void **set_disable_shortcuts** **(** :ref:`bool<class_bool>` disabled **)**