gtkmm
3.3.20
|
numeric Entry with up/down buttons Slightly misnamed, this should be called a SpinEntry. More...
Public Member Functions | |
virtual | ~SpinButton () |
GtkSpinButton* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkSpinButton* | gobj () const |
Provides access to the underlying C GtkObject. | |
SpinButton (double climb_rate=0.0, guint digits=0) | |
SpinButton (const Glib::RefPtr< Adjustment >& adjustment, double climb_rate=0.0, guint digits=0) | |
void | configure (const Glib::RefPtr< Adjustment >& adjustment, double climb_rate, guint digits) |
Changes the properties of an existing spin button. | |
void | set_adjustment (const Glib::RefPtr< Adjustment >& adjustment) |
Replaces the Gtk::Adjustment associated with spin_button. | |
void | unset_adjustment () |
Glib::RefPtr< Adjustment > | get_adjustment () |
Get the adjustment associated with a Gtk::SpinButton. | |
Glib::RefPtr< const Adjustment > | get_adjustment () const |
Get the adjustment associated with a Gtk::SpinButton. | |
void | set_digits (guint digits) |
Set the precision to be displayed by spin_button. | |
guint | get_digits () const |
Fetches the precision of spin_button. | |
void | set_increments (double step, double page) |
Sets the step and page increments for spin_button. | |
void | get_increments (double& step, double& page) const |
Gets the current step and page the increments used by spin_button. | |
void | set_range (double min, double max) |
Sets the minimum and maximum allowable values for spin_button. | |
void | get_range (double&min, double&max) const |
Gets the range allowed for spin_button. | |
double | get_value () const |
Get the value in the spin_button. | |
int | get_value_as_int () const |
Get the value spin_button represented as an integer. | |
void | set_value (double value) |
Sets the value of spin_button. | |
void | set_update_policy (SpinButtonUpdatePolicy policy) |
Sets the update behavior of a spin button. | |
SpinButtonUpdatePolicy | get_update_policy () const |
Gets the update behavior of a spin button. | |
void | set_numeric (bool numeric=true) |
Sets the flag that determines if non-numeric text can be typed into the spin button. | |
bool | get_numeric () const |
Returns whether non-numeric text can be typed into the spin button. | |
void | spin (SpinType direction, double increment) |
Increment or decrement a spin button's value in a specified direction by a specified amount. | |
void | set_wrap (bool wrap=true) |
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. | |
bool | get_wrap () const |
Returns whether the spin button's value wraps around to the opposite limit when the upper or lower limit of the range is exceeded. | |
void | set_snap_to_ticks (bool snap_to_ticks=true) |
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. | |
bool | get_snap_to_ticks () const |
Returns whether the values are corrected to the nearest step. | |
void | update () |
Manually force an update of the spin button. | |
Glib::SignalProxy1< int, double* > | signal_input () |
Glib::SignalProxy0< bool > | signal_output () |
Glib::SignalProxy0< void > | signal_wrapped () |
Glib::SignalProxy0< void > | signal_value_changed () |
Glib::PropertyProxy < Glib::RefPtr< Adjustment > > | property_adjustment () |
The adjustment that holds the value of the spin button. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Adjustment > > | property_adjustment () const |
The adjustment that holds the value of the spin button. | |
Glib::PropertyProxy< double > | property_climb_rate () |
The acceleration rate when you hold down a button. | |
Glib::PropertyProxy_ReadOnly < double > | property_climb_rate () const |
The acceleration rate when you hold down a button. | |
Glib::PropertyProxy< guint > | property_digits () |
The number of decimal places to display. | |
Glib::PropertyProxy_ReadOnly < guint > | property_digits () const |
The number of decimal places to display. | |
Glib::PropertyProxy< bool > | property_snap_to_ticks () |
Whether erroneous values are automatically changed to a spin button's nearest step increment. | |
Glib::PropertyProxy_ReadOnly < bool > | property_snap_to_ticks () const |
Whether erroneous values are automatically changed to a spin button's nearest step increment. | |
Glib::PropertyProxy< bool > | property_numeric () |
Whether non-numeric characters should be ignored. | |
Glib::PropertyProxy_ReadOnly < bool > | property_numeric () const |
Whether non-numeric characters should be ignored. | |
Glib::PropertyProxy< bool > | property_wrap () |
Whether a spin button should wrap upon reaching its limits. | |
Glib::PropertyProxy_ReadOnly < bool > | property_wrap () const |
Whether a spin button should wrap upon reaching its limits. | |
Glib::PropertyProxy < SpinButtonUpdatePolicy > | property_update_policy () |
Whether the spin button should update always, or only when the value is legal. | |
Glib::PropertyProxy_ReadOnly < SpinButtonUpdatePolicy > | property_update_policy () const |
Whether the spin button should update always, or only when the value is legal. | |
Glib::PropertyProxy< double > | property_value () |
Reads the current value, or sets a new value. | |
Glib::PropertyProxy_ReadOnly < double > | property_value () const |
Reads the current value, or sets a new value. | |
Protected Member Functions | |
virtual int | on_input (double* new_value) |
This is a default handler for the signal signal_input(). | |
virtual bool | on_output () |
This is a default handler for the signal signal_output(). | |
virtual void | on_wrapped () |
This is a default handler for the signal signal_wrapped(). | |
virtual void | on_value_changed () |
This is a default handler for the signal signal_value_changed(). | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::SpinButton* | wrap (GtkSpinButton* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
numeric Entry with up/down buttons Slightly misnamed, this should be called a SpinEntry.
The SpinButton widget looks like this:
virtual Gtk::SpinButton::~SpinButton | ( | ) | [virtual] |
Gtk::SpinButton::SpinButton | ( | double | climb_rate = 0.0 , |
guint | digits = 0 |
||
) |
Gtk::SpinButton::SpinButton | ( | const Glib::RefPtr< Adjustment >& | adjustment, |
double | climb_rate = 0.0 , |
||
guint | digits = 0 |
||
) | [explicit] |
void Gtk::SpinButton::configure | ( | const Glib::RefPtr< Adjustment >& | adjustment, |
double | climb_rate, | ||
guint | digits | ||
) |
Changes the properties of an existing spin button.
The adjustment, climb rate, and number of decimal places are all changed accordingly, after this function call.
adjustment | A Gtk::Adjustment. |
climb_rate | The new climb rate. |
digits | The number of decimal places to display in the spin button. |
Get the adjustment associated with a Gtk::SpinButton.
Glib::RefPtr<const Adjustment> Gtk::SpinButton::get_adjustment | ( | ) | const |
Get the adjustment associated with a Gtk::SpinButton.
guint Gtk::SpinButton::get_digits | ( | ) | const |
void Gtk::SpinButton::get_increments | ( | double & | step, |
double & | page | ||
) | const |
Gets the current step and page the increments used by spin_button.
See set_increments().
step | Location to store step increment, or 0 . |
page | Location to store page increment, or 0 . |
bool Gtk::SpinButton::get_numeric | ( | ) | const |
Returns whether non-numeric text can be typed into the spin button.
See set_numeric().
true
if only numeric text can be entered. void Gtk::SpinButton::get_range | ( | double & | min, |
double & | max | ||
) | const |
Gets the range allowed for spin_button.
See set_range().
min | Location to store minimum allowed value, or 0 . |
max | Location to store maximum allowed value, or 0 . |
bool Gtk::SpinButton::get_snap_to_ticks | ( | ) | const |
Returns whether the values are corrected to the nearest step.
See set_snap_to_ticks().
true
if values are snapped to the nearest step. Gets the update behavior of a spin button.
See set_update_policy().
double Gtk::SpinButton::get_value | ( | ) | const |
Get the value in the spin_button.
int Gtk::SpinButton::get_value_as_int | ( | ) | const |
Get the value spin_button represented as an integer.
bool Gtk::SpinButton::get_wrap | ( | ) | const |
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().
true
if the spin button wraps around. GtkSpinButton* Gtk::SpinButton::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Entry.
const GtkSpinButton* Gtk::SpinButton::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Entry.
virtual int Gtk::SpinButton::on_input | ( | double * | new_value | ) | [protected, virtual] |
This is a default handler for the signal signal_input().
virtual bool Gtk::SpinButton::on_output | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_output().
virtual void Gtk::SpinButton::on_value_changed | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_value_changed().
virtual void Gtk::SpinButton::on_wrapped | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_wrapped().
The adjustment that holds the value of the spin button.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Adjustment> > Gtk::SpinButton::property_adjustment | ( | ) | const |
The adjustment that holds the value of the spin button.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< double > Gtk::SpinButton::property_climb_rate | ( | ) |
The acceleration rate when you hold down a button.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< double > Gtk::SpinButton::property_climb_rate | ( | ) | const |
The acceleration rate when you hold down a button.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< guint > Gtk::SpinButton::property_digits | ( | ) |
The number of decimal places to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< guint > Gtk::SpinButton::property_digits | ( | ) | const |
The number of decimal places to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::SpinButton::property_numeric | ( | ) |
Whether non-numeric characters should be ignored.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::SpinButton::property_numeric | ( | ) | const |
Whether non-numeric characters should be ignored.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Whether erroneous values are automatically changed to a spin button's nearest step increment.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::SpinButton::property_snap_to_ticks | ( | ) | const |
Whether erroneous values are automatically changed to a spin button's nearest step increment.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Whether the spin button should update always, or only when the value is legal.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< SpinButtonUpdatePolicy > Gtk::SpinButton::property_update_policy | ( | ) | const |
Whether the spin button should update always, or only when the value is legal.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< double > Gtk::SpinButton::property_value | ( | ) |
Reads the current value, or sets a new value.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< double > Gtk::SpinButton::property_value | ( | ) | const |
Reads the current value, or sets a new value.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::SpinButton::property_wrap | ( | ) |
Whether a spin button should wrap upon reaching its limits.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::SpinButton::property_wrap | ( | ) | const |
Whether a spin button should wrap upon reaching its limits.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gtk::SpinButton::set_adjustment | ( | const Glib::RefPtr< Adjustment >& | adjustment | ) |
Replaces the Gtk::Adjustment associated with spin_button.
adjustment | A Gtk::Adjustment to replace the existing adjustment. |
void Gtk::SpinButton::set_digits | ( | guint | digits | ) |
Set the precision to be displayed by spin_button.
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. |
void Gtk::SpinButton::set_increments | ( | double | step, |
double | page | ||
) |
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. |
void Gtk::SpinButton::set_numeric | ( | bool | numeric = true | ) |
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. |
void Gtk::SpinButton::set_range | ( | double | min, |
double | max | ||
) |
Sets the minimum and maximum allowable values for spin_button.
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. |
void Gtk::SpinButton::set_snap_to_ticks | ( | bool | snap_to_ticks = true | ) |
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. |
void Gtk::SpinButton::set_update_policy | ( | SpinButtonUpdatePolicy | policy | ) |
Sets the update behavior of a spin button.
This determines wether the spin button is always updated or only when a valid value is set.
policy | A Gtk::SpinButtonUpdatePolicy value. |
void Gtk::SpinButton::set_value | ( | double | value | ) |
Sets the value of spin_button.
value | The new value. |
void Gtk::SpinButton::set_wrap | ( | bool | wrap = true | ) |
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. |
Glib::SignalProxy1< int,double* > Gtk::SpinButton::signal_input | ( | ) |
int on_my_input(double* new_value)
The signal_input() signal can be used to influence the conversion of the users input into a double value. The signal handler is expected to use Gtk::Entry::get_text() to retrieve the text of the entry and set new_value to the new value.
The default conversion uses Glib::strtod().
new_value | Return location for the new value. |
true
for a successful conversion, false
if the input was not handled, and Gtk::INPUT_ERROR if the conversion failed. Glib::SignalProxy0< bool > Gtk::SpinButton::signal_output | ( | ) |
bool on_my_output()
The signal_output() signal can be used to change to formatting of the value that is displayed in the spin buttons entry.
[C example ellipted]
true
if the value has been displayed. void on_my_value_changed()
Glib::SignalProxy0< void > Gtk::SpinButton::signal_wrapped | ( | ) |
void on_my_wrapped()
The wrapped signal is emitted right after the spinbutton wraps from its maximum to minimum value or vice-versa.
void Gtk::SpinButton::spin | ( | SpinType | direction, |
double | increment | ||
) |
Increment or decrement a spin button's value in a specified direction by a specified amount.
direction | A Gtk::SpinType indicating the direction to spin. |
increment | Step increment to apply in the specified direction. |
void Gtk::SpinButton::unset_adjustment | ( | ) |
void Gtk::SpinButton::update | ( | ) |
Manually force an update of the spin button.
Gtk::SpinButton* wrap | ( | GtkSpinButton * | object, |
bool | take_copy = false |
||
) | [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. |