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