awsc.base_control.DeleteResourceDialog
- class awsc.base_control.DeleteResourceDialog(*args, resource_type, resource_identifier, callback, action_name='Delete', from_what=None, from_what_name=None, undoable=False, can_force=False, extra_fields=None, **kwargs)
Convenience dialog for requesting confirmation for an action. By default, this is tuned for delete actions but really, anything that requires a ok or cancel button can be put here.
- Attributes:
border
Returns the border of the control.
corners
Read-only property for calculating the four corners of the block.
height
Read-only property for the height of the block.
inner
Read-only property for calculating the four inner corners of the block.
w_in
Read-only property for the inner width of the block.
width
Read-only property for the width of the block.
Methods
accept_and_close
()Callback for the affirmative action of the dialog.
add_block
(block)Adds a new child block to this block.
add_field
(field)Inserts a new field into the dialog.
before_paint
()Hook function for acting on the block before any blocks are painted for the current frame.
bottomright
()Returns the coordinates of the bottom right corner of the block.
clear_blocks
([tag])Removes all blocks with the matching tag from the child blocks of this block.
close
()Callback for the negative action of the dialog.
input
(key)Input handler hook function.
nop
()A callable that does nothing, for the purpose of having such a callable.
opener
(*args, caller, **kwargs)Session-aware initializer for this class.
paint
()Hook function for painting the block.
remove_block
(block)Removes a specific block from this block.
reparent
()Shorthand function for removing a Block from its parent and re-adding it.
set_title_label
(text)Sets the text on the title label.
topleft
()Returns the coordinates of the top left corner of the block.
on_become_frame
- __init__(*args, resource_type, resource_identifier, callback, action_name='Delete', from_what=None, from_what_name=None, undoable=False, can_force=False, extra_fields=None, **kwargs)
Initializes a DeleteResourceDialog.
- Parameters:
- resource_typestr, optional
The name of the type of resource being managed.
- resource_identifierstr, optional
Identifier for the resource being managed. Does not need to be a primary key, this is for display purposes only.
- undoablebool, default: False
Cosmetic, to display a warning about data loss if not set to true.
- can_forcebool, default: False
Adds an additional force checkbox to the confirmation dialog if set.
- extra_fieldsdict, optional
A map of additional fields to add to the confirmation dialog, where the key is the name of the field, and the value is a DialogField instance. These fields will be passed keyed by the key to the action callback.
- action_namestr, default: “Delete”
The name of the action being performed if the dialog is confirmed. Defaults to ‘Delete’ as that is both the original purpose of confirmation dialogs and the most common action requiring a confirmation.
- from_whatstr, optional
If the action is to sever the link between two resources, we can add more context to the label by filling this field. This is the type of the other resource in the link if a link is being severed.
- from_what_namestr, optional
This is the resource identifier for the resource named in from_what.
Methods
__init__
(*args, resource_type, ...[, ...])Initializes a DeleteResourceDialog.
accept_and_close
()Callback for the affirmative action of the dialog.
add_block
(block)Adds a new child block to this block.
add_field
(field)Inserts a new field into the dialog.
before_paint
()Hook function for acting on the block before any blocks are painted for the current frame.
bottomright
()Returns the coordinates of the bottom right corner of the block.
clear_blocks
([tag])Removes all blocks with the matching tag from the child blocks of this block.
close
()Callback for the negative action of the dialog.
input
(key)Input handler hook function.
nop
()A callable that does nothing, for the purpose of having such a callable.
on_become_frame
()opener
(*args, caller, **kwargs)Session-aware initializer for this class.
paint
()Hook function for painting the block.
remove_block
(block)Removes a specific block from this block.
reparent
()Shorthand function for removing a Block from its parent and re-adding it.
set_title_label
(text)Sets the text on the title label.
topleft
()Returns the coordinates of the top left corner of the block.
Attributes
border
Returns the border of the control.
corners
Read-only property for calculating the four corners of the block.
height
Read-only property for the height of the block.
inner
Read-only property for calculating the four inner corners of the block.
line_size
w_in
Read-only property for the inner width of the block.
width
Read-only property for the width of the block.