class_menubutton.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the MenuButton.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_MenuButton:
  5. MenuButton
  6. ==========
  7. **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>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Special button that brings up a :ref:`PopupMenu<class_PopupMenu>` when clicked.
  12. Properties
  13. ----------
  14. +-------------------------+-------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`switch_on_hover<class_MenuButton_property_switch_on_hover>` |
  16. +-------------------------+-------------------------------------------------------------------+
  17. Methods
  18. -------
  19. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_popup<class_MenuButton_method_get_popup>` **(** **)** const |
  21. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_disable_shortcuts<class_MenuButton_method_set_disable_shortcuts>` **(** :ref:`bool<class_bool>` disabled **)** |
  23. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+
  24. Theme Properties
  25. ----------------
  26. +---------------------------------+---------------------+
  27. | :ref:`StyleBox<class_StyleBox>` | disabled |
  28. +---------------------------------+---------------------+
  29. | :ref:`StyleBox<class_StyleBox>` | focus |
  30. +---------------------------------+---------------------+
  31. | :ref:`Font<class_Font>` | font |
  32. +---------------------------------+---------------------+
  33. | :ref:`Color<class_Color>` | font_color |
  34. +---------------------------------+---------------------+
  35. | :ref:`Color<class_Color>` | font_color_disabled |
  36. +---------------------------------+---------------------+
  37. | :ref:`Color<class_Color>` | font_color_hover |
  38. +---------------------------------+---------------------+
  39. | :ref:`Color<class_Color>` | font_color_pressed |
  40. +---------------------------------+---------------------+
  41. | :ref:`StyleBox<class_StyleBox>` | hover |
  42. +---------------------------------+---------------------+
  43. | :ref:`int<class_int>` | hseparation |
  44. +---------------------------------+---------------------+
  45. | :ref:`StyleBox<class_StyleBox>` | normal |
  46. +---------------------------------+---------------------+
  47. | :ref:`StyleBox<class_StyleBox>` | pressed |
  48. +---------------------------------+---------------------+
  49. Signals
  50. -------
  51. .. _class_MenuButton_signal_about_to_show:
  52. - **about_to_show** **(** **)**
  53. Emitted when :ref:`PopupMenu<class_PopupMenu>` of this MenuButton is about to show.
  54. Description
  55. -----------
  56. 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.
  57. Property Descriptions
  58. ---------------------
  59. .. _class_MenuButton_property_switch_on_hover:
  60. - :ref:`bool<class_bool>` **switch_on_hover**
  61. +----------+----------------------------+
  62. | *Setter* | set_switch_on_hover(value) |
  63. +----------+----------------------------+
  64. | *Getter* | is_switch_on_hover() |
  65. +----------+----------------------------+
  66. 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.
  67. Method Descriptions
  68. -------------------
  69. .. _class_MenuButton_method_get_popup:
  70. - :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** const
  71. Return the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  72. .. _class_MenuButton_method_set_disable_shortcuts:
  73. - void **set_disable_shortcuts** **(** :ref:`bool<class_bool>` disabled **)**