1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/textentry.h
3 // Purpose: wxGTK-specific wxTextEntry implementation
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_TEXTENTRY_H_
12 #define _WX_GTK_TEXTENTRY_H_
14 typedef struct _GtkEditable GtkEditable
;
15 typedef struct _GtkEntry GtkEntry
;
17 // ----------------------------------------------------------------------------
18 // wxTextEntry: roughly corresponds to GtkEditable
19 // ----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxTextEntry
: public wxTextEntryBase
26 // implement wxTextEntryBase pure virtual methods
27 virtual void WriteText(const wxString
& text
);
28 virtual void Remove(long from
, long to
);
36 virtual bool CanUndo() const;
37 virtual bool CanRedo() const;
39 virtual void SetInsertionPoint(long pos
);
40 virtual long GetInsertionPoint() const;
41 virtual long GetLastPosition() const;
43 virtual void SetSelection(long from
, long to
);
44 virtual void GetSelection(long *from
, long *to
) const;
46 virtual bool IsEditable() const;
47 virtual void SetEditable(bool editable
);
49 virtual void SetMaxLength(unsigned long len
);
51 // implementation only from now on
52 void SendMaxLenEvent();
55 // This method must be called from the derived class Create() to connect
56 // the handlers for the clipboard (cut/copy/paste) events.
57 void GTKConnectClipboardSignals(GtkWidget
* entry
);
59 virtual void DoSetValue(const wxString
& value
, int flags
);
60 virtual wxString
DoGetValue() const;
63 virtual bool DoSetMargins(const wxPoint
& pt
);
64 virtual wxPoint
DoGetMargins() const;
66 virtual bool DoAutoCompleteStrings(const wxArrayString
& choices
);
69 // implement this to return the associated GtkEntry or another widget
70 // implementing GtkEditable
71 virtual GtkEditable
*GetEditable() const = 0;
73 // implement this to return the associated GtkEntry
74 virtual GtkEntry
*GetEntry() const = 0;
77 #endif // _WX_GTK_TEXTENTRY_H_