Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::Range Class Reference

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

`#include <xfc/gtk/range.hh>`

Inheritance diagram for Xfc::Gtk::Range:

List of all members.

## Signal Prototypes

- const ValueChangedSignalType value_changed_signal
    Value changed signal (see signal_value_changed()).
- const AdjustBoundsSignalType adjust_bounds_signal
    Adjust bounds signal (see signal_adjust_bounds()).

## Public Member Functions

Accessors

- GtkRange * gtk_range () const
    Get a pointer to the GtkRange 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.

Signal Proxies

- const ValueChangedSignalProxy signal_value_changed ()
    Connect to the value_changed_signal; emitted when the range value changes.
- const AdjustBoundsSignalProxy signal_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 owns_reference=false)
    Construct a new Range from an existing GtkRange.
- virtual ~Range ()=0
    Destructor.

## Detailed Description

A GtkRange C++ wrapper class.

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

See also: the Range Widget HOWTO and example.

## Constructor & Destructor Documentation

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

Construct a new Range from an existing GtkRange.

Parameters:

  | range | A pointer to a GtkRange.
  | owns_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* Xfc::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 Xfc::Gtk::Range::get_inverted | ( |  | ) | const

Gets the value set by set_inverted().

Returns:
  true if the range is inverted.

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

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

Returns:
  The current update policy.

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

## Member Data Documentation

const AdjustBoundsSignalType Xfc::Gtk::Range::adjust_bounds_signal `[static, protected]`

Adjust bounds signal (see signal_adjust_bounds()).

Calls a slot with the signature:

                 void function(double new_value);
                 // new_value: The new range value.

const ValueChangedSignalType Xfc::Gtk::Range::value_changed_signal `[static, protected]`

Value changed signal (see signal_value_changed()).

Calls a slot with the signature:

                 void function();

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

- range.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3