class_windowdialog.rst 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the WindowDialog.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_WindowDialog:
  6. WindowDialog
  7. ============
  8. **Inherits:** :ref:`Popup<class_Popup>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`AcceptDialog<class_AcceptDialog>`
  10. Base class for window dialogs.
  11. Description
  12. -----------
  13. Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel :ref:`Control<class_Control>` that draws a window decoration and allows motion and resizing.
  14. Properties
  15. ----------
  16. +-----------------------------+---------------------------------------------------------------+-----------+
  17. | :ref:`bool<class_bool>` | :ref:`resizable<class_WindowDialog_property_resizable>` | ``false`` |
  18. +-----------------------------+---------------------------------------------------------------+-----------+
  19. | :ref:`String<class_String>` | :ref:`window_title<class_WindowDialog_property_window_title>` | ``""`` |
  20. +-----------------------------+---------------------------------------------------------------+-----------+
  21. Methods
  22. -------
  23. +-------------------------------------------+---------------------------------------------------------------------------------+
  24. | :ref:`TextureButton<class_TextureButton>` | :ref:`get_close_button<class_WindowDialog_method_get_close_button>` **(** **)** |
  25. +-------------------------------------------+---------------------------------------------------------------------------------+
  26. Theme Properties
  27. ----------------
  28. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  29. | :ref:`Color<class_Color>` | :ref:`title_color<class_WindowDialog_theme_color_title_color>` | ``Color( 0, 0, 0, 1 )`` |
  30. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  31. | :ref:`int<class_int>` | :ref:`close_h_ofs<class_WindowDialog_theme_constant_close_h_ofs>` | ``18`` |
  32. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  33. | :ref:`int<class_int>` | :ref:`close_v_ofs<class_WindowDialog_theme_constant_close_v_ofs>` | ``18`` |
  34. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  35. | :ref:`int<class_int>` | :ref:`scaleborder_size<class_WindowDialog_theme_constant_scaleborder_size>` | ``4`` |
  36. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  37. | :ref:`int<class_int>` | :ref:`title_height<class_WindowDialog_theme_constant_title_height>` | ``20`` |
  38. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  39. | :ref:`Font<class_Font>` | :ref:`title_font<class_WindowDialog_theme_font_title_font>` | |
  40. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  41. | :ref:`Texture<class_Texture>` | :ref:`close<class_WindowDialog_theme_icon_close>` | |
  42. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  43. | :ref:`Texture<class_Texture>` | :ref:`close_highlight<class_WindowDialog_theme_icon_close_highlight>` | |
  44. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  45. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_WindowDialog_theme_style_panel>` | |
  46. +---------------------------------+-----------------------------------------------------------------------------+-------------------------+
  47. Property Descriptions
  48. ---------------------
  49. .. _class_WindowDialog_property_resizable:
  50. - :ref:`bool<class_bool>` **resizable**
  51. +-----------+----------------------+
  52. | *Default* | ``false`` |
  53. +-----------+----------------------+
  54. | *Setter* | set_resizable(value) |
  55. +-----------+----------------------+
  56. | *Getter* | get_resizable() |
  57. +-----------+----------------------+
  58. If ``true``, the user can resize the window.
  59. ----
  60. .. _class_WindowDialog_property_window_title:
  61. - :ref:`String<class_String>` **window_title**
  62. +-----------+------------------+
  63. | *Default* | ``""`` |
  64. +-----------+------------------+
  65. | *Setter* | set_title(value) |
  66. +-----------+------------------+
  67. | *Getter* | get_title() |
  68. +-----------+------------------+
  69. The text displayed in the window's title bar.
  70. Method Descriptions
  71. -------------------
  72. .. _class_WindowDialog_method_get_close_button:
  73. - :ref:`TextureButton<class_TextureButton>` **get_close_button** **(** **)**
  74. Returns the close :ref:`TextureButton<class_TextureButton>`.
  75. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  76. Theme Property Descriptions
  77. ---------------------------
  78. .. _class_WindowDialog_theme_color_title_color:
  79. - :ref:`Color<class_Color>` **title_color**
  80. +-----------+-------------------------+
  81. | *Default* | ``Color( 0, 0, 0, 1 )`` |
  82. +-----------+-------------------------+
  83. The color of the title text.
  84. ----
  85. .. _class_WindowDialog_theme_constant_close_h_ofs:
  86. - :ref:`int<class_int>` **close_h_ofs**
  87. +-----------+--------+
  88. | *Default* | ``18`` |
  89. +-----------+--------+
  90. The horizontal offset of the close button.
  91. ----
  92. .. _class_WindowDialog_theme_constant_close_v_ofs:
  93. - :ref:`int<class_int>` **close_v_ofs**
  94. +-----------+--------+
  95. | *Default* | ``18`` |
  96. +-----------+--------+
  97. The vertical offset of the close button.
  98. ----
  99. .. _class_WindowDialog_theme_constant_scaleborder_size:
  100. - :ref:`int<class_int>` **scaleborder_size**
  101. +-----------+-------+
  102. | *Default* | ``4`` |
  103. +-----------+-------+
  104. The thickness of the border that can be dragged when scaling the window (if :ref:`resizable<class_WindowDialog_property_resizable>` is enabled).
  105. ----
  106. .. _class_WindowDialog_theme_constant_title_height:
  107. - :ref:`int<class_int>` **title_height**
  108. +-----------+--------+
  109. | *Default* | ``20`` |
  110. +-----------+--------+
  111. The vertical offset of the title text.
  112. ----
  113. .. _class_WindowDialog_theme_font_title_font:
  114. - :ref:`Font<class_Font>` **title_font**
  115. The font used to draw the title.
  116. ----
  117. .. _class_WindowDialog_theme_icon_close:
  118. - :ref:`Texture<class_Texture>` **close**
  119. The icon for the close button.
  120. ----
  121. .. _class_WindowDialog_theme_icon_close_highlight:
  122. - :ref:`Texture<class_Texture>` **close_highlight**
  123. The icon used for the close button when it's hovered with the mouse cursor.
  124. ----
  125. .. _class_WindowDialog_theme_style_panel:
  126. - :ref:`StyleBox<class_StyleBox>` **panel**
  127. The style for both the content background of the ``WindowDialog`` and the title bar. The title bar is created with a top border and an expand margin using the ``panel`` stylebox.
  128. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  129. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  130. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`