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


Public Member Functions | Static Public Member Functions | Static Protected Attributes
Xfc::Gtk::ColorSelection Class Reference

A GtkColorSelection C++ wrapper class. More...

#include <xfc/gtk/colorselection.hh>

Inheritance diagram for Xfc::Gtk::ColorSelection:
Xfc::Gtk::VBox Xfc::Gtk::Box Xfc::Gtk::Container 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

List of all members.

Public Member Functions

Static Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkColorSelection C++ wrapper class.

The ColorSelection is a widget that is used to select a color. It consists of a color wheel and number of sliders and entry boxes for color parameters such as hue, saturation, value, red, green, blue, and opacity. It is found in the standard color selection dialog box ColorSelectionDialog.

See also: the ColorSelection HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::ColorSelection::ColorSelection ( GtkColorSelection *  color_selection,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ColorSelection from an existing GtkColorSelection.

Parameters:
color_selectionA pointer to a GtkColorSelection.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

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


Member Function Documentation

Returns true if the user is currently dragging a color around, and false if the selection has stopped.

static bool Xfc::Gtk::ColorSelection::palette_from_string ( const String str,
std::vector< Gdk::Color > &  colors 
) [static]

Parses a color palette string; the string is a colon-separated list of color names readable by Gdk::Color::parse().

Parameters:
strA String encoding a color palette.
colorsA vector of Gdk::Color to fill with the newly allocated colors.
Returns:
true if a palette was successfully parsed.
static String Xfc::Gtk::ColorSelection::palette_to_string ( const std::vector< Gdk::Color > &  colors) [static]

Encodes a palette as a string, useful for persistent storage.

Parameters:
colorsA vector of Gdk::Color objects.
Returns:
A String encoding the palette.
void Xfc::Gtk::ColorSelection::set_current_alpha ( unsigned short  alpha)

Sets the current opacity to be alpha.

Parameters:
alphaAn integer between 0 and 65535.

The first time this is called, it will also set the original opacity to be alpha too.

Sets the current color to be color.

Parameters:
colorA Gdk::Color to set the current color with.

The first time this is called, it will also set the original color to be color too.

Sets the ColorSelection to use or not use opacity.

Parameters:
has_opacitytrue if the ColorSelection can set the opacity, false otherwise.
void Xfc::Gtk::ColorSelection::set_has_palette ( bool  has_palette)

Shows and hides the palette based upon the value of has_palette.

Parameters:
has_palettetrue if the palette is to be visible, false otherwise.
void Xfc::Gtk::ColorSelection::set_previous_alpha ( unsigned short  alpha)

Sets the 'previous' alpha to be alpha.

Parameters:
alphaAn integer between 0 and 65535.

This method should be called with some hesitations, as it might seem confusing to have that alpha change.

Sets the 'previous' color to be color.

Parameters:
colorA Gdk::Color to set the previous color with.

This method should be called with some hesitations, as it might seem confusing to have that color change. Calling set_current_color() will also set this color the first time it is called.

Connect to the color_changed_signal; emitted when the color changes in the ColorSelection according to its update policy.


Member Data Documentation

Color changed signal (see signal_color_changed()).

Calls a slot with the signature:

< void function();
<

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