PictureButton Xojo Plugin

PictureButton Control

PictureButton control for Xojo

  • Native or near native look and feel on all platforms

  • Works properly with masked images on all platforms.

  • Full Keyboard access works properly

  • Supports menus and submenus.

  • Menus can have images on the menu items.

  • Extensive support for the macOS Accessibility manager


  • This version of the control is for old style Xojo Window class.





    Einhugur Picture button shown on MacOS X, Windows XP and
    Ubuntu Linux system. Full Keyboard access is turned on on the
    MacOS system.



    Xojo bevel button shown on MacOS X, Windows XP and
    Ubuntu Linux system. Full Keyboard access is turned on on
    the MacOS system but not working on the Xojo bevel button.

    RectControl
       PictureButton

    control PictureButton

    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.
    AutoWidthThis property is to support components such as the FlowLayout. If set to true then the FlowLayout may resize the button.
    BoldSets the text font to bold.
    ButtonTypeConfigures how the button should behave, normal, sticky, toggle.
    CaptionSets or gets the text on the button.
    CaptionAlignSets the alignment of the text.
    CaptionDeltaXTweaks the position of the text in x direction.
    CaptionDeltaYTweaks the position of the text in y direction.
    CaptionPlacementThis property is to configure how the caption is placed.
    DBBackColorFills background with custom color when in double buffering mode. (MacOS X and Linux systems are always double buffered by the OS it self)
    DMIconSets or gets icon for dark mode.
    DebugDataSizeUsed for internal quality control of the plugin.
    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.
    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)
    HasMenuThis property is to let the button have a menu.
    Height (Inherited) The height (in points) of the control.
    HideDropDownArrowsIf set to true then Drop - down arrow indicators are hidden when in drop down mode.
    IconSets icon for the button.
    IconAlignSets the alignment of the icon on the button.
    IconDeltaXTweaks the position of the icon in x direction.
    IconDeltaYTweaks the position of the icon in y direction.
    ItalicSets the text font to italic.
    Left (Inherited) The left side of the control in local coordinates (relative to the window)
    MacButtonTypeSets style of the button for MacOS X to other MacOS styles. Note the style on Windows and Linux will remain fixed since those systems don't have as many native button styles.
    MaxWidthThis property is to support components such as the FlowLayout. The property defines the maximum width the button may scale to.
    MenuThe root menu item of the control. To add menu items then you manipulate this menu item.
    MinWidthThis property is to support components such as the FlowLayout. The property defines the minimum width the button may scale to.
    MultiLinePlacementIf set to true then the multiple lines will have their own vertical space calculation, else the first line of the multiple lines will be vertically same as if it had been single line.
    MultilineIf set to true then the Caption property supports multiple lines.
    TextFontSets the text font
    TextSizeSets the text font size.
    TextUnitSets the unit of the FontSize.
    ToolButtonIf set to true then the button will not get focus on click on platforms where it normally would have gotten the focus when clicked.
    Top (Inherited) The top of the control in local coordinates (relative to the window).
    UnderlineSets the text font to underlined.
    ValueIf the button is in Toggle or Sticky mode then this property can read and write the state.
    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.

    Methods

    GetOptimalWidthReturns optimal width of the control for the text and settings that have been assigned to it.
    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 PictureButton has been clicked.
    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 button has gotten focus.
    KeyUp (Inherited) Fires when the passed Key is released in the control that has the focus.
    LostFocusThe button has lost the focus.
    MenuActionThis event is fired when a menu item on the button has been clicked.
    MouseDownThe mouse button was pressed inside the PictureButtons region.
    MouseDragThis event is fired when the mouse is dragged with the mouse button down on the control.
    MouseEnterThis event is fired when the mouse enters the controls region.
    MouseExitThis event is fired when the mouse exits the controls region.
    MouseMoveThis event is fired when the mouse is moved over the controls region.
    MouseUpThis event is fired when the mouse button goes up.
    MouseWheel (Inherited) The mouse wheel has been moved.

    Constants

    Version = 8.0

    Examples

    Known issues:
    Earlier versions of Xojo within the range we support may have issues with drawing the Image of the button incorrectly while in IDE design mode. Xojo fixed this in the later versions.

    Supported Platforms:

  • macOS Intel 32 bit
  • 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
  • Unsupported Platforms:

  • Linux ARM 64 bit