]>
Commit | Line | Data |
---|---|---|
6c09235c RD |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/msw/textentry.h | |
3 | // Purpose: wxMSW-specific wxTextEntry implementation | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2007-09-26 | |
7bc7db45 | 6 | // RCS-ID: $Id$ |
6c09235c RD |
7 | // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org> |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_MSW_TEXTENTRY_H_ | |
12 | #define _WX_MSW_TEXTENTRY_H_ | |
13 | ||
ea98f11c VZ |
14 | class wxTextAutoCompleteData; // private class used only by wxTextEntry itself |
15 | ||
6c09235c RD |
16 | // ---------------------------------------------------------------------------- |
17 | // wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase | |
21 | { | |
22 | public: | |
ea98f11c VZ |
23 | wxTextEntry(); |
24 | virtual ~wxTextEntry(); | |
6c09235c RD |
25 | |
26 | // implement wxTextEntryBase pure virtual methods | |
27 | virtual void WriteText(const wxString& text); | |
6c09235c RD |
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 | { DoSetSelection(from, to); } | |
45 | virtual void GetSelection(long *from, long *to) const; | |
46 | ||
6c09235c RD |
47 | virtual bool IsEditable() const; |
48 | virtual void SetEditable(bool editable); | |
49 | ||
50 | virtual void SetMaxLength(unsigned long len); | |
51 | ||
63f7d502 VZ |
52 | #if wxUSE_UXTHEME |
53 | virtual bool SetHint(const wxString& hint); | |
54 | virtual wxString GetHint() const; | |
55 | #endif // wxUSE_UXTHEME | |
56 | ||
6c09235c | 57 | protected: |
135b23b2 VZ |
58 | virtual wxString DoGetValue() const; |
59 | ||
6c09235c RD |
60 | // this is really a hook for multiline text controls as the single line |
61 | // ones don't need to ever scroll to show the selection but having it here | |
62 | // allows us to put Remove() in the base class | |
63 | enum | |
64 | { | |
65 | SetSel_NoScroll = 0, // don't do anything special | |
66 | SetSel_Scroll = 1 // default: scroll to make the selection visible | |
67 | }; | |
68 | virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll); | |
69 | ||
0847e36e JS |
70 | // margins functions |
71 | virtual bool DoSetMargins(const wxPoint& pt); | |
72 | virtual wxPoint DoGetMargins() const; | |
73 | ||
574479e8 VZ |
74 | // auto-completion uses COM under Windows so they won't work without |
75 | // wxUSE_OLE as OleInitialize() is not called then | |
76 | #if wxUSE_OLE | |
77 | virtual bool DoAutoCompleteStrings(const wxArrayString& choices); | |
4e3eedde | 78 | #if wxUSE_DYNLIB_CLASS |
03dede4d | 79 | virtual bool DoAutoCompleteFileNames(int flags); |
4e3eedde | 80 | #endif // wxUSE_DYNLIB_CLASS |
ea98f11c | 81 | virtual bool DoAutoCompleteCustom(wxTextCompleter *completer); |
574479e8 VZ |
82 | #endif // wxUSE_OLE |
83 | ||
6c09235c RD |
84 | private: |
85 | // implement this to return the HWND of the EDIT control | |
86 | virtual WXHWND GetEditHWND() const = 0; | |
68e6eb7d VZ |
87 | |
88 | #if wxUSE_OLE | |
ea98f11c VZ |
89 | // Get the auto-complete object creating it if necessary. Returns NULL if |
90 | // creating it failed. | |
91 | wxTextAutoCompleteData *GetOrCreateCompleter(); | |
92 | ||
93 | // Various auto-completion-related stuff, only used if any of AutoComplete() | |
94 | // methods are called. Use the function above to access it. | |
95 | wxTextAutoCompleteData *m_autoCompleteData; | |
96 | ||
97 | // It needs to call our GetEditableWindow() and GetEditHWND() methods. | |
98 | friend class wxTextAutoCompleteData; | |
68e6eb7d | 99 | #endif // wxUSE_OLE |
6c09235c RD |
100 | }; |
101 | ||
102 | #endif // _WX_MSW_TEXTENTRY_H_ | |
103 |