From 5caa6ff4dfb7b538555d60fa2732272bf8b9828b Mon Sep 17 00:00:00 2001 From: gustav_b Date: Thu, 22 Nov 2007 00:14:41 +0000 Subject: The dialog to panel refactoring: * Made the current dialogs subclass the Panel class instead of the Dialog class. * Extended the Panel class with some functionality that the dialogs relied on. * Added a PanelDialog class which is a dialog container for a single panel with the dialog behavior as a template parameter. (* Fixed coding style for the Panel and Dialog class) For details, see http://www.nabble.com/Re%3A-Dockable-dialogs%2C-todo-list-p12728194.html http://www.nabble.com/Re%3A-Inkscape-overcomes-Xara-in-Google-Trends-p13126622.html (bzr r4126) --- src/ui/dialog/scriptdialog.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/ui/dialog/scriptdialog.cpp') diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp index 304362f60..a56e74df3 100644 --- a/src/ui/dialog/scriptdialog.cpp +++ b/src/ui/dialog/scriptdialog.cpp @@ -43,7 +43,7 @@ class ScriptDialogImpl : public ScriptDialog /** * Constructor */ - ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory); + ScriptDialogImpl(); /** * Destructor @@ -192,10 +192,10 @@ void ScriptDialogImpl::executePerl() /** * Constructor */ -ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : - ScriptDialog(behavior_factory) +ScriptDialogImpl::ScriptDialogImpl() : + ScriptDialog() { - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *contents = _getContents(); //## Add a menu for clear() menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) ); @@ -209,7 +209,7 @@ ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Perl"), sigc::mem_fun(*this, &ScriptDialogImpl::executePerl) ) ); #endif - mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK); + contents->pack_start(menuBar, Gtk::PACK_SHRINK); //### Set up the script field scriptText.set_editable(true); @@ -219,7 +219,7 @@ ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : scriptTextFrame.set_label(_("Script")); scriptTextFrame.set_shadow_type(Gtk::SHADOW_NONE); scriptTextFrame.add(scriptTextScroll); - mainVBox->pack_start(scriptTextFrame); + contents->pack_start(scriptTextFrame); //### Set up the output field outputText.set_editable(true); @@ -229,7 +229,7 @@ ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : outputTextFrame.set_label(_("Output")); outputTextFrame.set_shadow_type(Gtk::SHADOW_NONE); outputTextFrame.add(outputTextScroll); - mainVBox->pack_start(outputTextFrame); + contents->pack_start(outputTextFrame); //### Set up the error field errorText.set_editable(true); @@ -239,7 +239,7 @@ ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : errorTextFrame.set_label(_("Errors")); errorTextFrame.set_shadow_type(Gtk::SHADOW_NONE); errorTextFrame.add(errorTextScroll); - mainVBox->pack_start(errorTextFrame); + contents->pack_start(errorTextFrame); // sick of this thing shrinking too much set_size_request(350, 400); @@ -250,10 +250,10 @@ ScriptDialogImpl::ScriptDialogImpl(Behavior::BehaviorFactory behavior_factory) : /** * Factory method. Use this to create a new ScriptDialog */ -ScriptDialog *ScriptDialog::create(Behavior::BehaviorFactory behavior_factory) +ScriptDialog &ScriptDialog::getInstance() { - ScriptDialog *dialog = new ScriptDialogImpl(behavior_factory); - return dialog; + ScriptDialog *dialog = new ScriptDialogImpl(); + return *dialog; } -- cgit v1.2.3