Implement XYToPosition() for single-line wxTextCtrl (wxGTK)
This commit is contained in:
@@ -162,6 +162,7 @@ wxGTK:
|
|||||||
- Fix wxMemoryDC::Blit() with itself as source (GTK+ 3).
|
- Fix wxMemoryDC::Blit() with itself as source (GTK+ 3).
|
||||||
- Fix displaying labels of wxRadioBox items.
|
- Fix displaying labels of wxRadioBox items.
|
||||||
- Add a native implementation for clearing bitmap/window wxGraphicsContexts
|
- Add a native implementation for clearing bitmap/window wxGraphicsContexts
|
||||||
|
- Implement XYToPosition() for single-line wxTextCtrl.
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -1224,7 +1224,12 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
|||||||
long wxTextCtrl::XYToPosition(long x, long y ) const
|
long wxTextCtrl::XYToPosition(long x, long y ) const
|
||||||
{
|
{
|
||||||
if ( IsSingleLine() )
|
if ( IsSingleLine() )
|
||||||
return 0;
|
{
|
||||||
|
if ( y != 0 || x >= gtk_entry_get_text_length(GTK_ENTRY(m_text)) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
GtkTextIter iter;
|
GtkTextIter iter;
|
||||||
if (y >= gtk_text_buffer_get_line_count (m_buffer))
|
if (y >= gtk_text_buffer_get_line_count (m_buffer))
|
||||||
|
Reference in New Issue
Block a user