CustomButton Xojo Plugin

CustomSwitch Control

LibraryDescription
"A switch button that is not based on the operating system theme."

RectControl
   CustomSwitch

control CustomSwitch

Properties

AcceptFocusThis property is for Mac only where focus is normally not active unless Full Keyboard access is on. Setting this to true activates focus support even if full keyboard access is not turned on in the system.
AccessibilityLabelLabel used by the macOS accessibility manager for various of disability settings and devices.
BoldSets the text font to bold.
ButtonColorSets the body color of the button when button is enabled.
ButtonShapeConfigures the shape of the switch button, Rounded or Rectangular.
ButtonSizeSets the Size of the button.
DBBackColorFills background with custom color when in double buffering mode. (MacOS X and Linux systems are always double buffered by the OS it self)
DMButtonColorSets the body color of the switch button when button is enabled in dark mode if SeparateDarkModeStyle is set to true.
DMFocusColorColor for the focus on the switch button when button in dark mode if SeparateDarkModeStyle is set to true.
DMOffButtonColorColor of the button when it is off when system is in dark mode and SeparateDarkModeStyle property is set to true.
DMTextColorSets the text color when switch is on and system is in dark mode and SeparateDarkModeStyle property is set to true.
DMTextColorOffSets the text color when switch is off and system is in dark mode and SeparateDarkModeStyle property is set to true.
DMUseSystemFocusColorWhen system is in darkmode and SeparateDarkModeStyle is set to true then If this property is set to true then the button will attempt to use system focus color when possible, having fallback to the controls focus color.
DoubleBufferDoubleBuffers the drawing of the control on Windows systems. (MacOS X and Linux systems are always double buffered by the OS it self)
Enabled (Inherited) Determines if the control should be enabled when the owning window is opened.
FocusColorColor for the focus on the switch button.
FocusDrawingTypeConfigures how focus should be represented.
Handle (Inherited) Returns a handle to the control.
HasDBBackColorIf set to true then the color defined in the DBBackColor property will be used as background color when in double buffer mode. (MacOS X and Linux systems are always double buffered by the OS it self)
HasTextColorIf set to true then TextColor and TextColorOff properties will be used to determined text color.
Height (Inherited) The height (in points) of the control.
IOSymbolVisibleIf set to true then IO symbols are drawn in the switch.
Index (Inherited) If the control is used in a control set, this specifies the control's index in the set.
ItalicSets the text font to italic.
LabelVisibleIf set to true then the on / off label behind the button is visible.
Left (Inherited) The left side of the control in local coordinates (relative to the window)
MouseX (Inherited) The X coordinate of the mouse (points). Measured from the top-left corner of the window.
MouseY (Inherited) The Y coordinate of the mouse (points). Measured from the top-left corner of the window.
OffButtonColorColor of the button when it is off.
OffTextProperty to localize the text for the Off state of the button.
OnTextProperty to localize the text for the On state of the button.
PanelIndex (Inherited) If the control has been placed on a TabPanel or PagePanel control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.
SeparateDarkModeStyleIf set to true then the color style properties from the DM (DarkMode) named properties will be used when the system is in Darkmode.
TextColorSets the text color when switch is on.
TextColorOffSets the text color when switch is off.
TextFontSets the text font
TextSizeSets the text font size.
TextUnitSets the unit of the FontSize.
TextYOffsetUse the property to adjust the Text Y offset of the text.
Top (Inherited) The top of the control in local coordinates (relative to the window).
UnderlineSets the text font to underlined.
UseSystemFocusColorIf set to true then the button will attempt to use system focus color when possible, having fallback to the controls focus color.
ValueValue of the button, false for off and true for on.
Visible (Inherited) Determines whether the control is visible when its owning window is opened. The default is True: the control is visible.
Width (Inherited) The width (in points) of the control.
Window (Inherited) The control's parent window.

Methods

Close (Inherited) Closes a control.
PressVisually simulates mouse press on the switch.
ReloadEventsReloads events if having used AddHandler to subscribe events.
SetFocus (Inherited) If applicable, sets the focus to the DesktopUIControl. KeyDown events are directed to the control.

Events

ActionThe state on the CustomSwitch has been changed either by code or user interaction.
Close (Inherited) The control is about to close.
ConstructContextualMenu (Inherited) This event is called when it is appropriate to display a contextual menu for the control.
ContextualMenuItemSelected (Inherited) Fires when a contextual menuitem selectedItem was selected but the MenuItemSelected event and the MenuHandler for the MenuItem did not handle the menu selection.
DragEnter (Inherited) Fires when the passed DragItem enters the RectControl.
DragExit (Inherited) Fires when the passed DragItem exits the RectControl.
DragOver (Inherited) Fires when the DragItem is over the RectControl.
DropObject (Inherited) The item represented by Obj has been dropped on the control.
GotFocusThe switch button has gotten focus.
KeyUp (Inherited) Fires when the passed Key is released in the control that has the focus.
LostFocusThe switch button has lost focus.
MouseDrag (Inherited) The mouse button was pressed inside the control and moved (dragged) at the location local to the control passed in to x, y. The user has moved the mouse inside the control while the mouse button is held down. This event handler receives parameters that indicate where the mouse is in coordinates local to the control.
MouseEnter (Inherited) The mouse has entered the area of the control.
MouseExit (Inherited) The mouse has left the area of the control.
MouseMove (Inherited) The mouse has moved within the control to the coordinates passed. The coordinates are local to the control, not to the window.
MouseWheel (Inherited) The mouse wheel has been moved.
PreProcessStyleOverrides style attribute on the button right before rendering. The override is for current rendering and alter base properties of the button.

Enumerations

ButtonSizesEnum to represent button sizes for the ButtonSize property.

Constants

Version = 4.7

Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit