]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/textentry.h
Document wxKill(wxSIGTERM) reliance on having an open window in wxMSW.
[wxWidgets.git] / include / wx / gtk / textentry.h
CommitLineData
0ec1179b
VZ
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
1eb194bf 14typedef struct _GdkEventKey GdkEventKey;
0ec1179b 15typedef struct _GtkEditable GtkEditable;
0847e36e 16typedef struct _GtkEntry GtkEntry;
0ec1179b
VZ
17
18// ----------------------------------------------------------------------------
19// wxTextEntry: roughly corresponds to GtkEditable
20// ----------------------------------------------------------------------------
21
22class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
23{
24public:
25 wxTextEntry() { }
26
27 // implement wxTextEntryBase pure virtual methods
28 virtual void WriteText(const wxString& text);
0ec1179b
VZ
29 virtual void Remove(long from, long to);
30
31 virtual void Copy();
32 virtual void Cut();
33 virtual void Paste();
34
35 virtual void Undo();
36 virtual void Redo();
37 virtual bool CanUndo() const;
38 virtual bool CanRedo() const;
39
40 virtual void SetInsertionPoint(long pos);
41 virtual long GetInsertionPoint() const;
42 virtual long GetLastPosition() const;
43
44 virtual void SetSelection(long from, long to);
45 virtual void GetSelection(long *from, long *to) const;
46
0ec1179b
VZ
47 virtual bool IsEditable() const;
48 virtual void SetEditable(bool editable);
49
0ec1179b
VZ
50 virtual void SetMaxLength(unsigned long len);
51
0ec1179b
VZ
52 // implementation only from now on
53 void SendMaxLenEvent();
b2c35774 54 bool GTKEntryOnInsertText(const char* text);
0ec1179b 55
135b23b2 56protected:
10434560
VZ
57 // This method must be called from the derived class Create() to connect
58 // the handlers for the clipboard (cut/copy/paste) events.
59 void GTKConnectClipboardSignals(GtkWidget* entry);
60
b2c35774
VZ
61 // And this one to connect "insert-text" signal.
62 void GTKConnectInsertTextSignal(GtkEntry* entry);
63
64
75377698 65 virtual void DoSetValue(const wxString& value, int flags);
135b23b2
VZ
66 virtual wxString DoGetValue() const;
67
0847e36e
JS
68 // margins functions
69 virtual bool DoSetMargins(const wxPoint& pt);
70 virtual wxPoint DoGetMargins() const;
71
574479e8
VZ
72 virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
73
b2c35774
VZ
74 // Override the base class method to use GtkEntry IM context.
75 virtual int GTKIMFilterKeypress(GdkEventKey* event) const;
76
0ec1179b 77private:
0ec1179b
VZ
78 // implement this to return the associated GtkEntry or another widget
79 // implementing GtkEditable
80 virtual GtkEditable *GetEditable() const = 0;
0847e36e
JS
81
82 // implement this to return the associated GtkEntry
83 virtual GtkEntry *GetEntry() const = 0;
0ec1179b
VZ
84};
85
86#endif // _WX_GTK_TEXTENTRY_H_
87