microGUI.Widgets.Widget
Classes
Widget is the fundamental superclass. All widgets belong to a subclass of Widget. |
Module Contents
- class microGUI.Widgets.Widget.Widget(*args, **kwargs)
Widget is the fundamental superclass. All widgets belong to a subclass of Widget.
See also
dynamic_widget_caste()
- property AllowDrop
- Gets or sets a value indicating whether the widget can accept data that the user drags onto it.
See also
DragEventArgs
DragOver
DragDrop
DragEnter
DragLeave
DoDragDrop
- property Anchor
- Gets or sets a value indicating whether the widget can accept data that the user drags onto it.
Exemple
widget = Widget() widget.Anchor = ( Widgets.AnchorStyles.Bottom | Widgets.AnchorStyles.Right )
Attention
Use the Widget.Anchor property to define how a widget is automatically resized as its parent widget is resized. Anchoring a widget to its parent widget ensures that the anchored edges remain in the same position relative to the edges of the parent widget when the parent widget is resized. You can anchor a widget to one or more edges of its container. For example, if you have a Container with a Button whose microGUI.Widgets.Button.Anchor property value is set to microGUI.Widgets.AnchorStyles.Top and
microGUI.Widgets.AnchorStyles.Bottom, the microGUI.Widgets.Button is stretched to maintain the anchored distance to the top and bottom edges of theContaineras the Height of theContaineris increased.See also
Dock
Layout
- getter:
Return
Trueif drag-and-drop operations are allowed in the widget; otherwise,False. The default isFalse.- setter:
Sets
Anchorproperty- raise TypeError:
When not set AllowDrop with a bool type or None
- type:
A bitwise combination of the Flags
microGUI.Widgets.AnchorStylesvalues.
- property BevelWidth: int
Gets or sets the bevel width of the widget.
Attention
The width of the widget’s bevel if the widget is highlighted and is to draw a bevel.
See also
microGUI.Widgets.Widget.ThisFlagsHighlightedmicroGUI.Widgets.Basic.ThisFlags.Basic
- Getter:
The bevel width of the widget in chars.
- Setter:
Sets
BevelWidthproperty- Raises:
TypeError – When
BevelWidthproperty value is not set with anintorNone- Type:
- property Bottom: int
Gets the distance, in chars, between the bottom edge of the widget and the top edge of its container’s client area.
Attention
The value of this property is equal to the sum of the
Topproperty value, and theHeightproperty value.The
Bottomproperty is a read-only property. You can manipulate this property value by changing the value of theToporHeightproperties or calling theSetBounds()methods.See also
microGUI.Widgets.Widget.TopmicroGUI.Widgets.Widget.Height
- Getter:
An int representing the distance, in chars, between the bottom edge of the widget and the top edge of its container’s client area.
- Type:
- property Bounds: microGUI.Types.Area.AreaType
Gets or sets the size and location of the widget including its nonclient elements, in pixels, relative to the parent widget.
Examples:
# Create the widget widget = Widget() # Set value directly from the widget default Bounds property widget.Bounds.pos = PointType(20, 48) widget.Bounds.size = DimType(12, 20)
# Create the widget widget = Widget() # Replace the default Bounds object by a AreaType class widget.Bounds = AreaType( PointType(20, 48), DimType(12, 20), )
See also
TopLeftLeftWidth
- property CanFocus: bool
Gets a value indicating whether the widget can receive focus.
Attention
In order for a widget to receive input focus, the
microGUI.Widgets.Widget.widgetmust be assigned, and theVisibleandEnabledproperties must both be set toTruefor both the widget and all its parent widgets, and the widget must be amicroGUI.Widgets.Window.Windowor the widget’s outermost parent must be amicroGUI.Widgets.Window.Window.See also
EnabledVisibleFocus()FocusedCanSelect
- property CanSelect