atkmm
2.36.1
|
The ATK interface implemented by valuators and components which display or select a value from a bounded range of values. More...
#include <atkmm/value.h>
Public Member Functions | |
Value (Value&& src) noexcept | |
Value& | operator= (Value&& src) noexcept |
~Value () noexcept override | |
AtkValue* | gobj () |
Provides access to the underlying C GObject. More... | |
const AtkValue* | gobj () const |
Provides access to the underlying C GObject. More... | |
void | get_value_and_text (double& value, Glib::ustring& text) |
Gets the current value and the human readable text alternative. More... | |
Range | get_range () const |
Gets the range of this object. More... | |
double | get_increment () |
Gets the minimum increment by which the value of this object may be changed. More... | |
void | set_value (const gdouble new_value) |
Sets the value of this object. More... | |
Glib::SignalProxy< void(double, const Glib::ustring&)> | signal_value_changed () |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
Value () | |
You should derive from this class to use it. More... | |
virtual void | get_current_value_vfunc (Glib::ValueBase& value) const |
virtual void | get_maximum_value_vfunc (Glib::ValueBase& value) const |
virtual void | get_minimum_value_vfunc (Glib::ValueBase& value) const |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Atk::Value > | wrap (AtkValue* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
The ATK interface implemented by valuators and components which display or select a value from a bounded range of values.
This should be implemented for components which either display a value from a bounded range, or which allow the user to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, should have Atk::Object representations which implement Atk::Value on the component's behalf. Atk::Values may be read-only, in which case attempts to alter the value return false to indicate failure.
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
|
static |
|
protectedvirtual |
double Atk::Value::get_increment | ( | ) |
Gets the minimum increment by which the value of this object may be changed.
If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.
|
protectedvirtual |
|
protectedvirtual |
Range Atk::Value::get_range | ( | ) | const |
Gets the range of this object.
nullptr
if that range is not defined.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
void Atk::Value::get_value_and_text | ( | double & | value, |
Glib::ustring & | text | ||
) |
Gets the current value and the human readable text alternative.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
void Atk::Value::set_value | ( | const gdouble | new_value | ) |
Sets the value of this object.
This method is intended to provide a way to change the value of the object. In any case, it is possible that the value can't be modified (ie: a read-only component). If the value changes due this call, it is possible that the text could change, and will trigger an Atk::Value::signal_value_changed() signal emission.
Note for implementors: the deprecated set_current_value() method returned true
or false
depending if the value was assigned or not. In the practice several implementors were not able to decide it, and returned true
in any case. For that reason it is not required anymore to return if the value was properly assigned or not.
new_value | A double which is the desired new accessible value. |
Glib::SignalProxy<void(double, const Glib::ustring&)> Atk::Value::signal_value_changed | ( | ) |
void on_my_value_changed(double value, const Glib::ustring& text)
Flags: Run Last
The 'value-changed' signal is emitted when the current value that represent the object changes. value is the numerical representation of this new value. text is the human readable text alternative of value, and can be nullptr
if it is not available. Note that if there is a textual description associated with the new numeric value, that description should be included regardless of whether or not it has also changed.
Example: a password meter whose value changes as the user types their new password. Appropiate value text would be "weak", "acceptable" and "strong".
value | The new value in a numerical form. |
text | Human readable text alternative (also called description) of this object. nullptr if not available. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |