+ // implement wxTextEntryBase pure virtual methods
+ // ----------------------------------------------
+
+ virtual void WriteText(const wxString& text) { AddText(text); }
+ virtual wxString GetValue() const { return GetText(); }
+ 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);
+ }
+ }
+
+#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); }
+