Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Adjustment Class Reference

A GtkAdjustment C++ wrapper class. More...

`#include <inti/gtk/adjustment.h>`

Inheritance diagram for Inti::Gtk::Adjustment:

List of all members.

## Public Member Functions

Constructors

- Adjustment ()
    Construct an empty Adjustment.
- Adjustment (double lower, double upper, double step_increment, double page_increment, double page_size)
    Construct a new Adjustment.
- Adjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size)
    Construct a new Adjustment.
- virtual ~Adjustment ()
    Destructor.

Accessors

- GtkAdjustment * gtk_adjustment () const
    Get a pointer to the GtkAdjustment structure.
- GtkAdjustmentClass * gtk_adjustment_class () const
    Get a pointer to the GtkAdjustmentClass structure.
- operator GtkAdjustment * () const
    Conversion operator; safely converts an Adjustment to a GtkAdjustment pointer.
- double lower () const
    Get the minimum value for the adjustment.
- double upper () const
    Get the maximum value for the adjustment.
- double step_increment () const
    Get the step increment of the adjustment.
- double page_increment () const
    Get the page increment of the adjustment.
- double page_size () const
    Get the page size of the adjustment.
- double get_value () const
    Get the current value of the adjustment.

Methods

- void changed ()
    Emits a changed signal from the Adjustment.
- void value_changed ()
    Emits a value_changed signal from the Adjustment.
- void clamp_page (double lower, double upper)
    Updates the Adjustment value to ensure that the range between lower and upper is in the current page (i.e.
- void set_value (double value)
    Sets the Adjustment value.
- void set_range (double lower, double upper, double step_increment, double page_increment, double page_size)
    Sets the Adjustment fields other than the value.

Signal Proxies

- const ChangedSignalProxy sig_changed ()
    Connect to the changed_signal; emitted when one or more of the Adjustment fields have been changed, other than the value field.
- const ValueChangedSignalProxy sig_value_changed ()
    Connect to the value_changed_signal; emitted when the Adjustment value field has been changed.

## Protected Member Functions

Constructors

- Adjustment (GtkAdjustment *adjustment, bool reference=false)
    Construct a new Adjustment from an existing GtkAdjustment.

Signal Handlers

- virtual void on_changed ()
    Called when one or more of the Adjustment fields have been changed, other than the value field.
- virtual void on_value_changed ()
    Called when the Adjustment value field has been changed.

## Detailed Description

A GtkAdjustment C++ wrapper class.

The 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 widgets, including SpinButton, Viewport, and Range (which is a base class for HScrollbar, VScrollbar, HScale, and VScale).

The Adjustment object does not update the value itself. Instead it is left up to the owner of the Adjustment to control the value. The owner of the Adjustment typically calls the value_changed() and changed() methods after changing the value and its bounds. This results in the emission of the value_changed or changed signal respectively.

## Constructor & Destructor Documentation

Inti::Gtk::Adjustment::Adjustment | ( | GtkAdjustment * | adjustment,
|  | bool | reference = false
| ) | `[explicit, protected]`

  | Construct a new Adjustment from an existing GtkAdjustment. Parameters:
  adjustment | A pointer to a GtkAdjustment.
  reference | Set false if the initial reference count is floating, set true if it's not.
The adjustment can be a newly created GtkAdjustment or an existing GtkAdjustment. (see G::Object::Object).

Inti::Gtk::Adjustment::Adjustment | ( | double | lower,
|  | double | upper,
|  | double | step_increment,
|  | double | page_increment,
|  | double | page_size
| ) |

  | Construct a new Adjustment. Parameters:
  lower | The minimum value.
  upper | The maximum value.
  step_increment | The step increment.
  page_increment | The page increment.
  page_size | The page size.
The step_increment is the increment to use to make minor changes to the value. In a Scrollbar this increment is used when the mouse is clicked on the arrows at the top and bottom of the scrollbar, to scroll by a small amount. The page_increment is the increment to use to make major changes to the value. In a Scrollbar this increment is used when the mouse is clicked in the trough, to scroll by a large amount. The page size in a Scrollbar is the size of the area which is currently visible.

Inti::Gtk::Adjustment::Adjustment | ( | double | value,
|  | double | lower,
|  | double | upper,
|  | double | step_increment,
|  | double | page_increment,
|  | double | page_size
| ) |

  | Construct a new Adjustment. Parameters:
  value | The initial value.
  lower | The minimum value.
  upper | The maximum value.
  step_increment | The step increment.
  page_increment | The page increment.
  page_size | The page size.
The step increment is the increment to use to make minor changes to the value. The page increment is the increment to use to make major changes to the value.

## Member Function Documentation

void Inti::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.

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

  | Updates the Adjustment value to ensure that the range between lower and upper is in the current page (i.e. between value and value + page_size). Parameters:
  lower | The lower value.
  upper | The upper value.
If the 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.

void Inti::Gtk::Adjustment::set_range | ( | double | lower,
|  | double | upper,
|  | double | step_increment,
|  | double | page_increment,
|  | double | page_size
| ) |

  | Sets the Adjustment fields other than the value. Parameters:
  lower | The minimum value.
  upper | The maximum value.
  step_increment | The step increment.
  page_increment | The page increment.
  page_size | The page size.
The step increment is the increment to use to make minor changes to the value. The page increment is the increment to use to make major changes to the value.

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

  | Sets the Adjustment value. Parameters:
  value | The new value.

void Inti::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.

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

- adjustment.h

Main Page - Footer