X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fselectable.h;h=51fc5da027bafb62d5013dc336d0215e22b5558b;hb=185be4e841e182bbe7cb7820f9cb6371ebebe15d;hp=fdd6f7ff9f1fc298a29e45ae60aab8f4cbede3cc;hpb=209d967b1bb80a9735d690d8f4f0455ecb9970ca;p=ardour.git diff --git a/gtk2_ardour/selectable.h b/gtk2_ardour/selectable.h index fdd6f7ff9f..51fc5da027 100644 --- a/gtk2_ardour/selectable.h +++ b/gtk2_ardour/selectable.h @@ -15,13 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_gtk_selectable_h__ #define __ardour_gtk_selectable_h__ -class Selectable +#include + +class Selectable : public virtual sigc::trackable { public: Selectable() { @@ -30,10 +31,20 @@ class Selectable virtual ~Selectable() {} - virtual void set_selected (bool) { - _selected = true; + virtual void set_selected (bool yn) { + if (yn != _selected) { + _selected = yn; + 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; };