From 447bc996655de10ab687c9d36a4817681d044b61 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Jun 2008 15:54:13 +0000 Subject: Scroll canvas with arrow keys. git-svn-id: http://svn.drobilla.net/lad/patchage@1242 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 13 +++++++++++++ src/Patchage.hpp | 1 + src/PatchageCanvas.cpp | 4 ++-- src/patchage.glade | 8 ++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index b91150f..84f66d3 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -162,6 +162,9 @@ Patchage::Patchage(int argc, char** argv) _main_scrolledwin->property_hadjustment().get_value()->set_step_increment(10); _main_scrolledwin->property_vadjustment().get_value()->set_step_increment(10); + _main_scrolledwin->signal_scroll_event().connect( + sigc::mem_fun(this, &Patchage::on_scroll)); + _buffer_size_combo->signal_changed().connect( sigc::mem_fun(this, &Patchage::buffer_size_changed)); _clear_load_but->signal_clicked().connect( @@ -251,6 +254,8 @@ Patchage::Patchage(int argc, char** argv) connect_widgets(); update_state(); + _canvas->grab_focus(); + // Idle callback, check if we need to refresh Glib::signal_timeout().connect( sigc::mem_fun(this, &Patchage::idle_callback), 100); @@ -663,6 +668,14 @@ Patchage::on_view_toolbar() _toolbar->hide(); } + +bool +Patchage::on_scroll(GdkEventScroll* ev) +{ + cout << "ON SCROLL" << endl; + return false; +} + void Patchage::buffer_size_changed() diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 2f08d2b..18f95d3 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -73,6 +73,7 @@ protected: void on_show_messages(); void on_store_positions(); void on_view_toolbar(); + bool on_scroll(GdkEventScroll* ev); void zoom(double z); bool idle_callback(); diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index 1a06674..565e703 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -31,8 +31,8 @@ #endif PatchageCanvas::PatchageCanvas(Patchage* app, int width, int height) -: FlowCanvas::Canvas(width, height), - _app(app) + : FlowCanvas::Canvas(width, height) + , _app(app) { } diff --git a/src/patchage.glade b/src/patchage.glade index 963ce5d..7559db8 100644 --- a/src/patchage.glade +++ b/src/patchage.glade @@ -486,6 +486,7 @@ The bar represents the percentage of available time used for audio processing (i False + False False @@ -496,6 +497,7 @@ The bar represents the percentage of available time used for audio processing (i False + False @@ -529,8 +531,10 @@ The bar represents the percentage of available time used for audio processing (i True True True + True True True + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN @@ -595,7 +599,7 @@ JACK D-Bus driver by Nedko Arnaudov <nedko@arnaudov.name> True GDK_WINDOW_TYPE_HINT_DIALOG - + True @@ -663,7 +667,7 @@ JACK D-Bus driver by Nedko Arnaudov <nedko@arnaudov.name> - + True GTK_BUTTONBOX_END -- cgit v1.2.1