diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-09 03:36:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-09 03:36:00 +0000 |
commit | 14543eb1374dc51834385d2f3886f1e6068223c5 (patch) | |
tree | 5194d0a983b77d79f5310f1216129e84c64f6a42 /libs/gtkmm2ext/gtkmm2ext/bindable_button.h | |
parent | 138b12b1dd5b7e6175b3349b8ed7fa8b16721809 (diff) |
strip X specific from keyboard.cc; fix up many buttons to avoid prelight (mostly) and make transport buttons bindable (state not saved yet); use const char* not string in route order keys to avoid pointless mallocs during route sorting
git-svn-id: svn://localhost/ardour2/trunk@1437 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/gtkmm2ext/bindable_button.h')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/bindable_button.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/bindable_button.h b/libs/gtkmm2ext/gtkmm2ext/bindable_button.h index 1936125405..845d3fa49e 100644 --- a/libs/gtkmm2ext/gtkmm2ext/bindable_button.h +++ b/libs/gtkmm2ext/gtkmm2ext/bindable_button.h @@ -30,15 +30,44 @@ namespace PBD { class Controllable; } -class BindableToggleButton : public Gtk::ToggleButton +class BindableToggleButton : public Gtkmm2ext::StatefulToggleButton { public: BindableToggleButton (PBD::Controllable& c) : binding_proxy (c) {} - explicit BindableToggleButton (PBD::Controllable& c, const std::string &label) : Gtk::ToggleButton (label), binding_proxy (c) {} + + explicit BindableToggleButton (PBD::Controllable& c, const std::string &label) + : Gtkmm2ext::StatefulToggleButton (label), binding_proxy (c) {} + virtual ~BindableToggleButton() {} bool on_button_press_event (GdkEventButton *ev) { - return binding_proxy.button_press_handler (ev); + if (!binding_proxy.button_press_handler (ev)) { + return false; + } else { + return true; + } + } + + private: + BindingProxy binding_proxy; +}; + +class BindableButton : public Gtkmm2ext::StatefulButton +{ + public: + BindableButton (PBD::Controllable& c) : binding_proxy (c) {} + + explicit BindableButton (PBD::Controllable& c, const std::string &label) + : Gtkmm2ext::StatefulButton (label), binding_proxy (c) {} + + ~BindableButton() {} + + bool on_button_press_event (GdkEventButton *ev) { + if (!binding_proxy.button_press_handler (ev)) { + return false; + } else { + return true; + } } private: |