X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fselectable.h;fp=gtk2_ardour%2Fselectable.h;h=b4be7090e25609b695398244033607630d9a7694;hb=be362ae53c1d191e23d8a084d0327044bce4544c;hp=fdd6f7ff9f1fc298a29e45ae60aab8f4cbede3cc;hpb=c03dbd7568322d553ff681cb7f0bbd3452abd6cf;p=ardour.git diff --git a/gtk2_ardour/selectable.h b/gtk2_ardour/selectable.h index fdd6f7ff9f..b4be7090e2 100644 --- a/gtk2_ardour/selectable.h +++ b/gtk2_ardour/selectable.h @@ -21,7 +21,9 @@ #ifndef __ardour_gtk_selectable_h__ #define __ardour_gtk_selectable_h__ -class Selectable +#include + +class Selectable : public virtual sigc::trackable { public: Selectable() { @@ -30,10 +32,20 @@ class Selectable virtual ~Selectable() {} - virtual void set_selected (bool) { - _selected = true; + virtual void set_selected (bool yn) { + if (yn != _selected) { + _selected = true; + Selected (_selected); /* EMIT_SIGNAL */ + } + } + + bool get_selected() const { + return _selected; } + /** Emitted when the selected status of this Selectable changes */ + sigc::signal Selected ; + protected: bool _selected; };