Extend FindText() to return end position of matched text in wxSTC

New 5th parameter of FindText() can be used to receive the end position of matched text returned by SCI_FINDTEXT API.

Closes #17305.
Closes https://github.com/wxWidgets/wxWidgets/pull/23
This commit is contained in:
New Pagodi
2017-03-13 20:21:41 +01:00
committed by Artur Wieczorek
parent 187c4692c8
commit 91a2869b0e
6 changed files with 64 additions and 15 deletions

View File

@@ -3091,10 +3091,32 @@ public:
/**
Find some text in the document.
The fourth argument should be a bit list containing one or more of the
@link wxStyledTextCtrl::wxSTC_FIND_WHOLEWORD wxSTC_FIND_* @endlink constants.
@param minPos
The position (starting from zero) in the document at which to begin
the search
@param maxPos
The last position (starting from zero) in the document to which
the search will be restricted.
@param text
The text to search for.
@param flags
(Optional) The search flags. This should be a bit list containing
one or more of the @link wxStyledTextCtrl::wxSTC_FIND_WHOLEWORD
wxSTC_FIND_* @endlink constants.
@param findEnd
(Optional) This parameter can optionally be used to receive the
end position (starting from zero) of the found text. This is
primarily needed when searching using regular expressions.
This parameter is available since wxWidgets 3.1.1.
@return
The position (starting from zero) in the document at which the text
was found or wxSTC_INVALID_POSITION if the search fails.
@remarks
A backwards search can be performed by setting minPos to be greater
than maxPos.
*/
int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
int FindText(int minPos, int maxPos, const wxString& text, int flags=0,
int* findEnd=NULL);
/**
Sets the position that starts the target which is used for updating the