diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-09-14 16:09:58 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2016-09-21 18:46:39 (GMT) |
commit | 7fd13acab19dd449343fe8357946aa0c97d97f77 (patch) | |
tree | a9c8e28949eb1fd2e6a5420b7b3969f0d478e5d5 /src | |
parent | 1fc2602499d43d6e563a1281f8e13405000849ee (diff) | |
download | fluxbox-7fd13acab19dd449343fe8357946aa0c97d97f77.zip fluxbox-7fd13acab19dd449343fe8357946aa0c97d97f77.tar.bz2 |
button: export pressed state and assigned commands
latter protected only.
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Button.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/FbTk/Button.hh b/src/FbTk/Button.hh index c3276a6..7a8cf56 100644 --- a/src/FbTk/Button.hh +++ b/src/FbTk/Button.hh | |||
@@ -47,6 +47,7 @@ public: | |||
47 | /// sets the pixmap to be viewed when the button is pressed | 47 | /// sets the pixmap to be viewed when the button is pressed |
48 | virtual void setPressedPixmap(Pixmap pm); | 48 | virtual void setPressedPixmap(Pixmap pm); |
49 | virtual void setPressedColor(const FbTk::Color &color); | 49 | virtual void setPressedColor(const FbTk::Color &color); |
50 | bool isPressed() const { return m_pressed; } | ||
50 | /// sets graphic context for drawing | 51 | /// sets graphic context for drawing |
51 | void setGC(GC gc) { m_gc = gc; } | 52 | void setGC(GC gc) { m_gc = gc; } |
52 | /// sets background pixmap, this will override background color | 53 | /// sets background pixmap, this will override background color |
@@ -79,6 +80,12 @@ public: | |||
79 | Pixmap pressedPixmap() const { return m_pressed_pm; } | 80 | Pixmap pressedPixmap() const { return m_pressed_pm; } |
80 | const Color &backgroundColor() const { return m_background_color; } | 81 | const Color &backgroundColor() const { return m_background_color; } |
81 | const Color &pressedColor() const { return m_pressed_color; } | 82 | const Color &pressedColor() const { return m_pressed_color; } |
83 | protected: | ||
84 | RefCount<Command<void> > command(int button) const { | ||
85 | if (button < 2) return m_onclick[0]; | ||
86 | if (button > 4) return m_onclick[4]; | ||
87 | return m_onclick[button - 1]; | ||
88 | } | ||
82 | private: | 89 | private: |
83 | Pixmap m_background_pm; ///< background pixmap | 90 | Pixmap m_background_pm; ///< background pixmap |
84 | Color m_background_color; ///< background color | 91 | Color m_background_color; ///< background color |