From a023afc3a5889eab2d850a531bf91cee21bf4d97 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 2 Jan 2008 05:16:57 +0000 Subject: Store (in memory, not to disk) module locations on arrange, so locations are not destroyed by refresh. git-svn-id: http://svn.drobilla.net/lad/patchage@1003 a436a847-0d15-0410-975c-d299462d15a1 --- src/PatchageModule.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/PatchageModule.hpp') diff --git a/src/PatchageModule.hpp b/src/PatchageModule.hpp index f046267..9004143 100644 --- a/src/PatchageModule.hpp +++ b/src/PatchageModule.hpp @@ -54,7 +54,12 @@ public: virtual ~PatchageModule() { delete _menu; } - virtual void load_location() { + void move(double dx, double dy) { + FlowCanvas::Module::move(dx, dy); + store_location(); + } + + void load_location() { boost::shared_ptr canvas = _canvas.lock(); if (!canvas) return; @@ -67,7 +72,12 @@ public: move_to((canvas->width()/2) - 100 + rand() % 400, (canvas->height()/2) - 100 + rand() % 400); } - + + virtual void store_location() { + Coord loc = { property_x().get_value(), property_y().get_value() }; + _app->state_manager()->set_module_location(_name, _type, loc); + } + void split() { assert(_type == InputOutput); _app->state_manager()->set_module_split(_name, true); @@ -79,12 +89,7 @@ public: _app->state_manager()->set_module_split(_name, false); _app->refresh(); } - - virtual void store_location() { - Coord loc = { property_x().get_value(), property_y().get_value() }; - _app->state_manager()->set_module_location(_name, _type, loc); - } - + virtual void show_dialog() {} virtual void menu_disconnect_all() { -- cgit v1.2.1