Reference Manual

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

# Inti::Gtk::Range Class Reference

A GtkRange C++ wrapper class. More...

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

Inheritance diagram for Inti::Gtk::Range:

List of all members.

## Public Member Functions

Accessors

- GtkRange * gtk_range () const
    Get a pointer to the GtkRange structure.
- GtkRangeClass * gtk_range_class () const
    Get a pointer to the GtkRangeClass structure.
- operator GtkRange * () const
    Conversion operator; safely converts a Range to a GtkRange pointer.
- UpdateType get_policy () const
    Gets the update policy of range (see set_update_policy()).
- Adjustment * get_adjustment () const
    Get the Adjustment which is the "model" object for Range (see set_adjustment() for details).
- bool get_inverted () const
    Gets the value set by set_inverted().
- double get_value () const
    Gets the current value of the range.

Methods

- void set_round_digits (int round_digits)
    Set the number of digits to round off the value to, or -1 for no rounding.
- void set_update_policy (UpdateType policy)
    Sets the update policy for the range.
- void set_adjustment (Adjustment *adjustment)
    Sets the adjustment to be used as the "model" object for this range widget.
- void set_inverted (bool setting)
    Sets whether the lower to higher values should be inverted.
- void set_increments (double step, double page)
    Sets the step and page sizes for the range.
- void set_range (double min, double max)
    Sets the allowable values in the Range, and clamps the range value to be between min and max.
- void set_value (double value)
    Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them.

Property Proxies

- const UpdatePolicyPropertyProxy prop_update_policy ()
    How the range should be updated on the screen (UpdateType : Read / Write).
- const AdjustmentPropertyProxy prop_adjustment ()
    The Adjustment that contains the current value of this range object (Adjustment* : Read / Write / Construct).
- const InvertedPropertyProxy prop_inverted ()
    Invert the direction the slider moves to increase the range value (bool : Read / Write).

Signal Proxies

- const ValueChangedSignalProxy sig_value_changed ()
    Connect to the value_changed_signal; emitted when the range value changes.
- const AdjustBoundsSignalProxy sig_adjust_bounds ()
    Connect to the adjust_bounds_signal; emitted when the bounds of the range might need adjusting when a new range value is set.

## Protected Member Functions

Constructors

- Range ()
    Construct a new Range.
- Range (GtkRange *range, bool reference=false)
    Construct a new Range from an existing GtkRange.
- virtual ~Range ()=0
    Destructor.

Signal Handlers

- virtual void on_value_changed ()
    Called when the range value changes.
- virtual void on_adjust_bounds (double new_value)
    Called when the bounds of the range might need adjusting when a new range value is set.

## Detailed Description

A GtkRange C++ wrapper class.

Range is the base class for widgets that show an adjustable range, such as Scale and Scrollbar.

## Constructor & Destructor Documentation

Inti::Gtk::Range::Range | ( | GtkRange * | range,
|  | bool | reference = false
| ) | `[explicit, protected]`

Construct a new Range from an existing GtkRange.

Parameters:

  range | A pointer to a GtkRange.
  reference | Set false if the initial reference count is floating, set true if it's not.

The range can be a newly created GtkRange or an existing GtkRange (see G::Object::Object).

## Member Function Documentation

Adjustment* Inti::Gtk::Range::get_adjustment | ( |  | ) | const

Get the Adjustment which is the "model" object for Range (see set_adjustment() for details).

Returns:
  The Adjustemnt.

The return value does not have a reference added, so it should not be unreferenced.

bool Inti::Gtk::Range::get_inverted | ( |  | ) | const

Gets the value set by set_inverted().

Returns:
  true if the range is inverted.

UpdateType Inti::Gtk::Range::get_policy | ( |  | ) | const

Gets the update policy of range (see set_update_policy()).

Returns:
  The current update policy.

virtual void Inti::Gtk::Range::on_adjust_bounds | ( | double | new_value | ) | `[protected, virtual]`

Called when the bounds of the range might need adjusting when a new range value is set.

Parameters:

  new_value | The new range value.

void Inti::Gtk::Range::set_adjustment | ( | Adjustment * | adjustment | ) |

Sets the adjustment to be used as the "model" object for this range widget.

Parameters:

  adjustment | The Adjustment.

The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for Scale and non-zero for Scrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

void Inti::Gtk::Range::set_increments | ( | double | step,
|  | double | page
| ) |

Sets the step and page sizes for the range.

Parameters:

  step | The step size.
  page | The page size.

The step size is used when the user clicks the Scrollbar arrows or moves GtkScale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

void Inti::Gtk::Range::set_inverted | ( | bool | setting | ) |

Sets whether the lower to higher values should be inverted.

Parameters:

  setting | Set true to invert the range.

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the left rather than on the bottom or right.

void Inti::Gtk::Range::set_range | ( | double | min,
|  | double | max
| ) |

Sets the allowable values in the Range, and clamps the range value to be between min and max.

Parameters:

  min | The minimum range value.
  max | The maximum range value.

If the range has a non-zero page size, it is clamped between min and max - page-size.

void Inti::Gtk::Range::set_update_policy | ( | UpdateType | policy | ) |

Sets the update policy for the range.

Parameters:

  policy | The update policy.

UPDATE_CONTINUOUS means that anytime the range slider is moved, the range value will change and the value_changed signal will be emitted. UPDATE_DELAYED means that the value will be updated after a brief timeout where no slider motion occurs, so updates are spaced by a short time rather than continuous. UPDATE_DISCONTINUOUS means that the value will only be updated when the user releases the button and ends the slider drag operation.

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

Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them.

Parameters:

  value | The new value of the range.

The range emits the "value_changed" signal if the value changes.

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

- range.h

Main Page - Footer