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


Xfc::Gtk::ColorButton Class Reference

A GtkColorButton C++ wrapper class. More...

#include <xfc/gtk/colorbutton.hh>

Inheritance diagram for Xfc::Gtk::ColorButton:

Xfc::Gtk::Button Xfc::Gtk::Bin 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.

Signal Prototypes

Public Member Functions

Accessors
Methods
Signal Proxies

Detailed Description

A GtkColorButton C++ wrapper class.

The ColorButton object is a button which displays the currently selected color and when clicked, opens a color selection dialog to change the color. It is a suitable widget for selecting a color in a preference dialog.


Constructor & Destructor Documentation

Xfc::Gtk::ColorButton::ColorButton ( GtkColorButton *  color_button,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ColorButton from an existing GtkColorButton.

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

Xfc::Gtk::ColorButton::ColorButton (  ) 

Constructs a new color button.

This widget is a small button containing a swatch representing the current selected color. When the button is clicked, a color selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.

Xfc::Gtk::ColorButton::ColorButton ( const Gdk::Color color  )  [explicit]

Constructs a new color button.

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

Xfc::Gtk::ColorButton::ColorButton ( GtkColorButton *  color_button,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ColorButton from an existing GtkColorButton.

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

Xfc::Gtk::ColorButton::ColorButton (  ) 

Constructs a new color button.

This widget is a small button containing a swatch representing the current selected color. When the button is clicked, a color selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.

Xfc::Gtk::ColorButton::ColorButton ( const Gdk::Color color  )  [explicit]

Constructs a new color button.

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


Member Function Documentation

Gdk::Color Xfc::Gtk::ColorButton::get_color (  )  const

Gets the current color in the color button widget.

Returns:
A Gdk::Color filled with the current color.

unsigned short Xfc::Gtk::ColorButton::get_alpha (  )  const

Gets the current alpha value.

Returns:
An integer between 0 and 65535.

bool Xfc::Gtk::ColorButton::get_use_alpha (  )  const

Determines whether the color selection dialog uses the alpha channel.

Returns:
true if the color sample uses alpha channel, false if not.

String Xfc::Gtk::ColorButton::get_title (  )  const

Gets the title of the color selection dialog.

Returns:
A String contining the title.

void Xfc::Gtk::ColorButton::set_color ( const Gdk::Color color  ) 

Sets the current color to be color.

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

void Xfc::Gtk::ColorButton::set_alpha ( unsigned short  alpha  ) 

Sets the current opacity to be alpha.

Parameters:
alpha An integer between 0 and 65535.

void Xfc::Gtk::ColorButton::set_use_alpha ( bool  use_alpha  ) 

Sets whether or not the color button should use the alpha channel.

Parameters:
use_alpha Set true if the button should use the alpha channel, false if not.

void Xfc::Gtk::ColorButton::set_title ( const String title  ) 

Sets the title for the color selection dialog.

Parameters:
title A String containing the new window title.

const ColorSetSignalProxy Xfc::Gtk::ColorButton::signal_color_set (  ) 

Connect to the color_set_signal; emitted when the user selects a color.

When handling this signal, use get_color() and get_alpha() to find out which color was just selected.


Member Data Documentation

const ColorSetSignalType Xfc::Gtk::ColorButton::color_set_signal [static, protected]

Color set signal (see signal_color_set()).

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 4.3