diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 16:37:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 16:37:04 +0000 |
commit | 3e966771d042455a50a01e786af2af7b6f407395 (patch) | |
tree | b93b553d12b4c903087f26efa5ff06284add0cab /gtk2_ardour/canvas-note-event.cc | |
parent | 3d6493abc9d332132aef250a551d60fe45f7b3eb (diff) |
clean up item event handling in MidiRegionViews by removing unnecessary InteractiveItem inheritance, and keep child->parent event handling order consistent as much as possible
git-svn-id: svn://localhost/ardour2/branches/3.0@7186 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-note-event.cc')
-rw-r--r-- | gtk2_ardour/canvas-note-event.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc index 0ad6cd2be9..03130dd173 100644 --- a/gtk2_ardour/canvas-note-event.cc +++ b/gtk2_ardour/canvas-note-event.cc @@ -18,6 +18,9 @@ */ #include <iostream> + +#include "gtkmm2ext/keyboard.h" + #include "canvas-note-event.h" #include "midi_region_view.h" #include "public_editor.h" @@ -25,6 +28,7 @@ #include "keyboard.h" using namespace std; +using namespace Gtkmm2ext; using ARDOUR::MidiModel; namespace Gnome { @@ -40,8 +44,7 @@ const uint32_t CanvasNoteEvent::midi_channel_colors[16] = { 0x832dd3ff, 0xa92dd3ff, 0xd32dbfff, 0xd32d67ff }; -CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item, - const boost::shared_ptr<NoteType> note) +CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item, const boost::shared_ptr<NoteType> note) : _region(region) , _item(item) , _text(0) @@ -81,7 +84,7 @@ void CanvasNoteEvent::show_velocity() { if (!_text) { - _text = new InteractiveText(*(_item->property_parent()), this); + _text = new NoEventText (*(_item->property_parent())); } _text->property_x() = (x1() + x2()) /2; _text->property_y() = (y1() + y2()) /2; @@ -218,35 +221,31 @@ CanvasNoteEvent::base_color() bool CanvasNoteEvent::on_event(GdkEvent* ev) { - PublicEditor& editor (_region.get_time_axis_view().editor()); - - if (!editor.internal_editing()) { + cerr << "CNE: on_event type " << ev->type << endl; + + if (!_region.get_time_axis_view().editor().internal_editing()) { return false; } switch (ev->type) { case GDK_ENTER_NOTIFY: _region.note_entered(this); - //Keyboard::magic_widget_grab_focus(); break; case GDK_LEAVE_NOTIFY: - //Keyboard::magic_widget_drop_focus(); _region.note_left (this); - if (!selected()) { - hide_velocity(); - } break; case GDK_BUTTON_PRESS: - if (ev->button.button == 3) { - show_channel_selector(); + cerr << "button press, bton = " << ev->button.button << endl; + if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) { + show_channel_selector(); return true; } break; case GDK_BUTTON_RELEASE: - if (ev->button.button == 3) { + if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) { return true; } break; |