From b3083a4fe57cc99c6972180a40091001cb209ad7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 10 May 2009 15:33:16 +0000 Subject: added disabled ui palette color, added dock and launch buttons --- src/ui/iconbutton.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'src/ui/iconbutton.h') diff --git a/src/ui/iconbutton.h b/src/ui/iconbutton.h index d545697..10b073f 100644 --- a/src/ui/iconbutton.h +++ b/src/ui/iconbutton.h @@ -18,29 +18,44 @@ public: IconButton(Widget *parent, const char *icon=0, const char *command=0); ~IconButton(); + /// the command this button executes + inline const std::string & command() const { + return iconbutton_command; + } + + /// the icon texture + inline const std::string & icon() const { + return iconbutton_icon; + } + + /// enabled or disabled + inline const bool enabled() const { + return iconbutton_enabled; + } + + /// enabled or disabled + inline const bool disabled() const { + return !iconbutton_enabled; + } + + /// enable or disable the button + void enable(bool enabled=true); + + /// enable or disable the button + void disable(bool disabled=true); + /// set the command this button will execute void set_command(const std::string &command); /// set the command this button will execute void set_command(const char *command); - /// the command this button executes - inline const std::string & command() const { - return iconbutton_command; - } - - /// set the icon texture void set_icon(const std::string & icon); /// set the icon texture void set_icon(const char *icon); - /// the icon texture - inline const std::string & icon() const { - return iconbutton_icon; - } - /// print button description virtual void print(const size_t indent) const; @@ -63,6 +78,7 @@ protected: private: std::string iconbutton_command; std::string iconbutton_icon; + bool iconbutton_enabled; }; } -- cgit v1.2.3