]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/textentry.h
Fix bug with using invalid date in wxMSW wxCalendarCtrl.
[wxWidgets.git] / include / wx / gtk / textentry.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/textentry.h
3 // Purpose: wxGTK-specific wxTextEntry implementation
4 // Author: Vadim Zeitlin
5 // Created: 2007-09-24
6 // RCS-ID: $Id$
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_GTK_TEXTENTRY_H_
12 #define _WX_GTK_TEXTENTRY_H_
13
14 typedef struct _GtkEditable GtkEditable;
15 typedef struct _GtkEntry GtkEntry;
16
17 // ----------------------------------------------------------------------------
18 // wxTextEntry: roughly corresponds to GtkEditable
19 // ----------------------------------------------------------------------------
20
21 class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
22 {
23 public:
24 wxTextEntry() { }
25
26 // implement wxTextEntryBase pure virtual methods
27 virtual void WriteText(const wxString& text);
28 virtual void Remove(long from, long to);
29
30 virtual void Copy();
31 virtual void Cut();
32 virtual void Paste();
33
34 virtual void Undo();
35 virtual void Redo();
36 virtual bool CanUndo() const;
37 virtual bool CanRedo() const;
38
39 virtual void SetInsertionPoint(long pos);
40 virtual long GetInsertionPoint() const;
41 virtual long GetLastPosition() const;
42
43 virtual void SetSelection(long from, long to);
44 virtual void GetSelection(long *from, long *to) const;
45
46 virtual bool IsEditable() const;
47 virtual void SetEditable(bool editable);
48
49 virtual void SetMaxLength(unsigned long len);
50
51 // implementation only from now on
52 void SendMaxLenEvent();
53
54 protected:
55 virtual void DoSetValue(const wxString& value, int flags);
56 virtual wxString DoGetValue() const;
57
58 // margins functions
59 virtual bool DoSetMargins(const wxPoint& pt);
60 virtual wxPoint DoGetMargins() const;
61
62 virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
63
64 private:
65 // implement this to return the associated GtkEntry or another widget
66 // implementing GtkEditable
67 virtual GtkEditable *GetEditable() const = 0;
68
69 // implement this to return the associated GtkEntry
70 virtual GtkEntry *GetEntry() const = 0;
71 };
72
73 #endif // _WX_GTK_TEXTENTRY_H_
74