aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/TextButton.hh')
-rw-r--r--src/FbTk/TextButton.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh
index 3a9407f..f5738b5 100644
--- a/src/FbTk/TextButton.hh
+++ b/src/FbTk/TextButton.hh
@@ -35,7 +35,7 @@ namespace FbTk {
35class Font; 35class Font;
36 36
37/// Displays a text on a button 37/// Displays a text on a button
38class TextButton: public FbTk::Button { 38class TextButton: public FbTk::Button, FbTk::FbWindowRenderer {
39public: 39public:
40 TextButton(const FbTk::FbWindow &parent, 40 TextButton(const FbTk::FbWindow &parent,
41 const FbTk::Font &font, const std::string &text); 41 const FbTk::Font &font, const std::string &text);
@@ -61,6 +61,8 @@ public:
61 61
62 void exposeEvent(XExposeEvent &event); 62 void exposeEvent(XExposeEvent &event);
63 63
64 void renderForeground(FbDrawable &drawable);
65
64 inline FbTk::Justify justify() const { return m_justify; } 66 inline FbTk::Justify justify() const { return m_justify; }
65 inline const std::string &text() const { return m_text; } 67 inline const std::string &text() const { return m_text; }
66 inline const FbTk::Font &font() const { return *m_font; } 68 inline const FbTk::Font &font() const { return *m_font; }
@@ -69,8 +71,10 @@ public:
69 unsigned int leftPadding() const { return m_left_padding; } 71 unsigned int leftPadding() const { return m_left_padding; }
70 unsigned int rightPadding() const { return m_right_padding; } 72 unsigned int rightPadding() const { return m_right_padding; }
71 73
74 void renderForeground(FbWindow &win, FbDrawable &drawable);
75
72protected: 76protected:
73 virtual void drawText(int x_offset = 0, int y_offset = 0); 77 virtual void drawText(int x_offset, int y_offset, FbDrawable *drawable_override);
74 78
75private: 79private:
76 const FbTk::Font *m_font; 80 const FbTk::Font *m_font;