{
switch (ev->button) {
case 1:
- if (cell) {
- editing_field = (Field) cell->id ();
- display->start_editing (cell);
+ if (editable) {
+ if (cell) {
+ editing_field = (Field) cell->id ();
+ display->start_editing (cell);
+ }
+
+ Keyboard::magic_widget_grab_focus ();
+
+ /* make absolutely sure that the pointer is grabbed */
+ gdk_pointer_grab(ev->window,false ,
+ GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
+ NULL,NULL,ev->time);
+ dragging = true;
+ drag_accum = 0;
+ drag_start_y = ev->y;
+ drag_y = ev->y;
}
-
- Keyboard::magic_widget_grab_focus ();
-
- /* make absolutely sure that the pointer is grabbed */
- gdk_pointer_grab(ev->window,false ,
- GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
- NULL,NULL,ev->time);
- dragging = true;
- drag_accum = 0;
- drag_start_y = ev->y;
- drag_y = ev->y;
break;
default:
bool
AudioClock::button_release (GdkEventButton *ev, CairoCell* cell)
{
- if (dragging) {
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- dragging = false;
- if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)){
- // we actually dragged so return without setting editing focus, or we shift clicked
- return true;
- }
- }
-
- if (!editable) {
- if (ops_menu == 0) {
- build_ops_menu ();
+ if (editable) {
+ if (dragging) {
+ gdk_pointer_ungrab (GDK_CURRENT_TIME);
+ dragging = false;
+ if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)){
+ // we actually dragged so return without setting editing focus, or we shift clicked
+ return true;
+ }
}
- ops_menu->popup (1, ev->time);
- return true;
}
if (Keyboard::is_context_menu_event (ev)) {
return true;
}
- return true;
+ return false;
}
bool
punch_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_start));
punch_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_end));
+ selection_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_start), true);
+ selection_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_end), true);
+
+ punch_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_start), true);
+ punch_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_end), true);
+
Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
}
delete punch_end;
}
+bool
+TimeInfoBox::clock_button_release_event (GdkEventButton* ev, AudioClock* src)
+{
+ if (!_session) {
+ return false;
+ }
+
+ if (ev->button == 1) {
+ _session->request_locate (src->current_time ());
+ return true;
+ }
+
+ return false;
+}
+
void
TimeInfoBox::sync_selection_mode (AudioClock* src)
{