1. PositionToXY() off-by-2 (!) bug corrected

2. controls sample dumps info about text control when F1 is pressed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-01-28 14:41:44 +00:00
parent 2829d9e3e8
commit 6085b116d6
3 changed files with 73 additions and 12 deletions

View File

@@ -435,7 +435,7 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
{
wxString text = GetValue();
// cast to prevent warning. But pos really should've been unsigned.
// cast to prevent warning. But pos really should've been unsigned.
if( (unsigned long)pos > text.Len() )
return FALSE;
@@ -445,8 +445,8 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
if (pos == 0)
return TRUE;
const char* stop = text.c_str() + pos + 1;
for ( const char *p = text.c_str(); p <= stop; p++ )
const char* stop = text.c_str() + pos;
for ( const char *p = text.c_str(); p < stop; p++ )
{
if (*p == '\n')
{