aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextBox.hh
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-04-24 05:57:08 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-04-25 17:04:13 (GMT)
commit58b50fb786a15fb1740a3d900e271d0baa6b5482 (patch)
tree74641aec921d24ccc47f32b268dec1f8e61261f6 /src/FbTk/TextBox.hh
parent2e8766174eaa11e7f370ba5927ed38e18efced11 (diff)
downloadfluxbox-58b50fb786a15fb1740a3d900e271d0baa6b5482.zip
fluxbox-58b50fb786a15fb1740a3d900e271d0baa6b5482.tar.bz2
Allow text selection
FbTk::TextBox now acts like any contemporary input field ;-)
Diffstat (limited to 'src/FbTk/TextBox.hh')
-rw-r--r--src/FbTk/TextBox.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/FbTk/TextBox.hh b/src/FbTk/TextBox.hh
index 40a7c3c..2c1ef9d 100644
--- a/src/FbTk/TextBox.hh
+++ b/src/FbTk/TextBox.hh
@@ -65,6 +65,10 @@ public:
65 int cursorPosition() const { return m_cursor_pos; } 65 int cursorPosition() const { return m_cursor_pos; }
66 int textStartPos() const { return m_start_pos; } 66 int textStartPos() const { return m_start_pos; }
67 67
68 bool hasSelection() const { return m_select_pos != -1 && m_select_pos != m_cursor_pos + m_start_pos; }
69 void select(std::string::size_type pos, int length);
70 void selectAll();
71
68 unsigned int findEmptySpaceLeft(); 72 unsigned int findEmptySpaceLeft();
69 unsigned int findEmptySpaceRight(); 73 unsigned int findEmptySpaceRight();
70 74
@@ -77,7 +81,7 @@ private:
77 const FbTk::Font *m_font; 81 const FbTk::Font *m_font;
78 BiDiString m_text; 82 BiDiString m_text;
79 GC m_gc; 83 GC m_gc;
80 std::string::size_type m_cursor_pos, m_start_pos, m_end_pos; 84 std::string::size_type m_cursor_pos, m_start_pos, m_end_pos, m_select_pos;
81}; 85};
82 86
83} // end namespace FbTk 87} // end namespace FbTk