2
* \brief Labelled Widget - Adds a label with optional icon or suffix to
6
* Carl Hetherington <inkscape@carlh.net>
7
* Derek P. Moore <derekm@hackunix.org>
9
* Copyright (C) 2004 Carl Hetherington
11
* Released under GNU GPL. Read the file 'COPYING' for more information.
18
/* For getting the Gtkmmified Icon manager */
19
#include "widgets/icon.h"
28
* Construct a Labelled Widget.
31
* \param widget Widget to label; should be allocated with new, as it will
32
* be passed to Gtk::manage().
33
* \param suffix Suffix, placed after the widget (defaults to "").
34
* \param icon Icon filename, placed before the label (defaults to "").
35
* \param mnemonic Mnemonic toggle; if true, an underscore (_) in the text
36
* indicates the next character should be used for the
37
* mnemonic accelerator key (defaults to true).
39
Labelled::Labelled(Glib::ustring const &label, Glib::ustring const &tooltip,
41
Glib::ustring const &suffix,
42
Glib::ustring const &icon,
45
_label(new Gtk::Label(label, 1.0, 0.5, mnemonic)),
46
_suffix(new Gtk::Label(suffix, 0.0, 0.5)),
49
g_assert(g_utf8_validate(icon.c_str(), -1, NULL));
51
_icon = sp_icon_get_icon(icon.c_str(), Inkscape::ICON_SIZE_LARGE_TOOLBAR);
52
pack_start(*Gtk::manage(_icon), Gtk::PACK_SHRINK);
54
pack_start(*Gtk::manage(_label), Gtk::PACK_EXPAND_WIDGET, 6);
55
pack_start(*Gtk::manage(_widget), Gtk::PACK_SHRINK, 6);
57
_label->set_mnemonic_widget(*_widget);
59
_tooltips.set_tip(*_widget, tooltip);
64
* Allow the setting of the width of the labelled widget
66
void Labelled::setWidgetSizeRequest(int width, int height)
69
_widget->set_size_request(width, height);
75
Labelled::getWidget() const
81
Labelled::getLabel() const
91
} // namespace Inkscape
96
c-file-style:"stroustrup"
97
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
102
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :