Klasse SpinRow

Alle implementierten Schnittstellen:
PointerInterface

public class SpinRow extends ActionRow
An [class@ActionRow] with an embedded spin button.

<picture>
<source srcset="spin-row-dark.png" media="(prefers-color-scheme: dark)">
<img src="spin-row.png" alt="spin-row">
</picture>

Example of an `AdwSpinRow` UI definition:

```xml
<object class="AdwSpinRow">
<property name="title" translatable="yes">Spin Row</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">0</property>
<property name="upper">100</property>
<property name="value">50</property>
<property name="page-increment">10</property>
<property name="step-increment">1</property>
</object>
</property>
</object>
```

See [class@Gtk.SpinButton] for details.

## CSS nodes

`AdwSpinRow` has the same structure as [class@ActionRow], as well as the
`.spin` style class on the main node.

## Accessibility

`AdwSpinRow` uses an internal `GtkSpinButton` with the
`GTK_ACCESSIBLE_ROLE_SPIN_BUTTON` role.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SpinRow.html

  • Felddetails

  • Konstruktordetails

    • SpinRow

      public SpinRow(PointerContainer pointer)
    • SpinRow

      public SpinRow(@Nullable Adjustment adjustment, double climb_rate, int digits)
      Creates a new `AdwSpinRow`.
      Parameter:
      adjustment - the adjustment that this spin row should use
      climb_rate - the rate the value changes when holding a button or key
      digits - the number of decimal places to display
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newWithRangeSpinRow

      public static SpinRow newWithRangeSpinRow(double min, double max, double step)
      Creates a new `AdwSpinRow` with the given properties.

      This is a convenience constructor that allows creation of a numeric
      `AdwSpinRow` without manually creating an adjustment. The value is initially
      set to the minimum value and a page increment of 10 * @step is the default.
      The precision of the spin row is equivalent to the precisions of @step.

      ::: note
      The way in which the precision is derived works best if @step is a power
      of ten. If the resulting precision is not suitable for your needs, use
      [method@SpinRow.set_digits] to correct it.
      Parameter:
      min - minimum allowable value
      max - maximum allowable value
      step - increment added or subtracted by spinning the widget
      Gibt zurück:
      the new `AdwSpinRow`
    • configure

      public void configure(@Nullable Adjustment adjustment, double climb_rate, int digits)
      Changes the properties of an existing spin row.

      The adjustment, climb rate, and number of decimal places are updated
      accordingly.
      Parameter:
      adjustment - the adjustment that this spin row should use
      climb_rate - the new climb rate
      digits - the number of decimal places to display
    • getAdjustment

      public Adjustment getAdjustment()
      Gets the adjustment that holds the value for the spin row.
      Gibt zurück:
      the adjustment that holds the spin row's value
    • getClimbRate

      public double getClimbRate()
      Gets the acceleration rate when you hold down a button or key.
      Gibt zurück:
      the acceleration rate when you hold down a button or key
    • getDigits

      public int getDigits()
      Gets the number of decimal places to display.
      Gibt zurück:
      the number of decimal places to display
    • getNumeric

      public boolean getNumeric()
      Gets whether non-numeric characters should be ignored.
      Gibt zurück:
      whether non-numeric characters should be ignored.
    • getSnapToTicks

      public boolean getSnapToTicks()
      Gets whether invalid values are snapped to nearest step increment.
      Gibt zurück:
      whether invalid values are snapped to the nearest step increment
    • getUpdatePolicy

      public int getUpdatePolicy()
      Gets the policy for updating the spin row.
      Gibt zurück:
      the policy for updating the spin row
    • getValue

      public double getValue()
      Gets the current value.
      Gibt zurück:
      the current value
    • getWrap

      public boolean getWrap()
      Gets whether the spin row should wrap upon reaching its limits.
      Gibt zurück:
      whether the spin row should wrap upon reaching its limits
    • setAdjustment

      public void setAdjustment(@Nullable Adjustment adjustment)
      Sets the adjustment that holds the value for the spin row.
      Parameter:
      adjustment - an adjustment
    • setClimbRate

      public void setClimbRate(double climb_rate)
      Sets the acceleration rate when you hold down a button or key.
      Parameter:
      climb_rate - the acceleration rate when you hold down a button or key
    • setDigits

      public void setDigits(int digits)
      Sets the number of decimal places to display.
      Parameter:
      digits - the number of decimal places to display
    • setNumeric

      public void setNumeric(boolean numeric)
      Sets whether non-numeric characters should be ignored.
      Parameter:
      numeric - whether non-numeric characters should be ignored
    • setRange

      public void setRange(double min, double max)
      Sets the minimum and maximum allowable values for @self.

      If the current value is outside this range, it will be adjusted
      to fit within the range, otherwise it will remain unchanged.
      Parameter:
      min - minimum allowable value
      max - maximum allowable value
    • setSnapToTicks

      public void setSnapToTicks(boolean snap_to_ticks)
      Sets whether invalid values are snapped to the nearest step increment.
      Parameter:
      snap_to_ticks - whether invalid values are snapped to the nearest step increment
    • setUpdatePolicy

      public void setUpdatePolicy(int policy)
      Sets the policy for updating the spin row.

      The options are always, or only when the value is invalid.
      Parameter:
      policy - the policy for updating the spin row
    • setValue

      public void setValue(double value)
      Sets the current value.
      Parameter:
      value - a new value
    • setWrap

      public void setWrap(boolean wrap)
      Sets whether the spin row should wrap upon reaching its limits.
      Parameter:
      wrap - whether the spin row should wrap upon reaching its limits
    • update

      public void update()
      Manually force an update of the spin row.
    • onInput

      public SignalHandler onInput(SpinRow.OnInput signal)
      Connect to signal "input".
      See SpinRow.OnInput.onInput(ch.bailu.gtk.type.Pointer) for signal description.
      Field SIGNAL_ON_INPUT contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onOutput

      public SignalHandler onOutput(SpinRow.OnOutput signal)
      Connect to signal "output".
      See SpinRow.OnOutput.onOutput() for signal description.
      Field SIGNAL_ON_OUTPUT contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onWrapped

      public SignalHandler onWrapped(SpinRow.OnWrapped signal)
      Connect to signal "wrapped".
      See SpinRow.OnWrapped.onWrapped() for signal description.
      Field SIGNAL_ON_WRAPPED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Setzt außer Kraft:
      asAccessible in Klasse ActionRow
      Gibt zurück:
      Accessible
    • asActionable

      public Actionable asActionable()
      Implements interface Actionable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asActionable in Klasse ActionRow
      Gibt zurück:
      Actionable
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asBuildable in Klasse ActionRow
      Gibt zurück:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Setzt außer Kraft:
      asConstraintTarget in Klasse ActionRow
      Gibt zurück:
      ConstraintTarget
    • asEditable

      public Editable asEditable()
      Implements interface Editable. Call this to get access to interface functions.
      Gibt zurück:
      Editable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()