Class

DesktopTableRowAction

Table Row Action, Swipe


Description

One action a user can invoke by swiping a row of a DesktopTable horizontally.

Actions are supplied per row through DesktopTable.ApplyLeadingActionsForRow and DesktopTable.ApplyTrailingActionsForRow. Both events are raised once, at the moment the gesture is recognised, never while drawing. When the user picks an action, DesktopTable.RowActionSelected fires with the row and the action object.

The gesture is a two-finger swipe on a trackpad (macOS), a precision touchpad (Windows) or a touchpad (Linux). Touchscreens are not supported.

Properties

Name

Type

Read-Only

Shared

BackgroundColor

ColorGroup

Image

Picture

Symbol

String

Tag

Variant

Title

String

Methods

Name

Parameters

Returns

Shared

Constructor

title As String, tag As Variant = Nil

Property descriptions


DesktopTableRowAction.BackgroundColor

BackgroundColor As ColorGroup

Button fill. Unset (Nil) uses a neutral default. A ColorGroup lets a destructive action be a strong red in light mode and a darker one in dark mode.

Var remove As New DesktopTableRowAction("Delete", "delete")
remove.BackgroundColor = New ColorGroup(&cD93025, &cC5372C)

DesktopTableRowAction.Image

Image As Picture

Centred in the button, Title centred below it. The picture's scale factor is respected, so a HiDPI image is drawn at its point size.

This example sets the centred in the button, Title centred below it:

action.Image = myPicture

DesktopTableRowAction.Symbol

Symbol As String

Name of a system image. Assigning it replaces an existing Image set before; an Image set afterwards wins. Assigning "" removes only the picture Symbol created; an Image assigned directly stays. Names are platform specific (SF Symbols on macOS).

The list of supported symbols can be found here:

Important

On Windows, this property is currently only supported for WinUI.

This example sets the name of a system image:

#If TargetMacOS
  action.Symbol = "square.and.arrow.up"
#EndIf

DesktopTableRowAction.Tag

Tag As Variant

Free identifier; RowActionSelected hands back the whole action, so it need not be unique. It is the value RowActionSelected hands back together with the action itself.

This example sets the free identifier; RowActionSelected hands back the whole action, so it need not be unique:

action.Tag = "myTag"

DesktopTableRowAction.Title

Title As String

Button caption. Caption shown on the action's button. It is what the button shows, below the picture when an Image is set.

This example sets the button caption:

action.Title = "Title"

Method descriptions


DesktopTableRowAction.Constructor

Constructor(title As String, tag As Variant = Nil)

Caption plus the identifier RowActionSelected hands back. Everything else - colour, picture, symbol - is set on the object afterwards.

This example creates an action with a caption and the tag it reports back:

action.Constructor("title")

Compatibility

Project Types

Desktop

Operating Systems

All

See also

DesktopTable