From ea1edb5a4a12fe2cb3180ce85451350e81ab22b4 Mon Sep 17 00:00:00 2001 From: PeterAddy960 Date: Fri, 28 Oct 2016 00:07:33 -0500 Subject: [PATCH] Added a clear undo method. Added an overload to selected to get the selection bounds. Added an overload to the getline method to allow an offset from the beginning of the line. --- include/nana/gui/widgets/textbox.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/nana/gui/widgets/textbox.hpp b/include/nana/gui/widgets/textbox.hpp index 12008c37..c74fac54 100644 --- a/include/nana/gui/widgets/textbox.hpp +++ b/include/nana/gui/widgets/textbox.hpp @@ -162,6 +162,9 @@ namespace nana /// Read the text from a specified line. It returns true for success. bool getline(std::size_t pos, std::string&) const; + /// Read the text from a specified line with a set offset. It returns true for success. + bool getline(std::size_t line_index,std::size_t offset,std::string& text) const; + /// Gets the caret position /// Returns true if the caret is in the area of display, false otherwise. bool caret_pos(point& pos, bool text_coordinate) const; @@ -193,6 +196,7 @@ namespace nana /// Returns true if some text is selected. bool selected() const; + bool selected(nana::upoint &a,nana::upoint &b) const; /// Selects/unselects all text. void select(bool); @@ -206,6 +210,8 @@ namespace nana textbox& from(int); textbox& from(double); + void clear_undo(); + void set_highlight(const std::string& name, const ::nana::color& fgcolor, const ::nana::color& bgcolor); void erase_highlight(const std::string& name); void set_keywords(const std::string& name, bool case_sensitive, bool whole_word_match, std::initializer_list kw_list);