+ // Set the vertical scrollbar to use instead of the ont that's built-in.
+ void SetVScrollBar(wxScrollBar* bar);
+
+
+ // Set the horizontal scrollbar to use instead of the ont that's built-in.
+ void SetHScrollBar(wxScrollBar* bar);
+
+ // Can be used to prevent the EVT_CHAR handler from adding the char
+ bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; }
+ void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; }
+
+ // if we derive from wxTextAreaBase it already provides these methods
+#if !wxUSE_TEXTCTRL
+ // Write the contents of the editor to filename
+ bool SaveFile(const wxString& filename);
+
+ // Load the contents of filename into the editor
+ bool LoadFile(const wxString& filename);
+#endif // !wxUSE_TEXTCTRL
+
+#ifdef STC_USE_DND
+ // Allow for simulating a DnD DragOver
+ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
+
+ // Allow for simulating a DnD DropText
+ bool DoDropText(long x, long y, const wxString& data);
+#endif
+
+ // Specify whether anti-aliased fonts should be used. Will have no effect
+ // on some platforms, but on some (wxMac for example) can greatly improve
+ // performance.
+ void SetUseAntiAliasing(bool useAA);
+
+ // 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
+ // cousins above. The difference is that these methods bypass wxString
+ // and always use a char* even if used in a unicode build of wxWidgets.
+ // In that case the character data will be utf-8 encoded since that is
+ // what is used internally by Scintilla in unicode builds.
+
+ // Add text to the document at current position.
+ void AddTextRaw(const char* text, int length=-1);
+
+ // Insert string at a position.
+ void InsertTextRaw(int pos, const char* text);
+
+ // Retrieve the text of the line containing the caret.
+ // Returns the index of the caret on the line.
+#ifdef SWIG
+ wxCharBuffer GetCurLineRaw(int* OUTPUT);
+#else
+ wxCharBuffer GetCurLineRaw(int* linePos=NULL);
+#endif
+
+ // Retrieve the contents of a line.
+ wxCharBuffer GetLineRaw(int line);
+
+ // Retrieve the selected text.
+ wxCharBuffer GetSelectedTextRaw();
+
+ // Retrieve a range of text.
+ wxCharBuffer GetTextRangeRaw(int startPos, int endPos);
+
+ // Replace the contents of the document with the argument text.
+ void SetTextRaw(const char* text);
+
+ // Retrieve all the text in the document.
+ wxCharBuffer GetTextRaw();
+
+ // Append a string to the end of the document without changing the selection.
+ void AppendTextRaw(const char* text, int length=-1);
+
+#ifdef SWIG
+ %%pythoncode "_stc_utf8_methods.py"
+#endif
+
+
+ // implement wxTextEntryBase pure virtual methods
+ // ----------------------------------------------
+
+ 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);
+ ReplaceTarget(text);
+ }
+
+ /*
+ These functions are already declared in the generated section.
+
+ virtual void Copy();
+ virtual void Cut();
+ virtual void Paste();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual bool CanUndo() const;
+ virtual bool CanRedo() const;
+
+ */
+
+ virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); }
+ virtual long GetInsertionPoint() const { return GetCurrentPos(); }
+ virtual long GetLastPosition() const { return GetTextLength(); }
+
+ virtual void SetSelection(long from, long to)
+ {
+ if ( from == -1 && to == -1 )
+ {
+ SelectAll();
+ }
+ else
+ {
+ SetSelectionStart(from);
+ SetSelectionEnd(to);
+ }
+ }
+
+ virtual void SelectNone()
+ {
+ ClearSelections();
+ }
+
+#ifdef SWIG
+ void GetSelection(long* OUTPUT, long* OUTPUT) const;
+#else
+ virtual void GetSelection(long *from, long *to) const
+ {
+ if ( from )
+ *from = GetSelectionStart();
+ if ( to )
+ *to = GetSelectionEnd();
+ }
+
+ // kept for compatibility only
+ void GetSelection(int *from, int *to)
+ {
+ long f, t;
+ GetSelection(&f, &t);
+ if ( from )
+ *from = f;
+ if ( to )
+ *to = t;
+ }
+#endif
+
+ virtual bool IsEditable() const { return !GetReadOnly(); }
+ virtual void SetEditable(bool editable) { SetReadOnly(!editable); }
+
+ // implement wxTextAreaBase pure virtual methods
+ // ---------------------------------------------
+
+ 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 void MarkDirty() { wxFAIL_MSG("not implemented"); }
+ virtual void DiscardEdits() { SetSavePoint(); }
+
+ virtual bool SetStyle(long WXUNUSED(start), long WXUNUSED(end),
+ const wxTextAttr& WXUNUSED(style))
+ {
+ wxFAIL_MSG("not implemented");
+
+ return false;
+ }
+
+ virtual bool GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
+ {
+ wxFAIL_MSG("not implemented");
+
+ return false;
+ }
+
+ virtual bool SetDefaultStyle(const wxTextAttr& WXUNUSED(style))
+ {
+ wxFAIL_MSG("not implemented");
+
+ return false;
+ }
+
+ virtual long XYToPosition(long x, long y) const
+ {
+ long pos = PositionFromLine(y);
+ pos += x;
+ return pos;
+ }
+
+ virtual bool PositionToXY(long pos, long *x, long *y) const
+ {
+ long l = LineFromPosition(pos);
+ if ( l == -1 )
+ return false;
+
+ if ( x )
+ *x = pos - PositionFromLine(l);
+
+ if ( y )
+ *y = l;
+
+ return true;
+ }
+
+ virtual void ShowPosition(long pos) { GotoPos(pos); }
+
+ // FIXME-VC6: can't use wxWindow here because of "error C2603: illegal
+ // access declaration: 'wxWindow' is not a direct base of
+ // 'wxStyledTextCtrl'" with VC6
+ using wxControl::HitTest;
+
+ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const
+ {
+ const long l = PositionFromPoint(pt);
+ if ( l == -1 )
+ return wxTE_HT_BELOW; // we don't really know where it was
+
+ if ( pos )
+ *pos = l;
+
+ return wxTE_HT_ON_TEXT;
+ }
+
+ // just unhide it
+ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
+ wxTextCoord *col,
+ wxTextCoord *row) const
+ {
+ return wxTextAreaBase::HitTest(pt, col, row);
+ }
+
+ static wxVersionInfo GetLibraryVersionInfo();
+
+protected:
+ virtual void DoSetValue(const wxString& value, int flags);
+ virtual wxString DoGetValue() const { return GetText(); }
+ virtual wxWindow *GetEditableWindow() { return this; }