all repos — fluxbox @ 7fd13acab19dd449343fe8357946aa0c97d97f77

custom fork of the fluxbox windowmanager

button: export pressed state and assigned commands

latter protected only.
Thomas Lübking thomas.luebking@gmail.com
commit

7fd13acab19dd449343fe8357946aa0c97d97f77

parent

1fc2602499d43d6e563a1281f8e13405000849ee

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M src/FbTk/Button.hhsrc/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