Ardour  9.0-pre0-582-g084a23a80d
Gtk::Adjustment Class Reference

#include <adjustment.h>

Inheritance diagram for Gtk::Adjustment:
[legend]

Public Member Functions

virtual ~Adjustment ()
 
GtkAdjustmentgobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkAdjustmentgobj () const
 Provides access to the underlying C GtkObject. More...
 
 Adjustment (double value, double lower, double upper, double step_increment=1, double page_increment=10, double page_size=0)
 
void changed ()
 
void value_changed ()
 
void clamp_page (double lower, double upper)
 
void set_value (double value)
 
double get_value () const
 
void set_lower (double lower)
 
double get_lower () const
 
void set_upper (double upper)
 
double get_upper () const
 
void set_step_increment (double step_increment)
 
double get_step_increment () const
 
void set_page_increment (double page_increment)
 
double get_page_increment () const
 
void set_page_size (double page_size)
 
double get_page_size () const
 
void configure (double value, double lower, double upper, double step_increment, double page_increment, double page_size)
 
Glib::SignalProxy0< void > signal_changed ()
 
Glib::SignalProxy0< void > signal_value_changed ()
 
Glib::PropertyProxy< double > property_value ()
 
Glib::PropertyProxy_ReadOnly< double > property_value () const
 
Glib::PropertyProxy< double > property_lower ()
 
Glib::PropertyProxy_ReadOnly< double > property_lower () const
 
Glib::PropertyProxy< double > property_upper ()
 
Glib::PropertyProxy_ReadOnly< double > property_upper () const
 
Glib::PropertyProxy< double > property_step_increment ()
 
Glib::PropertyProxy_ReadOnly< double > property_step_increment () const
 
Glib::PropertyProxy< double > property_page_increment ()
 
Glib::PropertyProxy_ReadOnly< double > property_page_increment () const
 
Glib::PropertyProxy< double > property_page_size ()
 
Glib::PropertyProxy_ReadOnly< double > property_page_size () const
 
- Public Member Functions inherited from Gtk::Object
virtual ~Object ()
 
GtkObjectgobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkObjectgobj () const
 Provides access to the underlying C GtkObject. More...
 
Glib::PropertyProxy< void * > property_user_data ()
 
Glib::PropertyProxy_ReadOnly< void * > property_user_data () const
 

Protected Member Functions

virtual void on_changed ()
 This is a default handler for the signal signal_changed(). More...
 
virtual void on_value_changed ()
 This is a default handler for the signal signal_value_changed(). More...
 

Friends

class Range
 
class HScrollbar
 
class VScrollbar
 

Related Functions

(Note that these are not member functions.)

Gtk::Adjustmentwrap (GtkAdjustment *object, bool take_copy=false)
 

Detailed Description

A class representing an adjustable bounded value.

The Gtk::Adjustment object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several gtkmm widgets, including Gtk::SpinButton, Gtk::Viewport, and Gtk::Range (which is a base class for Gtk::HScrollbar, Gtk::VScrollbar, Gtk::HScale, and Gtk::VScale).

The Gtk::Adjustment object does not update the value itself. Instead it is left up to the owner of the Gtk::Adjustment to control the value.

The owner of the Gtk::Adjustment typically calls the value_changed() and changed() functions after changing the value and its bounds. This results in the emission of the "value_changed" or "changed" signal respectively.

Definition at line 62 of file adjustment.h.

Constructor & Destructor Documentation

◆ ~Adjustment()

virtual Gtk::Adjustment::~Adjustment ( )
virtual

◆ Adjustment()

Gtk::Adjustment::Adjustment ( double  value,
double  lower,
double  upper,
double  step_increment = 1,
double  page_increment = 10,
double  page_size = 0 
)

Constructor to create an Adjustment object.

Parameters
valueThe initial value
lowerThe minimum value
upperThe maximum value
step_incrementThe step increment
page_incrementThe page increment
page_sizeThe page size

Member Function Documentation

◆ changed()

void Gtk::Adjustment::changed ( )

Emits a "changed" signal from the Adjustment. This is typically called by the owner of the Adjustment after it has changed any of the Adjustment fields other than the value.

◆ clamp_page()

void Gtk::Adjustment::clamp_page ( double  lower,
double  upper 
)

Updates the Adjustment value to ensure that the range between the parameters lower and upper is in the current page (i.e. between value and value + page_size). If this range is larger than the page size, then only the start of it will be in the current page. A "changed" signal will be emitted if the value is changed.

Parameters
upperThe upper value.
lowerThe lower value.

◆ configure()

void Gtk::Adjustment::configure ( double  value,
double  lower,
double  upper,
double  step_increment,
double  page_increment,
double  page_size 
)

Sets all properties of the adjustment at once.

Use this function to avoid multiple emissions of the "changed" signal. See set_lower() for an alternative way of compressing multiple emissions of "changed" into one.

Parameters
valueThe new value.
lowerThe new minimum value.
upperThe new maximum value.
step_incrementThe new step increment.
page_incrementThe new page increment.
page_sizeThe new page size.

◆ get_lower()

double Gtk::Adjustment::get_lower ( ) const

Retrieves the minimum value of the adjustment.

Returns
The current minimum value of the adjustment.

◆ get_page_increment()

double Gtk::Adjustment::get_page_increment ( ) const

Retrieves the page increment of the adjustment.

Returns
The current page increment of the adjustment.

◆ get_page_size()

double Gtk::Adjustment::get_page_size ( ) const

Retrieves the page size of the adjustment.

Returns
The current page size of the adjustment.

◆ get_step_increment()

double Gtk::Adjustment::get_step_increment ( ) const

Retrieves the step increment of the adjustment.

Returns
The current step increment of the adjustment.

◆ get_upper()

double Gtk::Adjustment::get_upper ( ) const

Retrieves the maximum value of the adjustment.

Returns
The current maximum value of the adjustment.

◆ get_value()

double Gtk::Adjustment::get_value ( ) const

Gets the current value of the adjustment. See set_value().

Returns
The current value of the adjustment.

◆ gobj() [1/2]

GtkAdjustment* Gtk::Adjustment::gobj ( )
inline

Provides access to the underlying C GtkObject.

Definition at line 99 of file adjustment.h.

◆ gobj() [2/2]

const GtkAdjustment* Gtk::Adjustment::gobj ( ) const
inline

Provides access to the underlying C GtkObject.

Definition at line 102 of file adjustment.h.

◆ on_changed()

virtual void Gtk::Adjustment::on_changed ( )
protectedvirtual

This is a default handler for the signal signal_changed().

◆ on_value_changed()

virtual void Gtk::Adjustment::on_value_changed ( )
protectedvirtual

This is a default handler for the signal signal_value_changed().

◆ property_lower() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_lower ( )

The minimum value of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_lower() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_lower ( ) const

The minimum value of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_page_increment() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_page_increment ( )

The page increment of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_page_increment() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_page_increment ( ) const

The page increment of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_page_size() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_page_size ( )

The page size of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_page_size() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_page_size ( ) const

The page size of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_step_increment() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_step_increment ( )

The step increment of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_step_increment() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_step_increment ( ) const

The step increment of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_upper() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_upper ( )

The maximum value of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_upper() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_upper ( ) const

The maximum value of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_value() [1/2]

Glib::PropertyProxy< double > Gtk::Adjustment::property_value ( )

The value of the adjustment.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_value() [2/2]

Glib::PropertyProxy_ReadOnly< double > Gtk::Adjustment::property_value ( ) const

The value of the adjustment.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_lower()

void Gtk::Adjustment::set_lower ( double  lower)

Sets the minimum value of the adjustment.

When setting multiple adjustment properties via their individual setters, multiple "changed" signals will be emitted. However, since the emission of the "changed" signal is tied to the emission of the "GObject::notify" signals of the changed properties, it's possible to compress the "changed" signals into one by calling Glib::object_freeze_notify() and Glib::object_thaw_notify() around the calls to the individual setters.

Alternatively, using a single Glib::object_set() for all the properties to change, or using configure() has the same effect of compressing "changed" emissions.

Parameters
lowerThe new minimum value.

◆ set_page_increment()

void Gtk::Adjustment::set_page_increment ( double  page_increment)

Sets the page increment of the adjustment.

See set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

Parameters
page_incrementThe new page increment.

◆ set_page_size()

void Gtk::Adjustment::set_page_size ( double  page_size)

Sets the page size of the adjustment.

See set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

Parameters
page_sizeThe new page size.

◆ set_step_increment()

void Gtk::Adjustment::set_step_increment ( double  step_increment)

Sets the step increment of the adjustment.

See set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

Parameters
step_incrementThe new step increment.

◆ set_upper()

void Gtk::Adjustment::set_upper ( double  upper)

Sets the maximum value of the adjustment.

Note that values will be restricted by upper - page-size if the page-size property is nonzero.

See set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

Parameters
upperThe new maximum value.

◆ set_value()

void Gtk::Adjustment::set_value ( double  value)

Sets the current value of the Adjustment

Parameters
valueThe new value of the Adjustment.

◆ signal_changed()

Glib::SignalProxy0< void > Gtk::Adjustment::signal_changed ( )
Slot Prototype:
void on_my_changed()

◆ signal_value_changed()

Glib::SignalProxy0< void > Gtk::Adjustment::signal_value_changed ( )
Slot Prototype:
void on_my_value_changed()

◆ value_changed()

void Gtk::Adjustment::value_changed ( )

Emits a "value_changed" signal from the Adjustment. This is typically called by the owner of the Adjustment after it has changed the Adjustment value field.

Friends And Related Function Documentation

◆ HScrollbar

friend class HScrollbar
friend

Definition at line 123 of file adjustment.h.

◆ Range

friend class Range
friend

Definition at line 122 of file adjustment.h.

◆ VScrollbar

friend class VScrollbar
friend

Definition at line 124 of file adjustment.h.

◆ wrap()

Gtk::Adjustment * wrap ( GtkAdjustment object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: