Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::Scale Class Reference

A GtkScale C++ wrapper class. More...

#include <xfc/gtk/scale.hh>

Inheritance diagram for Xfc::Gtk::Scale:

Xfc::Gtk::Range Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable Xfc::Gtk::HScale Xfc::Gtk::VScale List of all members.

Signal Prototpyes

Public Member Functions

Accessors
Methods
Signal Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkScale C++ wrapper class.

The Scale widget is an abstract class, used only for deriving the subclasses HScale and VScale.

A Scale is a slider control used to select a numeric value. To use it, you'll probably want to investigate the methods on its base class, Range, in addition to the methods for Scale itself. To set the value of a scale, you would normally use Gtk::Range::set_value(). To detect changes to the value, you would normally connect to the value_changed signal.

See also: the Range Widget HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::Scale::Scale GtkScale *  scale,
bool  owns_reference = false
[explicit, protected]
 

Construct a new Scale from an existing GtkScale.

Parameters:
scale A pointer to a GtkScale.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The scale can be a newly created GtkScale or an existing GtkScale (see G::Object::Object).


Member Function Documentation

Pango::Layout* Xfc::Gtk::Scale::get_layout  )  const
 

Gets the Pango::Layout used to display the scale.

Returns:
The Pango::Layout for this scale, or null if set_draw_value() is set to false.

void Xfc::Gtk::Scale::get_layout_offsets int *  x,
int *  y
const
 

Obtains the coordinates where the scale will draw the Pango::Layout representing the text in the scale.

Parameters:
x The location to store X offset of layout, or null.
y The location to store Y offset of layout, or null.
Remember when using Pango::Layout you need to convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE. If set_draw_value() is set to false, the return values are undefined.

PositionType Xfc::Gtk::Scale::get_value_pos  )  const
 

Gets the position in which the current value is displayed.

Returns:
The position in which the current value is displayed.

void Xfc::Gtk::Scale::set_digits int  digits  ) 
 

Sets the number of decimal places that are displayed in the value.

Parameters:
digits The number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00 etc.
Also causes the value of the adjustment to be rounded off to this number of digits, so the retrieved value matches the value the user saw.

void Xfc::Gtk::Scale::set_draw_value bool  draw_value  ) 
 

Specifies whether the current value is displayed as a string next to the slider.

Parameters:
draw_value Set true to display the current value.

void Xfc::Gtk::Scale::set_value_pos PositionType  pos  ) 
 

Sets the position in which the current value is displayed.

Parameters:
pos The position in which the current value is displayed.


Member Data Documentation

const FormatValueSignalType Xfc::Gtk::Scale::format_value_signal [static, protected]
 

Format value signal (see signal_format_value()).

Calls a slot with the signature:

             char* function(double value);
             // value: The scale value to format.
             // return: An allocated string representing value.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3