button: export pressed state and assigned commands latter protected only.
Thomas Lübking thomas.luebking@gmail.com
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
src/FbTk/Button.hh
→
src/FbTk/Button.hh
@@ -47,6 +47,7 @@
/// 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 @@ Pixmap backgroundPixmap() const { return m_background_pm; }
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<void> > 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