Add wxTextCtrl::PositionToCoords() functions for wxMSW and wxGTK.

The new method allows to find the coordinates in pixels of the given character
in a text control.

Closes #13221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-07-29 15:11:54 +00:00
parent d298f18ffb
commit 6ce832135e
10 changed files with 304 additions and 0 deletions

View File

@@ -1348,6 +1348,28 @@ public:
*/
virtual bool PositionToXY(long pos, long* x, long* y) const;
/**
Converts given text position to client coordinates in pixels.
This function allows to find where is the character at the given
position displayed in the text control.
@onlyfor{wxmsw,wxgtk}. Additionally, wxGTK only implements this method
for multiline controls and ::wxDefaultPosition is always returned for
the single line ones.
@param pos
Text position in 0 to GetLastPosition() range (inclusive).
@return
On success returns a wxPoint which contains client coordinates for
the given position in pixels, otherwise returns ::wxDefaultPosition.
@since 2.9.3
@see XYToPosition(), PositionToXY()
*/
wxPoint PositionToCoords(long pos) const;
/**
Saves the contents of the control in a text file.