simvx.core.ui.enums¶
UI enums: FocusMode, FocusDirection, PointerFilter, AcceptsPointers, Anchor, SizeFlags, HAlign, VAlign.
Module Contents¶
Classes¶
Which way a directional focus move goes. |
|
How a control takes part in the pointer hit test. |
|
Which pointers a control takes, once the hit test has found it. |
|
Where a control sits in its parent’s rect, for :attr: |
|
Controls how a widget behaves inside a container layout. |
Data¶
API¶
- simvx.core.ui.enums.__all__¶
[‘FocusMode’, ‘FocusDirection’, ‘PointerFilter’, ‘AcceptsPointers’, ‘Anchor’, ‘SizeFlags’, ‘HAlign’,…
- class simvx.core.ui.enums.FocusDirection[source]¶
Bases:
enum.StrEnumWhich way a directional focus move goes.
Tab order is a list and moves along it; a pad’s D-pad and stick move on screen, so a direction is a geometric question answered from the controls’ rects rather than from their order in the tree.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- UP¶
‘up’
- DOWN¶
‘down’
- LEFT¶
‘left’
- RIGHT¶
‘right’
- __new__(*values)¶
- __add__()¶
- __contains__()¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getitem__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __iter__()¶
- __le__()¶
- __len__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rmod__()¶
- __rmul__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- capitalize()¶
- casefold()¶
- center()¶
- count()¶
- encode()¶
- endswith()¶
- expandtabs()¶
- find()¶
- format()¶
- format_map()¶
- index()¶
- isalnum()¶
- isalpha()¶
- isascii()¶
- isdecimal()¶
- isdigit()¶
- isidentifier()¶
- islower()¶
- isnumeric()¶
- isprintable()¶
- isspace()¶
- istitle()¶
- isupper()¶
- join()¶
- ljust()¶
- lower()¶
- lstrip()¶
- partition()¶
- removeprefix()¶
- removesuffix()¶
- replace()¶
- rfind()¶
- rindex()¶
- rjust()¶
- rpartition()¶
- rsplit()¶
- rstrip()¶
- split()¶
- splitlines()¶
- startswith()¶
- strip()¶
- swapcase()¶
- title()¶
- translate()¶
- upper()¶
- zfill()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.ui.enums.PointerFilter[source]¶
Bases:
enum.StrEnumHow a control takes part in the pointer hit test.
A hit-testing policy, not a handler one: it decides who is under the pointer, while
consumedecides who stops the broadcast, so the two never arbitrate the same decision.Members: IGNORE: Invisible to the hit test. The pointer passes through as though the control were not there. What a widget that is only looked at declares:
Label,ProgressBar. PASS: Hit-testable, and does not stop the pointer reaching what is behind it. Both the control and whatever sits under it are offered the event, nearest first. The default, so a panel or a container over a game viewport never eats a click meant for the game. STOP: Hit-testable, and blocks. Nothing behind it sees the pointer. What a widget the player operates declares: a button, a slider, a text field, a dialog.A property takes the member or its plain string:
panel.pointer_filter = "ignore"andpanel.pointer_filter = PointerFilter.IGNOREare the same assignment.Initialization
Initialize self. See help(type(self)) for accurate signature.
- IGNORE¶
‘ignore’
- PASS¶
‘pass’
- STOP¶
‘stop’
- __new__(*values)¶
- __add__()¶
- __contains__()¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getitem__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __iter__()¶
- __le__()¶
- __len__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rmod__()¶
- __rmul__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- capitalize()¶
- casefold()¶
- center()¶
- count()¶
- encode()¶
- endswith()¶
- expandtabs()¶
- find()¶
- format()¶
- format_map()¶
- index()¶
- isalnum()¶
- isalpha()¶
- isascii()¶
- isdecimal()¶
- isdigit()¶
- isidentifier()¶
- islower()¶
- isnumeric()¶
- isprintable()¶
- isspace()¶
- istitle()¶
- isupper()¶
- join()¶
- ljust()¶
- lower()¶
- lstrip()¶
- partition()¶
- removeprefix()¶
- removesuffix()¶
- replace()¶
- rfind()¶
- rindex()¶
- rjust()¶
- rpartition()¶
- rsplit()¶
- rstrip()¶
- split()¶
- splitlines()¶
- startswith()¶
- strip()¶
- swapcase()¶
- title()¶
- translate()¶
- upper()¶
- zfill()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.ui.enums.AcceptsPointers[source]¶
Bases:
enum.StrEnumWhich pointers a control takes, once the hit test has found it.
A separate question from :class:
PointerFilter, which decides whether the control is under the pointer at all. This one decides how many pointers it can hold at once, and only a widget built for several fingers answers anything but the default.Members: PRIMARY: The primary pointer only, which is the mouse and the finger standing in for it. Every ordinary widget wants this: a button pressed by two fingers at once is one press. ALL: Every pointer, each tracked on its own, for a widget that means something different under two fingers: an on-screen pad, a pinch surface, a drawing canvas.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- PRIMARY¶
‘primary’
- ALL¶
‘all’
- __new__(*values)¶
- __add__()¶
- __contains__()¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getitem__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __iter__()¶
- __le__()¶
- __len__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rmod__()¶
- __rmul__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- capitalize()¶
- casefold()¶
- center()¶
- count()¶
- encode()¶
- endswith()¶
- expandtabs()¶
- find()¶
- format()¶
- format_map()¶
- index()¶
- isalnum()¶
- isalpha()¶
- isascii()¶
- isdecimal()¶
- isdigit()¶
- isidentifier()¶
- islower()¶
- isnumeric()¶
- isprintable()¶
- isspace()¶
- istitle()¶
- isupper()¶
- join()¶
- ljust()¶
- lower()¶
- lstrip()¶
- partition()¶
- removeprefix()¶
- removesuffix()¶
- replace()¶
- rfind()¶
- rindex()¶
- rjust()¶
- rpartition()¶
- rsplit()¶
- rstrip()¶
- split()¶
- splitlines()¶
- startswith()¶
- strip()¶
- swapcase()¶
- title()¶
- translate()¶
- upper()¶
- zfill()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.ui.enums.Anchor[source]¶
Bases:
enum.StrEnumWhere a control sits in its parent’s rect, for :attr:
Control.anchor.Each member fixes the control on both axes, and on each axis it is one of three kinds. A side (left, right, top, bottom) holds the control against that edge of the parent, :attr:
Control.insetpixels in from it. A centre centres it between the two insets. A wide axis stretches it from one inset to the other, and its size on that axis is ignored.BOTTOM_WIDEwithsize=(0, 48)is a full-width strip 48 tall along the bottom;FULL_RECTwithinset=10fills the parent less 10 all round.Initialization
Initialize self. See help(type(self)) for accurate signature.
- TOP_LEFT¶
‘top_left’
- TOP_RIGHT¶
‘top_right’
- BOTTOM_LEFT¶
‘bottom_left’
- BOTTOM_RIGHT¶
‘bottom_right’
- CENTER_LEFT¶
‘center_left’
- CENTER_RIGHT¶
‘center_right’
- CENTER_TOP¶
‘center_top’
- CENTER_BOTTOM¶
‘center_bottom’
- CENTER¶
‘center’
- LEFT_WIDE¶
‘left_wide’
- RIGHT_WIDE¶
‘right_wide’
- TOP_WIDE¶
‘top_wide’
- BOTTOM_WIDE¶
‘bottom_wide’
- FULL_RECT¶
‘full_rect’
- __new__(*values)¶
- __add__()¶
- __contains__()¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getitem__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __iter__()¶
- __le__()¶
- __len__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rmod__()¶
- __rmul__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- capitalize()¶
- casefold()¶
- center()¶
- count()¶
- encode()¶
- endswith()¶
- expandtabs()¶
- find()¶
- format()¶
- format_map()¶
- index()¶
- isalnum()¶
- isalpha()¶
- isascii()¶
- isdecimal()¶
- isdigit()¶
- isidentifier()¶
- islower()¶
- isnumeric()¶
- isprintable()¶
- isspace()¶
- istitle()¶
- isupper()¶
- join()¶
- ljust()¶
- lower()¶
- lstrip()¶
- partition()¶
- removeprefix()¶
- removesuffix()¶
- replace()¶
- rfind()¶
- rindex()¶
- rjust()¶
- rpartition()¶
- rsplit()¶
- rstrip()¶
- split()¶
- splitlines()¶
- startswith()¶
- strip()¶
- swapcase()¶
- title()¶
- translate()¶
- upper()¶
- zfill()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.ui.enums.SizeFlags[source]¶
Bases:
enum.IntFlagControls how a widget behaves inside a container layout.
Composable via bitwise OR:
SizeFlags.EXPAND | SizeFlags.FILL.Initialization
Initialize self. See help(type(self)) for accurate signature.
- SHRINK_BEGIN¶
0
- FILL¶
1
- EXPAND¶
2
- EXPAND_FILL¶
3
- SHRINK_CENTER¶
4
- SHRINK_END¶
8
- __abs__()¶
- __add__()¶
- __and__()¶
- __bool__()¶
- __ceil__()¶
- __delattr__()¶
- __dir__()¶
- __divmod__()¶
- __eq__()¶
- __float__()¶
- __floor__()¶
- __floordiv__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __index__()¶
- __int__()¶
- __invert__()¶
- __le__()¶
- __lshift__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __neg__()¶
- __new__()¶
- __or__()¶
- __pos__()¶
- __pow__()¶
- __radd__()¶
- __rand__()¶
- __rdivmod__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rfloordiv__()¶
- __rlshift__()¶
- __rmod__()¶
- __rmul__()¶
- __ror__()¶
- __round__()¶
- __rpow__()¶
- __rrshift__()¶
- __rshift__()¶
- __rsub__()¶
- __rtruediv__()¶
- __rxor__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __sub__()¶
- __subclasshook__()¶
- __truediv__()¶
- __trunc__()¶
- __xor__()¶
- as_integer_ratio()¶
- bit_count()¶
- bit_length()¶
- conjugate()¶
- class denominator¶
- class imag¶
- is_integer()¶
- class numerator¶
- class real¶
- to_bytes()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- __contains__(other)¶
- __iter__()¶
- __len__()¶