[Summary] Reworked implementation on Esc and on Enter pressed according to new possibilities in parent class WavesDialog

[Reviewed] Nobody
This commit is contained in:
Nikolay 2014-10-23 11:46:40 +03:00
parent 22e5ec45a6
commit 5391c2f4a8
2 changed files with 15 additions and 19 deletions

View file

@ -140,22 +140,16 @@ AddTracksDialog::setup ()
_tracks_format_dropdown.set_text(TrackFormat::FormatMono);
}
bool
AddTracksDialog::on_key_press_event (GdkEventKey* ev)
void
AddTracksDialog::on_enter_pressed ()
{
switch (ev->keyval)
{
case GDK_Return:
hide();
response (Gtk::RESPONSE_YES);
return true;
case GDK_Escape:
hide();
response (Gtk::RESPONSE_CANCEL);
return true;
}
Gtk::Widget::on_key_press_event(ev);
return true; // do not propagate event
hide();
response (Gtk::RESPONSE_YES);
}
void
AddTracksDialog::on_esc_pressed ()
{
hide();
response (Gtk::RESPONSE_CANCEL);
}

View file

@ -26,8 +26,10 @@ public:
int count();
ARDOUR::ChanCount input_channels ();
bool on_key_press_event (GdkEventKey* ev);
protected:
void on_enter_pressed ();
void on_esc_pressed ();
private:
WavesButton& _decrement_button;
WavesButton& _increment_button;