aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
commit690d926ac444243611cd875fb84fabb4e6db2cf2 (patch)
treec8ef84056b295071f9a9207ffea5393c6cf4ad4d /src/FbTk/TextButton.hh
parent1e8fe2bc14856fa16508686a28a85e72cb0e422c (diff)
downloadfluxbox_pavel-690d926ac444243611cd875fb84fabb4e6db2cf2.zip
fluxbox_pavel-690d926ac444243611cd875fb84fabb4e6db2cf2.tar.bz2
introduced FbTk::BidiString
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
Diffstat (limited to 'src/FbTk/TextButton.hh')
-rw-r--r--src/FbTk/TextButton.hh11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh
index 6ddcd8f..a1c8b0e 100644
--- a/src/FbTk/TextButton.hh
+++ b/src/FbTk/TextButton.hh
@@ -23,8 +23,7 @@
23#define FBTK_TEXTBUTTON_HH 23#define FBTK_TEXTBUTTON_HH
24 24
25#include "Button.hh" 25#include "Button.hh"
26 26#include "FbString.hh"
27#include <string>
28 27
29namespace FbTk { 28namespace FbTk {
30 29
@@ -34,11 +33,11 @@ class Font;
34class TextButton: public FbTk::Button, FbTk::FbWindowRenderer { 33class TextButton: public FbTk::Button, FbTk::FbWindowRenderer {
35public: 34public:
36 TextButton(const FbTk::FbWindow &parent, 35 TextButton(const FbTk::FbWindow &parent,
37 FbTk::Font &font, const std::string &text); 36 FbTk::Font &font, const FbTk::BiDiString &text);
38 37
39 void setJustify(FbTk::Justify just); 38 void setJustify(FbTk::Justify just);
40 bool setOrientation(FbTk::Orientation orient); 39 bool setOrientation(FbTk::Orientation orient);
41 void setText(const std::string &text); 40 void setText(const FbTk::BiDiString &text);
42 void setFont(FbTk::Font &font); 41 void setFont(FbTk::Font &font);
43 void setTextPadding(unsigned int padding); 42 void setTextPadding(unsigned int padding);
44 void setTextPaddingLeft(unsigned int leftpadding); 43 void setTextPaddingLeft(unsigned int leftpadding);
@@ -60,7 +59,7 @@ public:
60 void renderForeground(FbDrawable &drawable); 59 void renderForeground(FbDrawable &drawable);
61 60
62 FbTk::Justify justify() const { return m_justify; } 61 FbTk::Justify justify() const { return m_justify; }
63 const std::string &text() const { return m_text; } 62 const BiDiString &text() const { return m_text; }
64 FbTk::Font &font() const { return *m_font; } 63 FbTk::Font &font() const { return *m_font; }
65 FbTk::Orientation orientation() const { return m_orientation; } 64 FbTk::Orientation orientation() const { return m_orientation; }
66 unsigned int textWidth() const; 65 unsigned int textWidth() const;
@@ -75,7 +74,7 @@ protected:
75 74
76private: 75private:
77 FbTk::Font *m_font; 76 FbTk::Font *m_font;
78 std::string m_text; 77 BiDiString m_text;
79 FbTk::Justify m_justify; 78 FbTk::Justify m_justify;
80 FbTk::Orientation m_orientation; 79 FbTk::Orientation m_orientation;
81 80