1
///////////////////////////////////////////////////////////////////////////////
2
// Name: wx/msw/textentry.h
3
// Purpose: wxMSW-specific wxTextEntry implementation
4
// Author: Vadim Zeitlin
6
// RCS-ID: $Id: textentry.h 68918 2011-08-27 14:11:13Z VZ $
7
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8
// Licence: wxWindows licence
9
///////////////////////////////////////////////////////////////////////////////
11
#ifndef _WX_MSW_TEXTENTRY_H_
12
#define _WX_MSW_TEXTENTRY_H_
14
class wxTextAutoCompleteData; // private class used only by wxTextEntry itself
16
// ----------------------------------------------------------------------------
17
// wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
18
// ----------------------------------------------------------------------------
20
class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
24
virtual ~wxTextEntry();
26
// implement wxTextEntryBase pure virtual methods
27
virtual void WriteText(const wxString& text);
28
virtual void Remove(long from, long to);
36
virtual bool CanUndo() const;
37
virtual bool CanRedo() const;
39
virtual void SetInsertionPoint(long pos);
40
virtual long GetInsertionPoint() const;
41
virtual long GetLastPosition() const;
43
virtual void SetSelection(long from, long to)
44
{ DoSetSelection(from, to); }
45
virtual void GetSelection(long *from, long *to) const;
47
virtual bool IsEditable() const;
48
virtual void SetEditable(bool editable);
50
virtual void SetMaxLength(unsigned long len);
53
virtual bool SetHint(const wxString& hint);
54
virtual wxString GetHint() const;
55
#endif // wxUSE_UXTHEME
58
virtual wxString DoGetValue() const;
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
65
SetSel_NoScroll = 0, // don't do anything special
66
SetSel_Scroll = 1 // default: scroll to make the selection visible
68
virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll);
71
virtual bool DoSetMargins(const wxPoint& pt);
72
virtual wxPoint DoGetMargins() const;
74
// auto-completion uses COM under Windows so they won't work without
75
// wxUSE_OLE as OleInitialize() is not called then
77
virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
78
virtual bool DoAutoCompleteFileNames(int flags);
79
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer);
83
// implement this to return the HWND of the EDIT control
84
virtual WXHWND GetEditHWND() const = 0;
87
// Get the auto-complete object creating it if necessary. Returns NULL if
88
// creating it failed.
89
wxTextAutoCompleteData *GetOrCreateCompleter();
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;
95
// It needs to call our GetEditableWindow() and GetEditHWND() methods.
96
friend class wxTextAutoCompleteData;
100
#endif // _WX_MSW_TEXTENTRY_H_