X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd41ef6f518a4b76a4416f25cce062e305b3272e..42ed9e53adbb0ec00b967270f072e39f3b998cd3:/src/stc/stc.h.in?ds=sidebyside diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index e4b3a05406..63fb35a307 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -12,7 +12,6 @@ // Author: Robin Dunn // // Created: 13-Jan-2000 -// RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -299,8 +298,8 @@ public: } virtual void Replace(long from, long to, const wxString& text) { - SetTargetStart(from); - SetTargetEnd(to); + SetTargetStart((int)from); + SetTargetEnd((int)to); ReplaceTarget(text); } @@ -319,7 +318,10 @@ public: */ - virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); } + virtual void SetInsertionPoint(long pos) + { + SetCurrentPos(int(pos == -1 ? GetLastPosition() : pos)); + } virtual long GetInsertionPoint() const { return GetCurrentPos(); } virtual long GetLastPosition() const { return GetTextLength(); } @@ -331,8 +333,8 @@ public: } else { - SetSelectionStart(from); - SetSelectionEnd(to); + SetSelectionStart((int)from); + SetSelectionEnd((int)to); } } @@ -358,9 +360,9 @@ public: long f, t; GetSelection(&f, &t); if ( from ) - *from = f; + *from = (int)f; if ( to ) - *to = t; + *to = (int)t; } #endif @@ -370,7 +372,7 @@ public: // implement wxTextAreaBase pure virtual methods // --------------------------------------------- - virtual int GetLineLength(long n) const { return GetLine(n).length(); } + virtual int GetLineLength(long lineNo) const { return static_cast(GetLineText(lineNo).length()); } virtual wxString GetLineText(long lineNo) const { wxString text = GetLine(static_cast(lineNo)); @@ -412,14 +414,14 @@ public: virtual long XYToPosition(long x, long y) const { - long pos = PositionFromLine(y); + long pos = PositionFromLine((int)y); pos += x; return pos; } virtual bool PositionToXY(long pos, long *x, long *y) const { - long l = LineFromPosition(pos); + int l = LineFromPosition((int)pos); if ( l == -1 ) return false; @@ -432,7 +434,7 @@ public: return true; } - virtual void ShowPosition(long pos) { GotoPos(pos); } + virtual void ShowPosition(long pos) { GotoPos((int)pos); } // FIXME-VC6: can't use wxWindow here because of "error C2603: illegal // access declaration: 'wxWindow' is not a direct base of