awsc.termui.dialog.DialogControl
- class awsc.termui.dialog.DialogControl(*args, ok_action=None, cancel_action=None, background_color=None, confirm_text='Ok', cancel_text='Cancel', color=Color(Palette8Bit, 220, None), selected_color=Color(Palette8Bit, 0, 220), **kwargs)
A generic dialog. A dialog is intended to be used as a form that can be filled by the user for some action to happen.
- Attributes:
- highlightedint
The index of the control that is currently selected.
- fieldslist(awsc.termui.dialog.DialogField)
A list of field objects associated with the dialog.
- bookmarkint
The position where the next field will be inserted. The confirm and cancel buttons, if used, are forcibly pushed as the last controls in the list, so bookmark always preceeds the confirm and cancel buttons.
- background_colorawsc.termui.color.Color
The background color to fill the dialog with.
Methods
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.
input
(key)Input handler hook function.
nop
()A callable that does nothing, for the purpose of having such a callable.
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.
topleft
()Returns the coordinates of the top left corner of the block.
on_become_frame
- __init__(*args, ok_action=None, cancel_action=None, background_color=None, confirm_text='Ok', cancel_text='Cancel', color=Color(Palette8Bit, 220, None), selected_color=Color(Palette8Bit, 0, 220), **kwargs)
Initializes a Control object.
- Parameters:
- borderawsc.termui.control.Border
The border of the control.
Methods
__init__
(*args[, ok_action, cancel_action, ...])Initializes a Control object.
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.
input
(key)Input handler hook function.
nop
()A callable that does nothing, for the purpose of having such a callable.
on_become_frame
()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.
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.
w_in
Read-only property for the inner width of the block.
width
Read-only property for the width of the block.