13
0
livetrax/libs/gtkmm2ext/focus_entry.cc
David Robillard 532f6aad4a Merged with trunk R1283.
NOTE: Compiles, but broken (crash on adding MIDI track).


git-svn-id: svn://localhost/ardour2/branches/midi@1292 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-01-09 23:24:54 +00:00

32 lines
558 B
C++

#include <gtkmm2ext/focus_entry.h>
using namespace Gtkmm2ext;
FocusEntry::FocusEntry ()
{
next_release_selects = false;
}
bool
FocusEntry::on_button_press_event (GdkEventButton* ev)
{
if (!has_focus()) {
next_release_selects = true;
}
return Entry::on_button_press_event (ev);
}
bool
FocusEntry::on_button_release_event (GdkEventButton* ev)
{
if (next_release_selects) {
bool ret = Entry::on_button_release_event (ev);
select_region (0, -1);
next_release_selects = false;
return ret;
}
return Entry::on_button_release_event (ev);
}