Implement XYToPosition() for single-line wxTextCtrl (wxGTK)

This commit is contained in:
Artur Wieczorek
2017-07-29 22:02:58 +02:00
parent bb9c7680ab
commit f208cfc886
2 changed files with 7 additions and 1 deletions

View File

@@ -1224,7 +1224,12 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
long wxTextCtrl::XYToPosition(long x, long y ) const
{
if ( IsSingleLine() )
return 0;
{
if ( y != 0 || x >= gtk_entry_get_text_length(GTK_ENTRY(m_text)) )
return -1;
return x;
}
GtkTextIter iter;
if (y >= gtk_text_buffer_get_line_count (m_buffer))