ThemedTextStepperHandler
ThemedControlHandler<3>WidgetHandler<3>WidgetHandler<2>WidgetHandler<1>public class ThemedTextStepperHandler : ThemedControlHandler<TableLayout, TextStepper, TextStepper.ICallback>, TextStepper.IHandler
Constructors
ThemedTextStepperHandler
#public ThemedTextStepperHandler()
Initializes a new instance of the ThemedTextStepperHandler class.
Properties
AllowDrop
Gets or sets a value indicating whether this control can serve as drop target.
Gets or sets a value indicating whether the selection should always be shown, even when the control does not have focus.
AutoSelectMode
#Gets or sets the auto selection mode.
Value: The auto selection mode.
Implements: AutoSelectMode
BackgroundColor
#Gets or sets the color for the background of the control
Remarks: Note that on some platforms (e.g. Mac), setting the background color of a control can change the performance characteristics of the control and its children, since it must enable layers to do so.
Value: The color of the background.
Implements: BackgroundColor
Callback
public TCallback Callback { get; }
Gets the callback object for the control
Remarks: This object is typically a single static instance that is used by the platform handlers to call private or protected methods on the widget, such as protected event methods e.g. protected virtual void OnClick(EventArgs e)
Value: The callback.
CaretIndex
#Gets or sets the index of the current insertion point.
Remarks: When there is selected text, this is usually the start of the selection.
Value: The index of the current insertion point.
Implements: CaretIndex
Connector
Gets a weak connector class to hook up events to the underlying control
Remarks: Some frameworks (e.g. gtk, monomac, ios, android) keep track of references in a way that leak objects when there is a circular reference between the control and the handler. This is the case when registering events from the control to a method implemented in the handler. This instance can be used to connect the objects together using a weak reference to the handler, allowing controls to be garbage collected.
Value: The connector instance
Control
public TControl Control { get; set; }
Gets or sets the platform-specific control object
ControlObject
Gets the instance of the platform-specific object
Cursor
Gets or sets the type of cursor to use when the mouse is hovering over the control
Value: The mouse cursor
Implements: Cursor
DisposeControl
Gets a value indicating that control should automatically be disposed when this widget is disposed
Enabled
Gets or sets a value indicating whether this control is enabled
Value:
true if enabled; otherwise, false.Implements: Enabled
FocusControl
Gets the control used to attach focus events.
HasControl
Gets a value indicating whether this instance has a WidgetHandler<TControl, TWidget>.Control instance.
Value:
true if this instance has a control; otherwise, false.HasFocus
#Gets a value indicating whether this instance has the keyboard input focus.
Value:
true if this instance has focus; otherwise, false.Implements: HasFocus
IsMouseCaptured
Gets a value indicating this control currently has mouse capture
Remarks: Mouse capture can happen during a handled MouseDown event until MouseUp, or it can be captured explicitly via Control.IHandler.CaptureMouse().
Implements: IsMouseCaptured
Location
Gets the location of the control as positioned by the container
Remarks: A control's location is set by the container. This can be used to determine where the control is for overlaying floating windows, menus, etc.
Value: The current location of the control
Implements: Location
MaxLength
#Gets or sets the maximum length of the text that can be entered in the control.
Remarks: This typically does not affect the value set using TextControl.Text, only the limit of what the user can enter into the control.
Value: The maximum length of the text in the control.
Implements: MaxLength
MouseControl
Gets the control used to attach mouse events
NativeHandle
public virtual nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
Value: The native handle.
Implements: NativeHandle
PlaceholderText
#Gets or sets the placeholder text to show as a hint of what the user should enter.
Remarks: Typically this will be shown when the control is blank, and will dissappear when the user enters text or if it has an existing value.
Value: The placeholder text.
Implements: PlaceholderText
PropagateLoadEvents
Gets a value indicating whether Control.PreLoad/Control.Load/Control.LoadComplete/Control.UnLoad events are propagated to the inner control
Remarks: Typically this should be true so that the events are propagated, but when you set the control hierarchy manually, such as a TabPage on a TabControl, you can return false here since the load events will be handled automatically by the internal eto controls.
Value:
true if propagate load events; otherwise, false.ReadOnly
#Gets or sets a value indicating whether this TextBox is read only.
Remarks: A user can selected and copied text when the read only, however the user will not be able to change any of the text. This differs from the Control.Enabled property, which disables all user interaction.
Value:
true if the control is read only; otherwise, false.Implements: ReadOnly
ShowBorder
#Gets or sets a value indicating whether to show the control's border.
Remarks: This is a hint to omit the border of the control and show it as plainly as possible. Typically used when you want to show the control within a cell of the GridView.
Value:
true to show the control border; otherwise, false.Implements: ShowBorder
ShowStepper
#Gets or sets a value indicating whether this Control is visible to the user.
Remarks: When the visibility of a control is set to false, it will still occupy space in the layout, but not be shown. The only exception is for controls like the Splitter, which will hide a pane if the visibility of one of the panels is changed.
Value:
true if visible; otherwise, false.Implements: ShowStepper
Size
Gets or sets the size of the control. Use -1 to specify auto sizing for either the width and/or height.
SupportedPlatformCommands
Gets the supported platform commands that can be used to hook up system functions to user defined logic
Value: The supported platform commands.
Implements: SupportedPlatformCommands
TabIndex
Gets or sets the tab index order for this control within its container.
Remarks: This sets the order when using the tab key to cycle through controls Note that some platforms (Gtk and WinForms) may not support setting the context of the tab order to StackLayout or DynamicLayout containers and may not behave exactly as expected. Use the PlatformFeatures.TabIndexWithCustomContainers flag to determine if it is supported.
Value: The index of the control in the tab order.
Implements: TabIndex
TabStop
Gets or sets a value indicating whether the user can get to this control using the tab key.
Value:
true to include the control in the tab order (the default); false to skip it.Implements: TabStop
TextAlignment
#Gets or sets the alignment of the text in the entry box.
Value: The text alignment.
Implements: TextAlignment
TextColor
#Gets or sets the color of the text.
Remarks: By default, the text will get a color based on the user's theme. However, this is usually black.
Value: The color of the text.
Implements: TextColor
ToolTip
Gets or sets the tool tip to show when the mouse is hovered over the control
ValidDirection
#[DefaultValue(StepperValidDirections.Both)]
public StepperValidDirections ValidDirection { get; set; }
Gets or sets the valid directions the stepper will allow the user to click.
Remarks: On some platforms, the up and/or down buttons will not appear disabled, but will not trigger any events when they are not set as a valid direction.
Value: The valid directions for the stepper.
Implements: ValidDirection
Visible
Gets or sets a value indicating whether this control is visible to the user.
Remarks: When the visibility of a control is set to false, it will still occupy space in the layout, but not be shown. The only exception is for controls like the Splitter, which will hide a pane if the visibility of one of the panels is changed.
Value:
true if visible; otherwise, false.Implements: Visible
VisualControls
Gets an enumeration of controls that are in the visual tree.
Remarks: This is used to specify which controls are contained by this instance that are part of the visual tree. This should include all controls including non-logical Eto controls used for layout.
Value: The visual controls.
Implements: VisualControls
Widget
public TWidget Widget { get; }
Gets the widget that this platform handler is attached to
Methods
Parameters:
| item (Gesture) | Gesture to add. |
Implements: AddGesture
AttachEvent
#Attaches the specified event to the platform-specific control
Remarks: Implementors should override this method to handle any events that the widget supports. Ensure to call the base class' implementation if the event is not one the specific widget supports, so the base class' events can be handled as well.
Parameters:
| id (string) | Identifier of the event |
Remarks: This captures all mouse events until Control.IHandler.ReleaseMouseCapture() is called. Note that not all platforms will allow a mouse capture unless the mouse is currently down.
Returns:
true if the mouse was captured, false otherwise.Implements: CaptureMouse
ClearGestures
public virtual void ClearGestures()
Removes all gestures from the control.
CreateConnector
Creates the event connector for this control
Remarks: This creates the weak connector to use for event registration and other purposes.
CreateControl
protected virtual TControl CreateControl()
Creates the control if not already set.
Remarks: Override this to create the control instance for the handler. This makes it easy to extend existing handler implementations with different control implementations. Some platforms (e.g. Mac) require subclasses to implement/override functionality.
Returns: The control.
DetachEvent
Detaches an event from the platform-specific control, undoing WidgetHandler<TWidget>.AttachEvent(string).
Remarks: Implementors can override this for events that hold onto something worth giving back while they are attached, such as a system wide hook. Most events cost nothing to leave attached for the life of the widget, which is why the default is to refuse. Only reached for events whose remove accessor uses PropertyStore.RemoveHandlerEvent(string, Delegate), and never for an event that is attached because the widget overrides its On[Event] method.
Parameters:
| id (string) | Identifier of the event |
Returns: True if the event was detached, false if this platform can't detach it, in which case it stays attached and won't be attached again on a later subscription.
Dispose
public void Dispose()
Disposes this object
Remarks: To handle disposal logic, use the WidgetHandler<TWidget>.Dispose(bool) method.
Dispose
Disposes this widget and the associated control if WidgetHandler<TControl, TWidget>.DisposeControl is
trueParameters:
| disposing (bool) | True if WidgetHandler<TControl, TWidget>.Dispose(bool) was called manually, false if called from the finalizer |
Overrides: WidgetHandler<TWidget>.Dispose
DoDragDrop
public void DoDragDrop(DataObject data, DragEffects allowedAction, Image image, PointF cursorOffset)
Starts drag operation using this control as drag source.
Parameters:
| data (DataObject) | Drag data. |
| allowedAction (DragEffects) | Allowed action. |
| image (Image) | Custom drag image |
| cursorOffset (PointF) | Offset of the cursor to the drag image |
Implements: DoDragDrop
Gets the character index closest to the specified location.
Parameters:
| location (PointF) | Location relative to the text box. |
Returns: The character index closest to
location.Implements: GetCharacterIndex
GetNativeParentWindow
Gets the window this control is contained in
Returns: The parent window, or null if it is not currently on a window
Implements: GetNativeParentWindow
GetPreferredSize
Gets the preferred size of this control given the specified
availableSize.Parameters:
| availableSize (SizeF) | The available size to determine the preferred size |
Returns: The preferred size this control would like to be, which can be larger than the specified
availableSize.Implements: GetPreferredSize
HandleEvent
Called to handle a specific event
Remarks: Most events are late bound by this method. Instead of wiring all events, this will be called with an event string that is defined by the control. This is called automatically when attaching to events, but must be called manually when users of the control only override the event's On... method. Override the WidgetHandler<TWidget>.AttachEvent(string) to attach your events
Parameters:
| id (string) | ID of the event to handle |
| defaultEvent (bool = false) | True if the event is default (e.g. overridden or via an event handler subscription) |
Implements: HandleEvent
Initialize
protected override void Initialize()
Called to initialize this widget after it has been constructed
Remarks: Override this to initialize any of the platform objects. This is called in the widget constructor, after all of the widget's constructor code has been called.
Overrides: WidgetHandler<TWidget>.Initialize
Invalidate
Queues a repaint of the entire control on the screen
Remarks: This is only useful when the control is visible.
Parameters:
| invalidateChildren (bool) | True to invalidate all children, false to only invalidate the container |
Implements: Invalidate
Invalidate
Queues a repaint of the specified
rect of the controlRemarks: This is only useful when the control is visible.
Parameters:
| rect (Rectangle) | Rectangle to repaint |
| invalidateChildren (bool) | True to invalidate all children, false to only invalidate the container |
Implements: Invalidate
IsEventHandled
Gets a value indicating that the specified event is handled
Parameters:
| id (string) | Identifier of the event |
Returns: True if the event is handled, otherwise false
MapPlatformCommand
Specifies a command to execute for a platform-specific command
Implements: MapPlatformCommand
OnInitializeComplete
protected virtual void OnInitializeComplete()
Called after initialization is complete
Remarks: Override this to perform any logic after the handler is fully initialized, but before returning from the construction of the widget. This by default applies the any styles for the handler.
OnLoadComplete
Called after all other controls have been loaded
OnUnLoad
Called when the control is unloaded, which is when it is not currently on a displayed window
PointFromScreen
Converts a point from screen space to control space.
Parameters:
| point (PointF) | Point in screen space |
Returns: The point in control space
Implements: PointFromScreen
PointToScreen
Converts a point from control space to screen space
Parameters:
| point (PointF) | Point in control space |
Returns: The point in screen space
Implements: PointToScreen
public void Print()
ReleaseMouseCapture
public void ReleaseMouseCapture()
Releases the mouse capture after a call to Control.IHandler.CaptureMouse().
Parameters:
| item (Gesture) | Gesture to remove. |
Implements: RemoveGesture
ResumeLayout
public virtual void ResumeLayout()
Resumes the layout after it has been suspended, and performs a layout
Remarks: This can be used to optimize some platforms while adding, removing, or changing many child controls at once. Each call to ResumeLayout() must be balanced with a call to ThemedControlHandler<TControl, TWidget, TCallback>.SuspendLayout() before it.
Implements: ResumeLayout
SelectAll
#public void SelectAll()
Selects all of the text in the control.
Remarks: When setting the selection, the control will be focussed and the associated keyboard may appear on mobile platforms.
Implements: SelectAll
SetParent
Called when the parent of the control has been set
SuspendLayout
public virtual void SuspendLayout()
Suspends the layout of child controls
Remarks: This can be used to optimize some platforms while adding, removing, or changing many child controls at once. It disables the calculation of control positioning until ThemedControlHandler<TControl, TWidget, TCallback>.ResumeLayout() is called. Each call to SuspendLayout() must be balanced with a call to ThemedControlHandler<TControl, TWidget, TCallback>.ResumeLayout().
Implements: SuspendLayout
UnhandleEvent
Called when the last subscriber to an event has been removed, giving WidgetHandler<TWidget>.DetachEvent(string) the chance to stop listening for it.
Remarks: Override WidgetHandler<TWidget>.DetachEvent(string) rather than this, the same way WidgetHandler<TWidget>.AttachEvent(string) is overridden rather than WidgetHandler<TWidget>.HandleEvent(string, bool).
Parameters:
| id (string) | ID of the event to stop handling |
Implements: UnhandleEvent
UpdateLayout
public void UpdateLayout()
Updates the layout of this control if necessary.
Remarks: This will ensure the control has had all of its layout applied so you can use its position and size right after this call. Most platforms (except WinForms) use a deferred layout system so that after adding your control to the form dynamically it won't get laid out until the next idle loop. This is useful when you need to know the dimensions of the control immediately.
Implements: UpdateLayout