button_release_can_deselect = true;
_dragging_playhead = false;
_dragging_edit_point = false;
- _dragging_hscrollbar = false;
select_new_marker = false;
rhythm_ferret = 0;
_bundle_manager = 0;
current_canvas_cursor = 0;
frames_per_unit = 2048; /* too early to use reset_zoom () */
- reset_hscrollbar_stepping ();
zoom_focus = ZoomFocusLeft;
set_zoom_focus (ZoomFocusLeft);
controls_layout.signal_button_release_event().connect (mem_fun(*this, &Editor::edit_controls_button_release));
controls_layout_size_request_connection = controls_layout.signal_size_request().connect (mem_fun (*this, &Editor::controls_layout_size_request));
- edit_vscrollbar.set_adjustment (vertical_adjustment);
- edit_hscrollbar.set_adjustment (horizontal_adjustment);
-
- edit_hscrollbar.signal_button_press_event().connect (mem_fun(*this, &Editor::hscrollbar_button_press), false);
- edit_hscrollbar.signal_button_release_event().connect (mem_fun(*this, &Editor::hscrollbar_button_release), false);
- edit_hscrollbar.signal_size_allocate().connect (mem_fun(*this, &Editor::hscrollbar_allocate));
-
- edit_hscrollbar.set_name ("EditorHScrollbar");
-
build_cursors ();
ArdourCanvas::Canvas* time_pad = manage(new ArdourCanvas::Canvas());
VPaned *editor_summary_pane = manage(new VPaned());
editor_summary_pane->pack1(edit_packer);
+ Button* summary_arrows_left_left = manage (new Button);
+ summary_arrows_left_left->add (*manage (new Arrow (ARROW_LEFT, SHADOW_NONE)));
+ summary_arrows_left_left->signal_clicked().connect (mem_fun (*this, &Editor::horizontal_scroll_left));
+ Button* summary_arrows_left_right = manage (new Button);
+ summary_arrows_left_right->add (*manage (new Arrow (ARROW_RIGHT, SHADOW_NONE)));
+ summary_arrows_left_right->signal_clicked().connect (mem_fun (*this, &Editor::horizontal_scroll_right));
+ VBox* summary_arrows_left = manage (new VBox);
+ summary_arrows_left->pack_start (*summary_arrows_left_left);
+ summary_arrows_left->pack_start (*summary_arrows_left_right);
+
+ Button* summary_arrows_right_left = manage (new Button);
+ summary_arrows_right_left->add (*manage (new Arrow (ARROW_LEFT, SHADOW_NONE)));
+ summary_arrows_right_left->signal_clicked().connect (mem_fun (*this, &Editor::horizontal_scroll_left));
+ Button* summary_arrows_right_right = manage (new Button);
+ summary_arrows_right_right->add (*manage (new Arrow (ARROW_RIGHT, SHADOW_NONE)));
+ summary_arrows_right_right->signal_clicked().connect (mem_fun (*this, &Editor::horizontal_scroll_right));
+ VBox* summary_arrows_right = manage (new VBox);
+ summary_arrows_right->pack_start (*summary_arrows_right_left);
+ summary_arrows_right->pack_start (*summary_arrows_right_right);
+
Frame* summary_frame = manage (new Frame);
summary_frame->set_shadow_type (Gtk::SHADOW_ETCHED_IN);
summary_frame->add (*_summary);
summary_frame->show ();
- editor_summary_pane->pack2(*summary_frame);
+ HBox* summary_hbox = manage (new HBox);
+ summary_hbox->pack_start (*summary_arrows_left, false, false);
+ summary_hbox->pack_start (*summary_frame, true, true);
+ summary_hbox->pack_start (*summary_arrows_right, false, false);
+
+ editor_summary_pane->pack2(*summary_hbox);
edit_pane.pack1 (*editor_summary_pane, true, true);
edit_pane.pack2 (the_notebook, false, true);
ZoomChanged (); /* EMIT_SIGNAL */
- reset_hscrollbar_stepping ();
-
if (session) {
cef = session->current_end_frame() + (current_page_frames() / 10);// Add a little extra so we can see the end marker
}
return true; // do it again, till we stop
}
+
+void
+Editor::horizontal_scroll_left ()
+{
+ double x = leftmost_position() - current_page_frames() / 5;
+ if (x < 0) {
+ x = 0;
+ }
+
+ reset_x_origin (x);
+}
+
+void
+Editor::horizontal_scroll_right ()
+{
+ reset_x_origin (leftmost_position() + current_page_frames() / 5);
+}
+++ /dev/null
-/*
- Copyright (C) 2002 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "editor.h"
-
-#include "ardour/session.h"
-
-using namespace std;
-using namespace ARDOUR;
-using namespace PBD;
-
-void
-Editor::hscrollbar_allocate (Gtk::Allocation &)
-{
-}
-
-bool
-Editor::hscrollbar_button_press (GdkEventButton *)
-{
- _dragging_hscrollbar = true;
- return false;
-}
-
-bool
-Editor::hscrollbar_button_release (GdkEventButton *)
-{
- _dragging_hscrollbar = false;
-
- if (session) {
-
- }
-
- return false;
-}
-
-void
-Editor::reset_hscrollbar_stepping ()
-{
- horizontal_adjustment.set_step_increment ((current_page_frames() / 5)/frames_per_unit); /* 5 clicks to scroll the entire page */
- horizontal_adjustment.set_page_increment (current_page_frames()/frames_per_unit);
-}