Themed implementation of the TextStepper control composed of a TextBox and Stepper.

Constructors

ThemedTextStepperHandler

#
public ThemedTextStepperHandler()
Initializes a new instance of the ThemedTextStepperHandler class.

Properties

AllowDrop

public virtual bool AllowDrop { get; set; }
Gets or sets a value indicating whether this control can serve as drop target.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

AlwaysShowSelection

#Since v2.10
public bool AlwaysShowSelection { get; set; }
Gets or sets a value indicating whether the selection should always be shown, even when the control does not have focus.

AutoSelectMode

#
public AutoSelectMode AutoSelectMode { get; set; }
Gets or sets the auto selection mode.

BackgroundColor

#
public override Color BackgroundColor { get; set; }
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.
The color of the background.
BackgroundColor

Callback

public TCallback Callback { get; }
Gets the callback object for the control
inherited fromWidgetHandler<TControl, TWidget, TCallback>
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)
The callback.

CaretIndex

#
public int CaretIndex { get; set; }
Gets or sets the index of the current insertion point.
Remarks: When there is selected text, this is usually the start of the selection.
The index of the current insertion point.
CaretIndex

Connector

protected WidgetHandler<TControl, TWidget>.WeakConnector Connector { get; }
Gets a weak connector class to hook up events to the underlying control
inherited fromWidgetHandler<TControl, TWidget>
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.
The connector instance

ContextMenu

public ContextMenu ContextMenu { get; set; }
Gets or sets the context menu to show when the user right clicks or presses the menu key
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

Cursor

public virtual Cursor Cursor { get; set; }
Gets or sets the type of cursor to use when the mouse is hovering over the control
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

DisposeControl

protected virtual bool DisposeControl { get; }
Gets a value indicating that control should automatically be disposed when this widget is disposed
inherited fromWidgetHandler<TControl, TWidget>

Enabled

public virtual bool Enabled { get; set; }
Gets or sets a value indicating whether this control is enabled
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

Font

#
public Font Font { get; set; }
Gets or sets the font for the text of the control

HasControl

public bool HasControl { get; }
Gets a value indicating whether this instance has a WidgetHandler<TControl, TWidget>.Control instance.
inherited fromWidgetHandler<TControl, TWidget>

HasFocus

#
public override bool HasFocus { get; }
Gets a value indicating whether this instance has the keyboard input focus.

IsMouseCaptured

public bool IsMouseCaptured { get; }
Gets a value indicating this control currently has mouse capture
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
Remarks: Mouse capture can happen during a handled MouseDown event until MouseUp, or it can be captured explicitly via Control.IHandler.CaptureMouse().
IsMouseCaptured

KeyboardControl

#
protected override Control KeyboardControl { get; }
Gets the control used to attach keyboard and text input events

Location

public virtual Point Location { get; }
Gets the location of the control as positioned by the container
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
The current location of the control
Location

MaxLength

#
public int MaxLength { get; set; }
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.
The maximum length of the text in the control.
MaxLength

NativeHandle

public virtual nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
inherited fromWidgetHandler<TWidget>

PlaceholderText

#
public string PlaceholderText { get; set; }
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.
The placeholder text.
PlaceholderText

PropagateLoadEvents

public virtual bool PropagateLoadEvents { get; }
Gets a value indicating whether Control.PreLoad/Control.Load/Control.LoadComplete/Control.UnLoad events are propagated to the inner control
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
true if propagate load events; otherwise, false.

ReadOnly

#
public bool ReadOnly { get; set; }
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.
true if the control is read only; otherwise, false.
ReadOnly

Selection

#
public Range<int> Selection { get; set; }
Gets or sets the current text selection.

ShowBorder

#
[DefaultValue(true)] public bool ShowBorder { get; set; }
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.
true to show the control border; otherwise, false.
ShowBorder

ShowStepper

#
public bool ShowStepper { get; set; }
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.
true if visible; otherwise, false.
ShowStepper

Size

public virtual Size Size { get; set; }
Gets or sets the size of the control. Use -1 to specify auto sizing for either the width and/or height.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

SupportedPlatformCommands

public virtual IEnumerable<string> SupportedPlatformCommands { get; }
Gets the supported platform commands that can be used to hook up system functions to user defined logic
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

TabIndex

public int TabIndex { get; set; }
Gets or sets the tab index order for this control within its container.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
The index of the control in the tab order.
TabIndex

TabStop

public virtual bool TabStop { get; set; }
Gets or sets a value indicating whether the user can get to this control using the tab key.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
true to include the control in the tab order (the default); false to skip it.
TabStop

Text

#
public string Text { get; set; }
Gets or sets the text of the control.

TextAlignment

#
public TextAlignment TextAlignment { get; set; }
Gets or sets the alignment of the text in the entry box.

TextColor

#
public Color TextColor { get; set; }
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.
The color of the text.
TextColor

ToolTip

public virtual string ToolTip { get; set; }
Gets or sets the tool tip to show when the mouse is hovered over the control
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

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.
The valid directions for the stepper.
ValidDirection

Visible

public virtual bool Visible { get; set; }
Gets or sets a value indicating whether this control is visible to the user.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
true if visible; otherwise, false.
Visible

VisualControls

public virtual IEnumerable<Control> VisualControls { get; }
Gets an enumeration of controls that are in the visual tree.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
The visual controls.
VisualControls

Widget

public TWidget Widget { get; }
Gets the widget that this platform handler is attached to
inherited fromWidgetHandler<TWidget>

Methods

AttachEvent

#
public override void AttachEvent(string id)
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.
id (string)Identifier of the event

CaptureMouse

public bool CaptureMouse()
Captures all mouse events to this control.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
true if the mouse was captured, false otherwise.
CaptureMouse

CreateConnector

protected virtual WidgetHandler<TControl, TWidget>.WeakConnector CreateConnector()
Creates the event connector for this control
inherited fromWidgetHandler<TControl, TWidget>
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.
inherited fromWidgetHandler<TControl, TWidget>
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.
The control.

DetachEvent

public virtual bool DetachEvent(string id)
Detaches an event from the platform-specific control, undoing WidgetHandler<TWidget>.AttachEvent(string).
inherited fromWidgetHandler<TWidget>
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.
id (string)Identifier of the event
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

protected override void Dispose(bool disposing)
Disposes this widget and the associated control if WidgetHandler<TControl, TWidget>.DisposeControl is true
inherited fromWidgetHandler<TControl, TWidget>

DoDragDrop

public void DoDragDrop(DataObject data, DragEffects allowedAction, Image image, PointF cursorOffset)
Starts drag operation using this control as drag source.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
data (DataObject)Drag data.
allowedAction (DragEffects)Allowed action.
image (Image)Custom drag image
cursorOffset (PointF)Offset of the cursor to the drag image
DoDragDrop

GetCharacterIndex

#Since v2.12
public int GetCharacterIndex(PointF location)
Gets the character index closest to the specified location.
location (PointF)Location relative to the text box.
The character index closest to location.
GetCharacterIndex

GetNativeParentWindow

public Window GetNativeParentWindow()
Gets the window this control is contained in
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

GetPreferredSize

public virtual SizeF GetPreferredSize(SizeF availableSize)
Gets the preferred size of this control given the specified availableSize.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
availableSize (SizeF)The available size to determine the preferred size
The preferred size this control would like to be, which can be larger than the specified availableSize.
GetPreferredSize

HandleEvent

public void HandleEvent(string id, bool defaultEvent = false)
Called to handle a specific event
inherited fromWidgetHandler<TWidget>
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
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)
HandleEvent

Initialize

protected override void Initialize()
Called to initialize this widget after it has been constructed
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.

Invalidate

public virtual void Invalidate(bool invalidateChildren)
Queues a repaint of the entire control on the screen
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
Remarks: This is only useful when the control is visible.
invalidateChildren (bool)True to invalidate all children, false to only invalidate the container
Invalidate

Invalidate

public virtual void Invalidate(Rectangle rect, bool invalidateChildren)
Queues a repaint of the specified rect of the control
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
Remarks: This is only useful when the control is visible.
rect (Rectangle)Rectangle to repaint
invalidateChildren (bool)True to invalidate all children, false to only invalidate the container
Invalidate

IsEventHandled

public bool IsEventHandled(string id)
Gets a value indicating that the specified event is handled
inherited fromWidgetHandler<TWidget>
id (string)Identifier of the event
True if the event is handled, otherwise false

MapPlatformCommand

public virtual void MapPlatformCommand(string systemAction, Command action)
Specifies a command to execute for a platform-specific command
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

OnInitializeComplete

protected virtual void OnInitializeComplete()
Called after initialization is complete
inherited fromWidgetHandler<TWidget>
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.

PointFromScreen

public virtual PointF PointFromScreen(PointF point)
Converts a point from screen space to control space.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

PointToScreen

public virtual PointF PointToScreen(PointF point)
Converts a point from control space to screen space
inherited fromThemedControlHandler<TControl, TWidget, TCallback>

ResumeLayout

public virtual void ResumeLayout()
Resumes the layout after it has been suspended, and performs a layout
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
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.
SelectAll

SetParent

public virtual void SetParent(Container oldParent, Container newParent)
Called when the parent of the control has been set
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
oldParent (Container)Old parent for the control, or null if the control is added
newParent (Container)New parent for the control, or null if the parent was removed
SetParent

SuspendLayout

public virtual void SuspendLayout()
Suspends the layout of child controls
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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().
SuspendLayout

UnhandleEvent

public void UnhandleEvent(string id)
Called when the last subscriber to an event has been removed, giving WidgetHandler<TWidget>.DetachEvent(string) the chance to stop listening for it.
inherited fromWidgetHandler<TWidget>

UpdateLayout

public void UpdateLayout()
Updates the layout of this control if necessary.
inherited fromThemedControlHandler<TControl, TWidget, TCallback>
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.
UpdateLayout