-
Notifications
You must be signed in to change notification settings - Fork 0
vtf video frame
class frame.FramePadding ¶
This widget frame definition object can be passed to a Cell.
Frame width and pattern is defined sweepingly by the length and composition of the strings at N, O, S, E, NE, NO, SE, SO. Thereby the name of the parameter corresponds to the cardinal direction and the characters are always arranged starting from the widget border. In addition, the default character can be passed in the second position of a tuple (
<NBSP>by default), this is used to fill remaining space. The passing ofNoneis equivalent to("", <NBSP>).In order to grant the frame also accordingly place, the parameters widget_x_calc, and/or widget_y_calc must be defined compellingly by a GeoCalculator object. These Calculate the size of the widget based on the height/width of the cell, the remaining space available for the frame is the difference. Tip:
>>> widget_x_calc=GeoCalculator(base_spec=1.0, perc_spec_adjustment= -(len(E) + len(O)) ) >>> widget_y_calc=GeoCalculator(base_spec=1.0, perc_spec_adjustment= -(len(N) + len(S)) ),If the orientation of the widget is specified via widget_orient, the widths of the frame sides are not adjusted according to the space, instead the opposite side(s) are extended as far as possible and if necessary the frames of the defined cardinal direction are shortened. Shortening of the frame definitions can generally be allowed via mutable. If
"in"is passed, shortening is determined from the characters located at the widget onwards, via"out"the shortening is determined starting from the cell border.>>> frame = FramePadding( ... NE="⁴4K", N="nŋN", NO="¹1I", ... E=("e€E", "×"), O="oøO", ... SE=("³3M", "/"), S=("sſS", "$"), SO="²2U", ... ... widget_orient="NO", ... mutable="out", ... fold_mutable="in" ... ) >>> frame.resize(widget_size=(10, 3), cell_size=(25, 11)) ... ×××××××××KNNNNNNNNNNNNNNI ... ×××××××××E4ŋŋŋŋŋŋŋŋŋŋŋŋ1O ... ×××××××××E€⁴nnnnnnnnnn¹øO ... ×××××××××E€e oøO ... ×××××××××E€e oøO ... ×××××××××E€e oøO ... ×××××××××E€³ssssssssss²øO ... ×××××××××E3ſſſſſſſſſſſſ2O ... ×××××××××MSSSSSSSSSSSSSSU ... ××××××××/$$$$$$$$$$$$$$$$ ... ×××××××/$$$$$$$$$$$$$$$$$ >>> frame.resize(widget_size=(10, 3), cell_size=(15, 8)) ... EKŋŋŋŋŋŋŋŋŋŋŋŋI ... E€4nnnnnnnnnn1ø ... E€e oø ... E€e oø ... E€e oø ... E€³ssssssssss2ø ... E3ſſſſſſſſſſſſU ... MSSSSSSSSSSSSSSThe object is further treated via the Cell.
E: list[str]
N: list[str]
O: list[str]
S: list[str]
cell_size: tuple[int, int]
expanse_E: int
expanse_N: int
expanse_O: int
expanse_S: int
mutable: bool
widget_orient: Literal["N", "O", "S", "E", "NO", "NE", "SO", "SE", ""]
widget_size: tuple[int, int]
widget_x_calc: GeoCalculator
widget_y_calc: GeoCalculator
__init__(N=None, O=None, S=None, E=None, NO=None, SO=None, SE=None, NE=None, widget_x_calc=None, widget_y_calc=None, widget_orient=None, mutable=None, fold_mutable="out") ¶
__repr__() -> str ¶
resize(cell_size=None) -> None ¶
Calculate the widget size based on the cell_size and build the frame.
raises:
- GeometrieError: Remaining space not enough for frame and frame is not mutable.
overload settings(*, N=..., O=..., S=..., E=..., NO=..., SO=..., SE=..., NE=..., widget_orient=..., mutable=..., fold_mutable=...) -> None
settings(**kwargs) -> None ¶
Changes the size, composition and properties of the frame.
| Date: | 23 Apr 2023 |
|---|---|
| Version: | 0.1 |
| Author: | Adrian Hoefflin [srccircumflex] |
| Doc-Generator: | "pyiStructure-RSTGenerator" <prototype> |
