From 01ca801621b78fb1d5ec7c27c0f34ac6eb0b5f6c Mon Sep 17 00:00:00 2001 From: gouldtj Date: Wed, 29 Mar 2006 05:40:31 +0000 Subject: [PATCH] r10952@tres: ted | 2006-02-16 09:17:08 -0800 Stole the basics from the Inkscape preferences dialog. That's kinda the style I'm looking for. Now, to embrace and extend it. --- src/ui/dialog/extension-editor.cpp | 45 ++++++++++++++++++++++++++++-- src/ui/dialog/extension-editor.h | 34 +++++++++++++++++++++- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/ui/dialog/extension-editor.cpp b/src/ui/dialog/extension-editor.cpp index 2b17983ce..aca41f6f6 100644 --- a/src/ui/dialog/extension-editor.cpp +++ b/src/ui/dialog/extension-editor.cpp @@ -3,8 +3,9 @@ * * Authors: * Bryce W. Harrington + * Ted Gould * - * Copyright (C) 2004, 2005 Authors + * Copyright (C) 2004-2006 Authors * * Released under GNU GPL. Read the file 'COPYING' for more information. */ @@ -13,6 +14,10 @@ # include #endif +#include +#include +#include + #include "extension-editor.h" #include "verbs.h" @@ -21,9 +26,43 @@ namespace UI { 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 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(); } diff --git a/src/ui/dialog/extension-editor.h b/src/ui/dialog/extension-editor.h index 4c6beb7f7..70825d193 100644 --- a/src/ui/dialog/extension-editor.h +++ b/src/ui/dialog/extension-editor.h @@ -3,8 +3,9 @@ * * Authors: * Bryce W. Harrington + * Ted Gould * - * Copyright (C) 2004, 2005 Authors + * Copyright (C) 2004-2006 Authors * * Released under GNU GPL. Read the file 'COPYING' for more information. */ @@ -16,6 +17,12 @@ #include +#include +#include +#include +#include + + namespace Inkscape { namespace UI { namespace Dialog { @@ -27,11 +34,36 @@ public: 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 _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 _col_name; + Gtk::TreeModelColumn _col_id; + Gtk::TreeModelColumn _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 -- 2.30.2