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

# Xfc::Gtk::FontButton Class Reference

A GtkFontButton C++ wrapper class. More...

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

Inheritance diagram for Xfc::Gtk::FontButton:

List of all members.

## Signal Prototypes

- const FontSetSignalType font_set_signal
    Font set signal (see signal_font_set()).

## Public Member Functions

Constructors

- FontButton ()
    Constructs a new font picker widget.
- FontButton (const String &fontname)
    Constructs a new font picker widget.
- virtual ~FontButton ()
    Destructor.

Accessors

- GtkFontButton * gtk_font_button () const
    Get a pointer to the GtkFontButton structure.
- operator GtkFontButton * () const
    Conversion operator; safely converts an FontButton to a GtkFontButton pointer.
- String get_title () const
    Retrieves the title of the font selection dialog.
- bool get_use_font () const
    Determines whether the selected font is used in the label.
- bool get_use_size () const
    Determines whether the selected size is used in the label.
- String get_font_name () const
    Retrieves the name of the currently selected font.
- bool get_show_style () const
    Determines whether the name of the font style will be shown in the label.
- bool get_show_size () const
    Determines whether the font size will be shown in the label.

Methods

- void set_title (const String &title)
    Sets the title for the font selection dialog.
- void set_use_font (bool use_font)
    If use_font is true, the font name will be written using the selected font.
- void set_use_size (bool use_size)
    If use_size is true, the font name will be written using the selected size.
- bool set_font_name (const String &fontname)
    Sets or updates the currently displayed font in font picker dialog.
- void set_show_style (bool show_style)
    If show_style is true the font style will be displayed along with the name of the selected font.
- void set_show_size (bool show_size)
    If show_size is true, the font size will be displayed along with the name of the selected font.

Signal Proxies

- const FontSetSignalProxy signal_font_set ()
    Connect to the font_set_signal; emitted when the user selects a font.

## Protected Member Functions

Constructors

- FontButton (GtkFontButton *font_button, bool owns_reference=false)
    Construct a new FontButton from an existing GtkFontButton.

## Detailed Description

A GtkFontButton C++ wrapper class.

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

See also: the Font Selection HOWTO and example.

## Constructor & Destructor Documentation

Xfc::Gtk::FontButton::FontButton | ( | GtkFontButton * | font_button,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new FontButton from an existing GtkFontButton.

Parameters:

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

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

Xfc::Gtk::FontButton::FontButton | ( | const String & | fontname | ) | `[explicit]`

Constructs a new font picker widget.

Parameters:

  | fontname | The name of font to display in the font selection dialog.

## Member Function Documentation

String Xfc::Gtk::FontButton::get_font_name | ( |  | ) | const

Retrieves the name of the currently selected font.

Returns:
  The font name.

bool Xfc::Gtk::FontButton::get_show_size | ( |  | ) | const

Determines whether the font size will be shown in the label.

Returns:
  Whether the font size will be shown in the label.

bool Xfc::Gtk::FontButton::get_show_style | ( |  | ) | const

Determines whether the name of the font style will be shown in the label.

Returns:
  Whether the font style will be shown in the label.

String Xfc::Gtk::FontButton::get_title | ( |  | ) | const

Retrieves the title of the font selection dialog.

Returns:
  The title string.

bool Xfc::Gtk::FontButton::get_use_font | ( |  | ) | const

Determines whether the selected font is used in the label.

Returns:
  Whether the selected font is used in the label.

bool Xfc::Gtk::FontButton::get_use_size | ( |  | ) | const

Determines whether the selected size is used in the label.

Returns:
  Whether the selected font is used in the label.

bool Xfc::Gtk::FontButton::set_font_name | ( | const String & | fontname | ) |

Sets or updates the currently displayed font in font picker dialog.

Parameters:

  | fontname | The name of the font to display in font selection dialog.

Returns:
  true if the font was found, otherwise false.

void Xfc::Gtk::FontButton::set_show_size | ( | bool | show_size | ) |

If show_size is true, the font size will be displayed along with the name of the selected font.

Parameters:

  | show_size | Set true if the font size should be displayed in dialog.

void Xfc::Gtk::FontButton::set_show_style | ( | bool | show_style | ) |

If show_style is true the font style will be displayed along with the name of the selected font.

Parameters:

  | show_style | Set true if the font style should be displayed in the label.

void Xfc::Gtk::FontButton::set_title | ( | const String & | title | ) |

Sets the title for the font selection dialog.

Parameters:

  | title | A string containing the font selection dialog title.

void Xfc::Gtk::FontButton::set_use_font | ( | bool | use_font | ) |

If use_font is true, the font name will be written using the selected font.

Parameters:

  | use_font | If true, the font name will be written using the font chosen.

void Xfc::Gtk::FontButton::set_use_size | ( | bool | use_size | ) |

If use_size is true, the font name will be written using the selected size.

Parameters:

  | use_size | If true, then font name will be written using the selected size.

const FontSetSignalProxy Xfc::Gtk::FontButton::signal_font_set | ( |  | ) |

| Connect to the font_set_signal; emitted when the user selects a font. When handling this signal, use get_font_name() to find out which font was just selected.

## Member Data Documentation

const FontSetSignalType Xfc::Gtk::FontButton::font_set_signal `[static, protected]`

Font set signal (see signal_font_set()).

Calls a slot with the signature:

                 void function();

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

- fontbutton.hh

Xfce Foundation Classes

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