Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
AcceptDialog¶
Inherits: WindowDialog < Popup < Control < CanvasItem < Node < Object
Inherited By: ConfirmationDialog
Diálogo base para la notificación al usuario.
Descripción¶
Este cuadro de diálogo es útil para pequeñas notificaciones al usuario sobre un evento. Sólo puede ser aceptado o cerrado, devolviendo el mismo resultado.
Propiedades¶
|
||
|
||
|
||
window_title |
|
Métodos¶
add_button ( String text, bool right=false, String action="" ) |
|
add_cancel ( String name ) |
|
get_label ( ) |
|
get_ok ( ) |
|
void |
register_text_enter ( Node line_edit ) |
void |
remove_button ( Control button ) |
Señales¶
confirmed ( )
Se emite cuando se acepta el diálogo, es decir, se pulsa el botón OK.
custom_action ( String action )
Se emite cuando se presiona un botón personalizado. Ver add_button.
Descripciones de Propiedades¶
bool dialog_autowrap
Default |
|
Setter |
set_autowrap(value) |
Getter |
has_autowrap() |
El texto se expande automáticamente en el diálogo.
bool dialog_hide_on_ok
Default |
|
Setter |
set_hide_on_ok(value) |
Getter |
get_hide_on_ok() |
Si true
, el diálogo se oculta cuando se pulsa el botón OK. Puedes ajustarlo a false
si quieres hacer, por ejemplo, la validación de entrada al recibir la señal confirmed, y manejar el ocultamiento del diálogo en tu propia lógica.
Nota: Algunos nodos derivados de esta clase pueden tener un valor por defecto diferente, y potencialmente su propia lógica incorporada anulando este ajuste. Por ejemplo, FileDialog tiene por defecto false
, y tiene su propio código de validación de entrada que se llama al pulsar OK, que eventualmente oculta el diálogo si la entrada es válida. Como tal, esta propiedad no puede ser usada en FileDialog para deshabilitar la ocultación del diálogo cuando se presiona OK.
String dialog_text
Default |
|
Setter |
set_text(value) |
Getter |
get_text() |
El texto mostrado en el diálogo.
Descripciones de Métodos¶
Adds a button with label text
and a custom action
to the dialog and returns the created button. action
will be passed to the custom_action signal when pressed.
If true
, right
will place the button to the right of any sibling buttons.
You can use remove_button method to remove a button created with this method from the dialog.
Adds a button with label name
and a cancel action to the dialog and returns the created button.
You can use remove_button method to remove a button created with this method from the dialog.
Label get_label ( )
Returns the label used for built-in text.
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 CanvasItem.visible property.
Button get_ok ( )
Retorna la instancia de el Button aceptar.
Warning: Esto es un nodo interno requerido, removerlo y liberarlo podría causar un crasheo. Si deseas esconder este o alguno de sus hijos, utiliza su propiedad CanvasItem.visible.
void register_text_enter ( Node line_edit )
Registra un LineEdit en el diálogo. Cuando se pulsa la tecla intro, el diálogo se acepta.
void remove_button ( Control button )
Removes the button
from the dialog. Does NOT free the button
. The button
must be a Button added with add_button or add_cancel method. After removal, pressing the button
will no longer emit this dialog's custom_action signal or cancel this dialog.