// Returns the current UseAntiAliasing setting.
bool GetUseAntiAliasing();
+ // Clear annotations from the given line.
+ void AnnotationClearLine(int line);
+
// The following methods are nearly equivalent to their similarly named
// implement wxTextEntryBase pure virtual methods
// ----------------------------------------------
- virtual void WriteText(const wxString& text) { AddText(text); }
+ virtual void WriteText(const wxString& text)
+ {
+ ReplaceSelection(text);
+ }
+
virtual void Remove(long from, long to)
{
Replace(from, to, "");
}
virtual void Replace(long from, long to, const wxString& text)
{
- SetTargetStart(from);
- SetTargetEnd(to);
+ SetTargetStart((int)from);
+ SetTargetEnd((int)to);
ReplaceTarget(text);
}
*/
- 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(); }
}
else
{
- SetSelectionStart(from);
- SetSelectionEnd(to);
+ SetSelectionStart((int)from);
+ SetSelectionEnd((int)to);
}
}
+ virtual void SelectNone()
+ {
+ ClearSelections();
+ }
+
#ifdef SWIG
void GetSelection(long* OUTPUT, long* OUTPUT) const;
#else
long f, t;
GetSelection(&f, &t);
if ( from )
- *from = f;
+ *from = (int)f;
if ( to )
- *to = t;
+ *to = (int)t;
}
#endif
// implement wxTextAreaBase pure virtual methods
// ---------------------------------------------
- virtual int GetLineLength(long n) const { return GetLine(n).length(); }
- virtual wxString GetLineText(long n) const { return GetLine(n); }
+ virtual int GetLineLength(long lineNo) const { return static_cast<int>(GetLineText(lineNo).length()); }
+ virtual wxString GetLineText(long lineNo) const
+ {
+ wxString text = GetLine(static_cast<int>(lineNo));
+ size_t lastNewLine = text.find_last_not_of(wxS("\r\n"));
+
+ if ( lastNewLine != wxString::npos )
+ text.erase(lastNewLine + 1); // remove trailing cr+lf
+ else
+ text.clear();
+ return text;
+ }
virtual int GetNumberOfLines() const { return GetLineCount(); }
virtual bool IsModified() const { return GetModify(); }
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;
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
static wxVersionInfo GetLibraryVersionInfo();
protected:
+ virtual void DoSetValue(const wxString& value, int flags);
virtual wxString DoGetValue() const { return GetText(); }
virtual wxWindow *GetEditableWindow() { return this; }