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

# Xfc::Gtk::Ruler Class Reference

A GtkRuler C++ wrapper class. More...

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

Inheritance diagram for Xfc::Gtk::Ruler:

List of all members.

## Public Member Functions

Accessors

- GtkRuler * gtk_ruler () const
    Get a pointer to the GtkRuler structure.
- operator GtkRuler * () const
    Conversion operator; safely converts a Ruler to a GtkRuler pointer.
- MetricType get_metric () const
    Gets the units used for a Ruler (see gtk_ruler_set_metric()).
- double get_lower () const
    Gets the lower limit of the ruler.
- double get_upper () const
    Gets the upper limit of the ruler.
- double get_position () const
    Gets the current position of the mark on the ruler.
- void get_range (double *lower, double *upper, double *position, double *max_size=0)
    Retrieves values indicating the range and current position of the ruler (see set_range()).

Methods

- void set_metric (MetricType metric)
    Sets the ruler to the units defined.
- void set_range (double lower, double upper, double position, double max_size)
    Sets the range of the ruler using lower, upper, position, and max_size.
- void draw_ticks ()
    Draws the tick marks on the ruler.
- void draw_pos ()
    Draws the position mark on the ruler.

## Protected Member Functions

Constructors

- Ruler ()
    Construct a new Ruler.
- Ruler (GtkRuler *ruler, bool owns_reference=false)
    Construct a new Ruler from an existing GtkRuler.
- virtual ~Ruler ()=0
    Destructor.

## Detailed Description

A GtkRuler C++ wrapper class.

The Ruler widget is a base class for horizontal and vertical rulers. Rulers are used to show the mouse pointer's location in a window. The ruler can either be horizontal or vertical on the window. Within the ruler a small triangle indicates the location of the mouse relative to the horizontal or vertical ruler. See HRuler to learn how to create a new horizontal ruler. See VRuler to learn how to create a new vertical ruler.

See also: the Ruler HOWTO and example.

## Constructor & Destructor Documentation

Xfc::Gtk::Ruler::Ruler | ( | GtkRuler * | ruler,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new Ruler from an existing GtkRuler.

Parameters:

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

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

## Member Function Documentation

MetricType Xfc::Gtk::Ruler::get_metric | ( |  | ) | const

Gets the units used for a Ruler (see gtk_ruler_set_metric()).

Returns:
  The units currently used for the ruler.

void Xfc::Gtk::Ruler::get_range | ( | double * | lower,
|  | double * | upper,
|  | double * | position,
|  | double * | max_size = `0`
| ) |

Retrieves values indicating the range and current position of the ruler (see set_range()).

Parameters:

  | lower | The location to store lower limit of the ruler, or null.
  | upper | The location to store upper limit of the ruler, or null.
  | position | The location to store the current position of the mark on the ruler, or null.
  | max_size | The location to store the maximum size of the ruler used when calculating the space to leave for the text, or null.

void Xfc::Gtk::Ruler::set_metric | ( | MetricType | metric | ) |

Sets the ruler to the units defined.

Parameters:

  | metric | The unit of measurement.

Available units are PIXELS, INCHES, or CENTIMETERS. The default unit of measurement is PIXELS.

void Xfc::Gtk::Ruler::set_range | ( | double | lower,
|  | double | upper,
|  | double | position,
|  | double | max_size
| ) |

Sets the range of the ruler using lower, upper, position, and max_size.

Parameters:

  | lower | The upper limit of the ruler.
  | upper | The lower limit of the ruler.
  | position | The mark on the ruler.
  | max_size | The maximum size of the ruler.

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

- ruler.hh

Xfce Foundation Classes

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