summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72ca5ff)
raw | patch | inline | side by side (parent: 72ca5ff)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 29 Mar 2006 05:40:31 +0000 (05:40 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 29 Mar 2006 05:40:31 +0000 (05:40 +0000) |
Stole the basics from the Inkscape preferences dialog. That's kinda the
style I'm looking for. Now, to embrace and extend it.
style I'm looking for. Now, to embrace and extend it.
src/ui/dialog/extension-editor.cpp | patch | blob | history | |
src/ui/dialog/extension-editor.h | patch | blob | history |
index 2b17983ce85ddbccb4b8c783202fca31716c9f27..aca41f6f6717488338e7a5cc6a0a1dd0e4285909 100644 (file)
*
* Authors:
* Bryce W. Harrington <bryce@bryceharrington.org>
+ * Ted Gould <ted@gould.cx>
*
- * Copyright (C) 2004, 2005 Authors
+ * Copyright (C) 2004-2006 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
# include <config.h>
#endif
+#include <gtkmm/frame.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/alignment.h>
+
#include "extension-editor.h"
#include "verbs.h"
namespace Dialog {
ExtensionEditor::ExtensionEditor()
- : Dialog ("dialogs.extensioneditor", SP_VERB_NONE /*FIXME*/)
+ : Dialog ("dialogs.extensioneditor", SP_VERB_DIALOG_EXTENSIONEDITOR)
{
- // TODO: Insert widgets
+
+ //Main HBox
+ Gtk::HBox* hbox_list_page = Gtk::manage(new Gtk::HBox());
+ hbox_list_page->set_border_width(12);
+ hbox_list_page->set_spacing(12);
+ this->get_vbox()->add(*hbox_list_page);
+
+
+ //Pagelist
+ Gtk::Frame* list_frame = Gtk::manage(new Gtk::Frame());
+ Gtk::ScrolledWindow* scrolled_window = Gtk::manage(new Gtk::ScrolledWindow());
+ hbox_list_page->pack_start(*list_frame, false, true, 0);
+ _page_list.set_headers_visible(false);
+ scrolled_window->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
+ scrolled_window->add(_page_list);
+ list_frame->set_shadow_type(Gtk::SHADOW_IN);
+ list_frame->add(*scrolled_window);
+ _page_list_model = Gtk::TreeStore::create(_page_list_columns);
+ _page_list.set_model(_page_list_model);
+ _page_list.append_column("name",_page_list_columns._col_name);
+ Glib::RefPtr<Gtk::TreeSelection> page_list_selection = _page_list.get_selection();
+ page_list_selection->signal_changed().connect(sigc::mem_fun(*this, &ExtensionEditor::on_pagelist_selection_changed));
+ page_list_selection->set_mode(Gtk::SELECTION_BROWSE);
+
+
+ //Pages
+ Gtk::VBox* vbox_page = Gtk::manage(new Gtk::VBox());
+ Gtk::Frame* title_frame = Gtk::manage(new Gtk::Frame());
+ hbox_list_page->pack_start(*vbox_page, true, true, 0);
+ title_frame->add(_page_title);
+ vbox_page->pack_start(*title_frame, false, false, 0);
+ vbox_page->pack_start(_page_frame, true, true, 0);
+ _page_frame.set_shadow_type(Gtk::SHADOW_IN);
+ title_frame->set_shadow_type(Gtk::SHADOW_IN);
+
show_all_children();
}
index 4c6beb7f7966b7f2ae1173ee3b05b019b51c0989..70825d193e5f686030e76f86c0a08c016397adbf 100644 (file)
*
* Authors:
* Bryce W. Harrington <bryce@bryceharrington.org>
+ * Ted Gould <ted@gould.cx>
*
- * Copyright (C) 2004, 2005 Authors
+ * Copyright (C) 2004-2006 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#include <glibmm/i18n.h>
+#include <gtkmm/treestore.h>
+#include <gtkmm/treeview.h>
+#include <gtkmm/label.h>
+#include <gtkmm/frame.h>
+
+
namespace Inkscape {
namespace UI {
namespace Dialog {
static ExtensionEditor *create() { return new ExtensionEditor(); }
+ static void show_help (gchar const * extension_id);
+
protected:
+ Gtk::Frame _page_frame;
+ Gtk::Label _page_title;
+ Gtk::TreeView _page_list;
+ Glib::RefPtr<Gtk::TreeStore> _page_list_model;
+
+ //Pagelist model columns:
+ class PageListModelColumns : public Gtk::TreeModel::ColumnRecord {
+ public:
+ PageListModelColumns() {
+ Gtk::TreeModelColumnRecord::add(_col_name);
+ Gtk::TreeModelColumnRecord::add(_col_page);
+ Gtk::TreeModelColumnRecord::add(_col_id);
+ }
+ Gtk::TreeModelColumn<Glib::ustring> _col_name;
+ Gtk::TreeModelColumn<gchar const *> _col_id;
+ Gtk::TreeModelColumn<Gtk::Widget *> _col_page;
+ };
+ PageListModelColumns _page_list_columns;
+
+ Gtk::TreeModel::Path _path_tools;
+ Gtk::TreeModel::Path _path_shapes;
private:
ExtensionEditor(ExtensionEditor const &d);
ExtensionEditor& operator=(ExtensionEditor const &d);
+
+ void on_pagelist_selection_changed();
};
} // namespace Dialog