]>
Commit | Line | Data |
---|---|---|
0ec1179b VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/gtk/textentry.h | |
3 | // Purpose: wxGTK-specific wxTextEntry implementation | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2007-09-24 | |
0ec1179b VZ |
6 | // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org> |
7 | // Licence: wxWindows licence | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_GTK_TEXTENTRY_H_ | |
11 | #define _WX_GTK_TEXTENTRY_H_ | |
12 | ||
1eb194bf | 13 | typedef struct _GdkEventKey GdkEventKey; |
0ec1179b | 14 | typedef struct _GtkEditable GtkEditable; |
0847e36e | 15 | typedef struct _GtkEntry GtkEntry; |
0ec1179b VZ |
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); | |
0ec1179b VZ |
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 | ||
0ec1179b VZ |
46 | virtual bool IsEditable() const; |
47 | virtual void SetEditable(bool editable); | |
48 | ||
0ec1179b VZ |
49 | virtual void SetMaxLength(unsigned long len); |
50 | ||
0ec1179b VZ |
51 | // implementation only from now on |
52 | void SendMaxLenEvent(); | |
b2c35774 | 53 | bool GTKEntryOnInsertText(const char* text); |
0ec1179b | 54 | |
135b23b2 | 55 | protected: |
10434560 VZ |
56 | // This method must be called from the derived class Create() to connect |
57 | // the handlers for the clipboard (cut/copy/paste) events. | |
58 | void GTKConnectClipboardSignals(GtkWidget* entry); | |
59 | ||
b2c35774 VZ |
60 | // And this one to connect "insert-text" signal. |
61 | void GTKConnectInsertTextSignal(GtkEntry* entry); | |
62 | ||
63 | ||
75377698 | 64 | virtual void DoSetValue(const wxString& value, int flags); |
135b23b2 VZ |
65 | virtual wxString DoGetValue() const; |
66 | ||
0847e36e JS |
67 | // margins functions |
68 | virtual bool DoSetMargins(const wxPoint& pt); | |
69 | virtual wxPoint DoGetMargins() const; | |
70 | ||
574479e8 VZ |
71 | virtual bool DoAutoCompleteStrings(const wxArrayString& choices); |
72 | ||
b2c35774 VZ |
73 | // Override the base class method to use GtkEntry IM context. |
74 | virtual int GTKIMFilterKeypress(GdkEventKey* event) const; | |
75 | ||
0ec1179b | 76 | private: |
0ec1179b VZ |
77 | // implement this to return the associated GtkEntry or another widget |
78 | // implementing GtkEditable | |
79 | virtual GtkEditable *GetEditable() const = 0; | |
0847e36e JS |
80 | |
81 | // implement this to return the associated GtkEntry | |
82 | virtual GtkEntry *GetEntry() const = 0; | |
0ec1179b VZ |
83 | }; |
84 | ||
85 | #endif // _WX_GTK_TEXTENTRY_H_ | |
86 |