1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/textentry.h
3 // Purpose: wxMSW-specific wxTextEntry implementation
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_MSW_TEXTENTRY_H_
11 #define _WX_MSW_TEXTENTRY_H_
13 class wxTextAutoCompleteData
; // private class used only by wxTextEntry itself
15 // ----------------------------------------------------------------------------
16 // wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxTextEntry
: public wxTextEntryBase
23 virtual ~wxTextEntry();
25 // implement wxTextEntryBase pure virtual methods
26 virtual void WriteText(const wxString
& text
);
27 virtual void Remove(long from
, long to
);
35 virtual bool CanUndo() const;
36 virtual bool CanRedo() const;
38 virtual void SetInsertionPoint(long pos
);
39 virtual long GetInsertionPoint() const;
40 virtual long GetLastPosition() const;
42 virtual void SetSelection(long from
, long to
)
43 { DoSetSelection(from
, to
); }
44 virtual void GetSelection(long *from
, long *to
) const;
46 virtual bool IsEditable() const;
47 virtual void SetEditable(bool editable
);
49 virtual void SetMaxLength(unsigned long len
);
52 virtual bool SetHint(const wxString
& hint
);
53 virtual wxString
GetHint() const;
54 #endif // wxUSE_UXTHEME
57 virtual wxString
DoGetValue() const;
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
64 SetSel_NoScroll
= 0, // don't do anything special
65 SetSel_Scroll
= 1 // default: scroll to make the selection visible
67 virtual void DoSetSelection(long from
, long to
, int flags
= SetSel_Scroll
);
70 virtual bool DoSetMargins(const wxPoint
& pt
);
71 virtual wxPoint
DoGetMargins() const;
73 // auto-completion uses COM under Windows so they won't work without
74 // wxUSE_OLE as OleInitialize() is not called then
76 virtual bool DoAutoCompleteStrings(const wxArrayString
& choices
);
77 #if wxUSE_DYNLIB_CLASS
78 virtual bool DoAutoCompleteFileNames(int flags
);
79 #endif // wxUSE_DYNLIB_CLASS
80 virtual bool DoAutoCompleteCustom(wxTextCompleter
*completer
);
84 // implement this to return the HWND of the EDIT control
85 virtual WXHWND
GetEditHWND() const = 0;
88 // Get the auto-complete object creating it if necessary. Returns NULL if
89 // creating it failed.
90 wxTextAutoCompleteData
*GetOrCreateCompleter();
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
;
96 // It needs to call our GetEditableWindow() and GetEditHWND() methods.
97 friend class wxTextAutoCompleteData
;
101 #endif // _WX_MSW_TEXTENTRY_H_