diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2010-09-08 18:17:21 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2010-09-08 18:17:21 (GMT) |
commit | 690d926ac444243611cd875fb84fabb4e6db2cf2 (patch) | |
tree | c8ef84056b295071f9a9207ffea5393c6cf4ad4d /src/FbTk/TextButton.hh | |
parent | 1e8fe2bc14856fa16508686a28a85e72cb0e422c (diff) | |
download | fluxbox_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.hh | 11 |
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 | ||
29 | namespace FbTk { | 28 | namespace FbTk { |
30 | 29 | ||
@@ -34,11 +33,11 @@ class Font; | |||
34 | class TextButton: public FbTk::Button, FbTk::FbWindowRenderer { | 33 | class TextButton: public FbTk::Button, FbTk::FbWindowRenderer { |
35 | public: | 34 | public: |
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 | ||
76 | private: | 75 | private: |
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 | ||