From 3a34031ac93159c6f1ffe78af42cf6555448543a Mon Sep 17 00:00:00 2001 From: gouldtj Date: Wed, 29 Mar 2006 05:39:11 +0000 Subject: [PATCH] r10923@tres: ted | 2006-02-13 09:47:15 -0800 Adding in the help dialog basics. --- src/extension/helpdialog.cpp | 44 ++++++++++++++++++++++++++++++++++++ src/extension/helpdialog.h | 41 +++++++++++++++++++++++++++++++++ src/extension/prefdialog.cpp | 14 ++++++++++++ src/extension/prefdialog.h | 2 ++ 4 files changed, 101 insertions(+) create mode 100644 src/extension/helpdialog.cpp create mode 100644 src/extension/helpdialog.h diff --git a/src/extension/helpdialog.cpp b/src/extension/helpdialog.cpp new file mode 100644 index 000000000..d53a3f058 --- /dev/null +++ b/src/extension/helpdialog.cpp @@ -0,0 +1,44 @@ +/* + * Authors: + * Ted Gould + * + * Copyright (C) 2006 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include +#include + +#include "../dialogs/dialog-events.h" + +#include "prefdialog.h" + +namespace Inkscape { +namespace Extension { + +HelpDialog::HelpDialog (Glib::ustring name, gchar const * help) : + Gtk::Dialog::Dialog(_("Help with ") + name, true, true) +{ + Gtk::Button * ok = add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); + set_default_response(Gtk::RESPONSE_OK); + ok->grab_focus(); + + GtkWidget *dlg = GTK_WIDGET(gobj()); + sp_transientize(dlg); + + return; +} + +}; }; /* namespace Inkscape, Extension */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/extension/helpdialog.h b/src/extension/helpdialog.h new file mode 100644 index 000000000..90a426969 --- /dev/null +++ b/src/extension/helpdialog.h @@ -0,0 +1,41 @@ +/* + * Authors: + * Ted Gould + * + * Copyright (C) 2006 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef INKSCAPE_EXTENSION_HELP_DIALOG_H__ +#define INKSCAPE_EXTENSION_HELP_DIALOG_H__ + +#include + +#include +#include + +namespace Inkscape { +namespace Extension { + +class HelpDialog : public Gtk::Dialog { + +public: + HelpDialog (Glib::ustring name, gchar const * help); +}; + + +};}; /* namespace Inkscape, Extension */ + +#endif /* INKSCAPE_EXTENSION_HELP_DIALOG_H__ */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index 86f1a50be..aacf5eec3 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -36,6 +36,20 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co return; } +Gtk::ResponseType +PrefDialog::run (void) { + Gtk::ResponseType resp = Gtk::RESPONSE_HELP; + while (resp == Gtk::RESPONSE_HELP) { + resp = Gtk::Dialog::run(); + if (resp == Gtk::RESPONSE_HELP) { + HelpDialog help(_name, _help); + help->run(); + help->hide(); + } + } + return resp; +} + }; }; /* namespace Inkscape, Extension */ /* diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h index 4324bedfd..bf30eda36 100644 --- a/src/extension/prefdialog.h +++ b/src/extension/prefdialog.h @@ -28,6 +28,8 @@ class PrefDialog : public Gtk::Dialog { public: PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls); + Gtk::ResponseType run (void); + }; -- 2.30.2