Interface IControlHandler
Contains methods and properties which allow to work with control.
public interface IControlHandler : IDisposableObject, IDisposable, IBaseObject
Properties
- AllowDrop
Gets or sets a value indicating whether the control can accept data that the user drags onto it.
- BackgroundColor
Gets or sets the background color for the control.
- BackgroundStyle
Gets or sets the background style of the control.
- BorderStyle
Gets or sets border style of the control.
- Bounds
Gets or sets the AbstractControl bounds relative to the parent, in device-independent units.
- BoundsI
Gets or sets bounds in pixels. You should not normally use this property unless this control is a top level window.
- CanSelect
Gets or sets value indicating whether this control accepts input or not (i.e. behaves like a static text) and so doesn't need focus.
- ClientSize
Gets or sets size of the AbstractControl's client area, in device-independent units.
- Font
Gets or sets the font of the text displayed by the control.
- ForegroundColor
Gets or sets the foreground color for the control.
- HasBorder
Gets or sets a value indicating whether the control has a border.
- HorzScrollBarInfo
Gets or sets horizontal scrollbar position as ScrollBarInfo. This makes sense only for UserControl descendants.
- IsAttached
Gets a value indicating whether handler is attached to a Control.
- IsFocused
Gets a value indicating whether the control has input focus.
- IsHandleCreated
Gets a value indicating whether the control has a native window handle associated with it.
- IsMouseCaptured
Gets a value indicating whether the mouse is captured to this control.
- IsNativeControlCreated
Gets whether or not native control is created.
- IsScrollable
Gets or sets whether controls is scrollable. This makes sense only for UserControl descendants.
- LangDirection
Gets or sets the language direction for this control.
- NativeGraphicsContext
Gets the reference to native graphics context. For wxWidgets backend it returns the following:
- On Linux it return cairo_t* pointer.
- On MacOS it returns CGContextRef pointer.
- NativePadding
Gets auto padding of the native control.
- Text
Gets or sets the text associated with this control.
- UserPaint
Gets or set a value indicating whether the control paints itself rather than the operating system doing so.
- VertScrollBarInfo
Gets or sets vertical scrollbar position as ScrollBarInfo. This makes sense only for UserControl descendants.
- Visible
Gets or sets a value indicating whether the control and all its child controls are displayed.
- VisibleOnScreen
Gets whether control is visible on screen.
- WantChars
Gets or sets whether control wants to get all char/key events for all keys.
Methods
- Attach(Control)
Attaches this handler to the specified Control.
- BeginInit()
Starts the initialization process for this control.
- BeginUpdate()
Maintains performance while performing slow operations on a control by preventing the control from drawing until the EndUpdate() method is called.
- CaptureMouse()
Captures the mouse to the control.
- ClientToScreen(PointD)
Converts the client-area coordinates of a specified point to screen coordinates.
- CreateDrawingContext()
Creates the Graphics for the control.
- DoDragDrop(object, DragDropEffects)
Begins a drag-and-drop operation.
- EnableTouchEvents(TouchEventsMask)
Enables or disables receiving of the touch events.
- EndInit()
Ends the initialization process for this control.
- EndUpdate()
Resumes painting the control after painting is suspended by the BeginUpdate() method.
- GetDefaultAttributesBgColor()
Gets background color from the default attributes.
- GetDefaultAttributesFgColor()
Gets foreground color from the default attributes.
- GetDefaultAttributesFont()
Gets font from the default attributes.
- GetHandle()
Gets native handle of the control. On WxWidgets platform returns pointer to the native control. For Windows returns hWnd, for macOs returns pointer to NSView, for Linux GTK returns pointer to GtkWidget. For other operating systems returns Zero.
- GetNativeControl()
Gets native control.
- GetPixelScaleFactor()
Gets scale factor.
- GetPreferredSize(PreferredSizeContext)
Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.
- GetUpdateClientRectI()
Gets the update rectangle region bounding box in client coordinates. This method can be used in paint events. Returns rectangle in pixels.
- HandleNeeded()
Creates native control if its not already created.
- Invalidate()
Invalidates the control and causes a paint message to be sent to the control.
- InvalidateBestSize()
Resets the cached best size value so it will be recalculated the next time it is needed.
- IsTransparentBackgroundSupported()
Checks whether using transparent background might work.
- Lower()
Lowers the window to the bottom of the window hierarchy (Z-order). This function only works for top level windows.
- OnChildInserted(AbstractControl)
Called when a AbstractControl is inserted into the Children.
- OnChildRemoved(AbstractControl)
Called when a AbstractControl is removed from the Children collections.
- OnInsertedToParent(AbstractControl)
Called when the current control is inserted into a parent control.
- OnLayoutChanged()
This methods is called when the layout of the control changes.
- OnRemovedFromParent(AbstractControl)
Called when the control is removed from its parent control.
- OnSystemColorsChanged()
This method is called when system colors are changed.
- OpenPaintDrawingContext()
Opens drawing context. Available only in the event handler.
- Raise()
Raises the window to the top of the window hierarchy (Z-order). This function only works for top level windows.
- RecreateWindow()
Forces the re-creation of the underlying native control.
- RefreshRect(RectD, bool)
Same as Invalidate(RectD) but has additional parameter
eraseBackground.
- ReleaseMouseCapture()
Releases the mouse capture, if the control held the capture.
- ResetBackgroundColor()
Resets background color.
- ResetForegroundColor()
Resets foreground color.
- ScreenToClient(PointD)
Converts the screen coordinates of a specified point on the screen to client-area coordinates.
- SetAllowDefaultContextMenu(bool)
Sets whether the default context menu is allowed for the control.
- SetCursor(Cursor?)
Changes Cursor property.
- SetEnabled(bool)
Same as Enabled but implemented as method.
- SetFocus()
Sets input focus to the control.
- SetRenderingFlags(ControlRenderingFlags)
Sets the rendering flags for a control, which determine how the control is rendered.
- SetToolTip(object?)
Sets tooltip text.
- UnsetToolTip()
Clears tooltip text.
- Update()
Causes the control to redraw the invalidated regions.
- UpdateFocusFlags(bool, bool)
Updates focus related flags.