Code

86f1a50bed8518a9a4187a53589cecc3e448a813
[inkscape.git] / src / extension / prefdialog.cpp
1 /*
2  * Authors:
3  *   Ted Gould <ted@gould.cx>
4  *
5  * Copyright (C) 2005-2006 Authors
6  *
7  * Released under GNU GPL, read the file 'COPYING' for more information
8  */
10 #include <gtkmm/stock.h>
11 #include <glibmm/i18n.h>
13 #include "../dialogs/dialog-events.h"
15 #include "prefdialog.h"
17 namespace Inkscape {
18 namespace Extension {
20 PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls) :
21     Gtk::Dialog::Dialog(name + _(" Preferences"), true, true), _help(help), _name(name)
22 {
23     this->get_vbox()->pack_start(*controls, true, true, 5);
25     if (_help != NULL)
26         add_button(Gtk::Stock::HELP, Gtk::RESPONSE_HELP);
27     add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
29     Gtk::Button * ok = add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
30     set_default_response(Gtk::RESPONSE_OK);
31     ok->grab_focus();
32     
33     GtkWidget *dlg = GTK_WIDGET(gobj());
34     sp_transientize(dlg);
36     return;
37 }
39 }; }; /* namespace Inkscape, Extension */
41 /*
42   Local Variables:
43   mode:c++
44   c-file-style:"stroustrup"
45   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
46   indent-tabs-mode:nil
47   fill-column:99
48   End:
49 */
50 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :