]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/textentry.h
Increase version to 2.9.5.
[wxWidgets.git] / include / wx / msw / textentry.h
CommitLineData
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
14class wxTextAutoCompleteData; // private class used only by wxTextEntry itself
15
6c09235c
RD
16// ----------------------------------------------------------------------------
17// wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
18// ----------------------------------------------------------------------------
19
20class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
21{
22public:
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 57protected:
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);
03dede4d 78 virtual bool DoAutoCompleteFileNames(int flags);
ea98f11c 79 virtual bool DoAutoCompleteCustom(wxTextCompleter *completer);
574479e8
VZ
80#endif // wxUSE_OLE
81
6c09235c
RD
82private:
83 // implement this to return the HWND of the EDIT control
84 virtual WXHWND GetEditHWND() const = 0;
68e6eb7d
VZ
85
86#if wxUSE_OLE
ea98f11c
VZ
87 // Get the auto-complete object creating it if necessary. Returns NULL if
88 // creating it failed.
89 wxTextAutoCompleteData *GetOrCreateCompleter();
90
91 // Various auto-completion-related stuff, only used if any of AutoComplete()
92 // methods are called. Use the function above to access it.
93 wxTextAutoCompleteData *m_autoCompleteData;
94
95 // It needs to call our GetEditableWindow() and GetEditHWND() methods.
96 friend class wxTextAutoCompleteData;
68e6eb7d 97#endif // wxUSE_OLE
6c09235c
RD
98};
99
100#endif // _WX_MSW_TEXTENTRY_H_
101