diff --git a/src/FbTk/Button.hh b/src/FbTk/Button.hh index c3276a64..7a8cf565 100644 --- a/src/FbTk/Button.hh +++ b/src/FbTk/Button.hh @@ -47,6 +47,7 @@ public: /// sets the pixmap to be viewed when the button is pressed virtual void setPressedPixmap(Pixmap pm); virtual void setPressedColor(const FbTk::Color &color); + bool isPressed() const { return m_pressed; } /// sets graphic context for drawing void setGC(GC gc) { m_gc = gc; } /// sets background pixmap, this will override background color @@ -79,6 +80,12 @@ public: Pixmap pressedPixmap() const { return m_pressed_pm; } const Color &backgroundColor() const { return m_background_color; } const Color &pressedColor() const { return m_pressed_color; } +protected: + RefCount > command(int button) const { + if (button < 2) return m_onclick[0]; + if (button > 4) return m_onclick[4]; + return m_onclick[button - 1]; + } private: Pixmap m_background_pm; ///< background pixmap Color m_background_color; ///< background color