summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2006-03-29 05:39:11 +0000
committergouldtj <gouldtj@users.sourceforge.net>2006-03-29 05:39:11 +0000
commit34fe2dbdeaa0af57f8dc0945e52969b83883ffc5 (patch)
treee2048340e6b37c09e16fff2f4cecba1e5afc12a3
parentr10922@tres: ted | 2006-02-13 09:41:52 -0800 (diff)
downloadinkscape-34fe2dbdeaa0af57f8dc0945e52969b83883ffc5.tar.gz
inkscape-34fe2dbdeaa0af57f8dc0945e52969b83883ffc5.zip
r10923@tres: ted | 2006-02-13 09:47:15 -0800
Adding in the help dialog basics. (bzr r336)
-rw-r--r--src/extension/helpdialog.cpp44
-rw-r--r--src/extension/helpdialog.h41
-rw-r--r--src/extension/prefdialog.cpp14
-rw-r--r--src/extension/prefdialog.h2
4 files changed, 101 insertions, 0 deletions
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 <ted@gould.cx>
+ *
+ * Copyright (C) 2006 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include <gtkmm/stock.h>
+#include <glibmm/i18n.h>
+
+#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 <ted@gould.cx>
+ *
+ * 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 <glibmm/ustring.h>
+
+#include <gdkmm/types.h>
+#include <gtkmm/dialog.h>
+
+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);
+
};