aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/TextButton.cc17
-rw-r--r--src/FbTk/TextButton.hh4
2 files changed, 15 insertions, 6 deletions
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index a9a867f..4b2d45e 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextButton.cc,v 1.2 2003/09/10 21:36:37 fluxgen Exp $ 22// $Id: TextButton.cc,v 1.3 2003/09/14 09:50:01 fluxgen Exp $
23 23
24#include "TextButton.hh" 24#include "TextButton.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -86,7 +86,6 @@ void TextButton::clear() {
86void TextButton::clearArea(int x, int y, 86void TextButton::clearArea(int x, int y,
87 unsigned int width, unsigned int height, 87 unsigned int width, unsigned int height,
88 bool exposure) { 88 bool exposure) {
89
90 if (backgroundPixmap() != ParentRelative) { 89 if (backgroundPixmap() != ParentRelative) {
91 90
92 if (backgroundPixmap()) { 91 if (backgroundPixmap()) {
@@ -106,13 +105,17 @@ void TextButton::clearArea(int x, int y,
106 105
107 drawText(); 106 drawText();
108 107
109 FbWindow::setBackgroundPixmap(m_buffer.drawable()); 108 setBufferPixmap(m_buffer.drawable());
110 109 FbWindow::setBackgroundPixmap(m_buffer.drawable());
111 Button::clearArea(x, y, width, height, exposure); 110 updateTransparent(x, y, width, height);
112 111
112 FbWindow::clearArea(x, y, width, height, exposure);
113
113 } else { // parent relative 114 } else { // parent relative
115 FbWindow::setBufferPixmap(0);
114 FbWindow::setBackgroundPixmap(backgroundPixmap()); 116 FbWindow::setBackgroundPixmap(backgroundPixmap());
115 Button::clearArea(x, y, width, height, exposure); 117 Button::clearArea(x, y, width, height, exposure);
118 updateTransparent(x, y, width, height);
116 drawText(); 119 drawText();
117 } 120 }
118 121
@@ -144,4 +147,8 @@ void TextButton::drawText(int x_offset, int y_offset) {
144 align_x + x_offset, center_pos + y_offset); // position 147 align_x + x_offset, center_pos + y_offset); // position
145} 148}
146 149
150void TextButton::exposeEvent(XExposeEvent &event) {
151 clearArea(event.x, event.y, event.width, event.height, false);
152}
153
147}; // end namespace FbTk 154}; // end namespace FbTk
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh
index 5d87804..246461b 100644
--- a/src/FbTk/TextButton.hh
+++ b/src/FbTk/TextButton.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextButton.hh,v 1.2 2003/09/10 21:36:37 fluxgen Exp $ 22// $Id: TextButton.hh,v 1.3 2003/09/14 09:50:01 fluxgen Exp $
23 23
24#ifndef FBTK_TEXTBUTTON_HH 24#ifndef FBTK_TEXTBUTTON_HH
25#define FBTK_TEXTBUTTON_HH 25#define FBTK_TEXTBUTTON_HH
@@ -56,6 +56,8 @@ public:
56 unsigned int width, unsigned int height, 56 unsigned int width, unsigned int height,
57 bool exposure = false); 57 bool exposure = false);
58 58
59 void exposeEvent(XExposeEvent &event);
60
59 inline FbTk::Justify justify() const { return m_justify; } 61 inline FbTk::Justify justify() const { return m_justify; }
60 inline const std::string &text() const { return m_text; } 62 inline const std::string &text() const { return m_text; }
61 inline const FbTk::Font &font() const { return *m_font; } 63 inline const FbTk::Font &font() const { return *m_font; }