Skip to main content

SpinButtonExt

Trait SpinButtonExt 

Source
pub trait SpinButtonExt: IsA<SpinButton> + 'static {
Show 32 methods // Provided methods fn configure( &self, adjustment: Option<&impl IsA<Adjustment>>, climb_rate: f64, digits: u32, ) { ... } fn adjustment(&self) -> Adjustment { ... } fn digits(&self) -> u32 { ... } fn increments(&self) -> (f64, f64) { ... } fn is_numeric(&self) -> bool { ... } fn range(&self) -> (f64, f64) { ... } fn snaps_to_ticks(&self) -> bool { ... } fn update_policy(&self) -> SpinButtonUpdatePolicy { ... } fn value(&self) -> f64 { ... } fn value_as_int(&self) -> i32 { ... } fn wraps(&self) -> bool { ... } fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>) { ... } fn set_digits(&self, digits: u32) { ... } fn set_increments(&self, step: f64, page: f64) { ... } fn set_numeric(&self, numeric: bool) { ... } fn set_range(&self, min: f64, max: f64) { ... } fn set_snap_to_ticks(&self, snap_to_ticks: bool) { ... } fn set_update_policy(&self, policy: SpinButtonUpdatePolicy) { ... } fn set_value(&self, value: f64) { ... } fn set_wrap(&self, wrap: bool) { ... } fn spin(&self, direction: SpinType, increment: f64) { ... } fn update(&self) { ... } fn climb_rate(&self) -> f64 { ... } fn set_climb_rate(&self, climb_rate: f64) { ... } fn connect_adjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_climb_rate_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_digits_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_numeric_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_snap_to_ticks_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_update_policy_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_value_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_wrap_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all SpinButton methods.

§Implementors

SpinButton

Provided Methods§

Source

fn configure( &self, adjustment: Option<&impl IsA<Adjustment>>, climb_rate: f64, digits: u32, )

Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are updated accordingly.

§adjustment

a Adjustment to replace the spin button’s existing adjustment, or None to leave its current adjustment unchanged

§climb_rate

the new climb rate

§digits

the number of decimal places to display in the spin button

Source

fn adjustment(&self) -> Adjustment

Get the adjustment associated with a SpinButton

§Returns

the Adjustment of self

Source

fn digits(&self) -> u32

Fetches the precision of self. See set_digits().

§Returns

the current precision

Source

fn increments(&self) -> (f64, f64)

Gets the current step and page the increments used by self. See set_increments().

§Returns
§step

location to store step increment, or None

§page

location to store page increment, or None

Source

fn is_numeric(&self) -> bool

Returns whether non-numeric text can be typed into the spin button. See set_numeric().

§Returns

true if only numeric text can be entered

Source

fn range(&self) -> (f64, f64)

Gets the range allowed for self. See set_range().

§Returns
§min

location to store minimum allowed value, or None

§max

location to store maximum allowed value, or None

Source

fn snaps_to_ticks(&self) -> bool

Returns whether the values are corrected to the nearest step. See set_snap_to_ticks().

§Returns

true if values are snapped to the nearest step

Source

fn update_policy(&self) -> SpinButtonUpdatePolicy

Gets the update behavior of a spin button. See set_update_policy().

§Returns

the current update policy

Source

fn value(&self) -> f64

Get the value in the self.

§Returns

the value of self

Source

fn value_as_int(&self) -> i32

Get the value self represented as an integer.

§Returns

the value of self

Source

fn wraps(&self) -> bool

Returns whether the spin button’s value wraps around to the opposite limit when the upper or lower limit of the range is exceeded. See set_wrap().

§Returns

true if the spin button wraps around

Source

fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)

Replaces the Adjustment associated with self.

§adjustment

a Adjustment to replace the existing adjustment

Source

fn set_digits(&self, digits: u32)

Set the precision to be displayed by self. Up to 20 digit precision is allowed.

§digits

the number of digits after the decimal point to be displayed for the spin button’s value

Source

fn set_increments(&self, step: f64, page: f64)

Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button’s arrows are activated.

§step

increment applied for a button 1 press.

§page

increment applied for a button 2 press.

Source

fn set_numeric(&self, numeric: bool)

Sets the flag that determines if non-numeric text can be typed into the spin button.

§numeric

flag indicating if only numeric entry is allowed

Source

fn set_range(&self, min: f64, max: f64)

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.

§min

minimum allowable value

§max

maximum allowable value

Source

fn set_snap_to_ticks(&self, snap_to_ticks: bool)

Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.

§snap_to_ticks

a flag indicating if invalid values should be corrected

Source

fn set_update_policy(&self, policy: SpinButtonUpdatePolicy)

Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.

§policy

a SpinButtonUpdatePolicy value

Source

fn set_value(&self, value: f64)

Sets the value of self.

§value

the new value

Source

fn set_wrap(&self, wrap: bool)

Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.

§wrap

a flag indicating if wrapping behavior is performed

Source

fn spin(&self, direction: SpinType, increment: f64)

Increment or decrement a spin button’s value in a specified direction by a specified amount.

§direction

a SpinType indicating the direction to spin

§increment

step increment to apply in the specified direction

Source

fn update(&self)

Manually force an update of the spin button.

Source

fn climb_rate(&self) -> f64

Source

fn set_climb_rate(&self, climb_rate: f64)

Source

fn connect_adjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_climb_rate_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_numeric_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_snap_to_ticks_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_update_policy_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_wrap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§