fix bug that textbox::caret_pos() doesn't move the caret
This commit is contained in:
@@ -149,12 +149,13 @@ namespace nana{ namespace widgets
|
||||
void text(std::wstring, bool end_caret);
|
||||
std::wstring text() const;
|
||||
|
||||
/// Sets caret position through text coordinate.
|
||||
/// Moves the caret at specified position
|
||||
/**
|
||||
* @param pos the text position
|
||||
* @param reset indicates whether to reset the text position by the pos. If this parameter is true, the text position is set by pos. If the parameter is false, it only moves the UI caret to the specified position.
|
||||
* @param stay_in_view Indicates whether to adjust the view to make the caret in view. This parameter is ignored if the caret is already in view.
|
||||
* @return true indicates a refresh is required.
|
||||
*/
|
||||
bool move_caret(const upoint& pos, bool reset = false);
|
||||
bool move_caret(upoint pos, bool stay_in_view = false);
|
||||
void move_caret_end(bool update);
|
||||
void reset_caret_pixels() const;
|
||||
void reset_caret(bool stay_in_view = false);
|
||||
|
||||
@@ -175,6 +175,9 @@ namespace nana
|
||||
/// Returns true if the caret is in the area of display, false otherwise.
|
||||
bool caret_pos(point& pos, bool text_coordinate) const;
|
||||
|
||||
/// Gets the caret position, in text coordinate
|
||||
upoint caret_pos() const;
|
||||
|
||||
/// Sets the caret position with a text position
|
||||
textbox& caret_pos(const upoint&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user