Main Page Widgets Namespaces Book

# Gtk::ColorSelection Class Reference
[Widgets]

Inheritance diagram for Gtk::ColorSelection:

[legend]

List of all members.

## Detailed Description

A widget used to select a color.

This widget 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 on the standard color selection dialog box Gtk::ColorSelectionDialog.

## Public Types

typedef sigc::slot< void, const Glib::RefPtr <Gdk::Screen>&, const Gdk::ArrayHandle_Color& > | SlotChangePaletteHook

## Public Member Functions

| ColorSelection ()
guint16 | get_current_alpha () const
| Return value: an integer between 0 and 65535.
Gdk::Color | get_current_color () const
bool | get_has_opacity_control () const
| Determines whether the colorsel has an opacity control.
bool | get_has_palette () const
| Determines whether the color selector has a color palette.
guint16 | get_previous_alpha () const
| Return value: an integer between 0 and 65535.
Gdk::Color | get_previous_color () const
const GtkColorSelection* | gobj () const
| Provides access to the underlying C GtkObject.
GtkColorSelection* | gobj ()
| Provides access to the underlying C GtkObject.
bool | is_adjusting () const
| Gets the current state of the colorsel.
Glib::PropertyProxy_ReadOnly <guint> | property_current_alpha () const
| The current opacity value (0 fully transparent, 65535 fully opaque).
Glib::PropertyProxy<guint> | property_current_alpha ()
| The current opacity value (0 fully transparent, 65535 fully opaque).
Glib::PropertyProxy_ReadOnly <Gdk::Color> | property_current_color () const
| The current color.
Glib::PropertyProxy<Gdk::Color> | property_current_color ()
| The current color.
Glib::PropertyProxy_ReadOnly <bool> | property_has_opacity_control () const
| Whether the color selector should allow setting opacity.
Glib::PropertyProxy<bool> | property_has_opacity_control ()
| Whether the color selector should allow setting opacity.
Glib::PropertyProxy_ReadOnly <bool> | property_has_palette () const
| Whether a palette should be used.
Glib::PropertyProxy<bool> | property_has_palette ()
| Whether a palette should be used.
void | set_current_alpha (guint16 alpha)
| Sets the current opacity to be alpha.
void | set_current_color (const Gdk::Color& color)
| Sets the current color to be color.
void | set_has_opacity_control (bool has_opacity=true)
| Sets the colorsel to use or not use opacity.
void | set_has_palette (bool has_palette=true)
| Shows and hides the palette based upon the value of has_palette.
void | set_previous_alpha (guint16 alpha)
| Sets the 'previous' alpha to be alpha.
void | set_previous_color (const Gdk::Color& color)
| Sets the 'previous' color to be color.
Glib::SignalProxy0<void> | signal_color_changed ()
virtual | ~ColorSelection ()

## Static Public Member Functions

static Gdk::ArrayHandle_Color | palette_from_string (const Glib::ustring& str)
static Glib::ustring | palette_to_string (const Gdk::ArrayHandle_Color& colors)
static SlotChangePaletteHook | set_change_palette_hook (const SlotChangePaletteHook& slot)

## Protected Member Functions

virtual void | on_color_changed ()

## Related Functions

(Note that these are not member functions.)
Gtk::ColorSelection* | wrap (GtkColorSelection* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Member Typedef Documentation

typedef sigc::slot<void, const Glib::RefPtr<Gdk::Screen>&, const Gdk::ArrayHandle_Color&> Gtk::ColorSelection::SlotChangePaletteHook

## Constructor & Destructor Documentation

virtual Gtk::ColorSelection::~ColorSelection | ( |  | ) | `[virtual]`

Gtk::ColorSelection::ColorSelection | ( |  | ) |

## Member Function Documentation

guint16 Gtk::ColorSelection::get_current_alpha | ( |  | ) | const

Return value: an integer between 0 and 65535.

Returns:
  An integer between 0 and 65535.

Gdk::Color Gtk::ColorSelection::get_current_color | ( |  | ) | const

bool Gtk::ColorSelection::get_has_opacity_control | ( |  | ) | const

Determines whether the colorsel has an opacity control.

Returns:
  `true` if the colorsel has an opacity control. `false` if it does't.

bool Gtk::ColorSelection::get_has_palette | ( |  | ) | const

Determines whether the color selector has a color palette.

Returns:
  `true` if the selector has a palette. `false` if it hasn't.

guint16 Gtk::ColorSelection::get_previous_alpha | ( |  | ) | const

Return value: an integer between 0 and 65535.

Returns:
  An integer between 0 and 65535.

Gdk::Color Gtk::ColorSelection::get_previous_color | ( |  | ) | const

const GtkColorSelection* Gtk::ColorSelection::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::VBox.

GtkColorSelection* Gtk::ColorSelection::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::VBox.

bool Gtk::ColorSelection::is_adjusting | ( |  | ) | const

Gets the current state of the colorsel.

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

virtual void Gtk::ColorSelection::on_color_changed | ( |  | ) | `[protected, virtual]`

static Gdk::ArrayHandle_Color Gtk::ColorSelection::palette_from_string | ( | const Glib::ustring & | str | ) | `[static]`

static Glib::ustring Gtk::ColorSelection::palette_to_string | ( | const Gdk::ArrayHandle_Color & | colors | ) | `[static]`

Glib::PropertyProxy_ReadOnly<guint> Gtk::ColorSelection::property_current_alpha | ( |  | ) | const

The current opacity value (0 fully transparent, 65535 fully opaque).

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::ColorSelection::property_current_alpha | ( |  | ) |

The current opacity value (0 fully transparent, 65535 fully opaque).

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Gdk::Color> Gtk::ColorSelection::property_current_color | ( |  | ) | const

The current color.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Gdk::Color> Gtk::ColorSelection::property_current_color | ( |  | ) |

The current color.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::ColorSelection::property_has_opacity_control | ( |  | ) | const

Whether the color selector should allow setting opacity.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::ColorSelection::property_has_opacity_control | ( |  | ) |

Whether the color selector should allow setting opacity.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::ColorSelection::property_has_palette | ( |  | ) | const

Whether a palette should be used.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::ColorSelection::property_has_palette | ( |  | ) |

Whether a palette should be used.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

static SlotChangePaletteHook Gtk::ColorSelection::set_change_palette_hook | ( | const SlotChangePaletteHook& | slot | ) | `[static]`

void Gtk::ColorSelection::set_current_alpha | ( | guint16 | alpha | ) |

Sets the current opacity to be alpha.

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

Parameters:

  | alpha | An integer between 0 and 65535.

void Gtk::ColorSelection::set_current_color | ( | const Gdk::Color& | color | ) |

Sets the current color to be color.

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

Parameters:

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

void Gtk::ColorSelection::set_has_opacity_control | ( | bool | has_opacity = `true` | ) |

Sets the colorsel to use or not use opacity.

Parameters:

  | has_opacity | `true` if colorsel can set the opacity, `false` otherwise.

void Gtk::ColorSelection::set_has_palette | ( | bool | has_palette = `true` | ) |

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

Parameters:

  | has_palette | `true` if palette is to be visible, `false` otherwise.

void Gtk::ColorSelection::set_previous_alpha | ( | guint16 | alpha | ) |

Sets the 'previous' alpha to be alpha.

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

Parameters:

  | alpha | An integer between 0 and 65535.

void Gtk::ColorSelection::set_previous_color | ( | const Gdk::Color& | color | ) |

Sets the 'previous' color to be color.

This function 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.

Parameters:

  | color | A Gdk::Color to set the previous color with.

Glib::SignalProxy0< void > Gtk::ColorSelection::signal_color_changed | ( |  | ) |

Prototype:
  `void on_my_color_changed()`

## Friends And Related Function Documentation

Gtk::ColorSelection* wrap | ( | GtkColorSelection * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

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

- colorselection.h