1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/textentry.h
3 // Purpose: wxMSW-specific wxTextEntry implementation
4 // Author: Vadim Zeitlin
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 // ----------------------------------------------------------------------------
15 // wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxTextEntry
: public wxTextEntryBase
28 // implement wxTextEntryBase pure virtual methods
29 virtual void WriteText(const wxString
& text
);
30 virtual void Remove(long from
, long to
);
38 virtual bool CanUndo() const;
39 virtual bool CanRedo() const;
41 virtual void SetInsertionPoint(long pos
);
42 virtual long GetInsertionPoint() const;
43 virtual long GetLastPosition() const;
45 virtual void SetSelection(long from
, long to
)
46 { DoSetSelection(from
, to
); }
47 virtual void GetSelection(long *from
, long *to
) const;
49 // auto-completion uses COM under Windows so they won't work without
50 // wxUSE_OLE as OleInitialize() is not called then
52 virtual bool AutoComplete(const wxArrayString
& choices
);
53 virtual bool AutoCompleteFileNames();
56 virtual bool IsEditable() const;
57 virtual void SetEditable(bool editable
);
59 virtual void SetMaxLength(unsigned long len
);
62 virtual bool SetHint(const wxString
& hint
);
63 virtual wxString
GetHint() const;
64 #endif // wxUSE_UXTHEME
67 virtual wxString
DoGetValue() const;
69 // this is really a hook for multiline text controls as the single line
70 // ones don't need to ever scroll to show the selection but having it here
71 // allows us to put Remove() in the base class
74 SetSel_NoScroll
= 0, // don't do anything special
75 SetSel_Scroll
= 1 // default: scroll to make the selection visible
77 virtual void DoSetSelection(long from
, long to
, int flags
= SetSel_Scroll
);
80 virtual bool DoSetMargins(const wxPoint
& pt
);
81 virtual wxPoint
DoGetMargins() const;
84 // implement this to return the HWND of the EDIT control
85 virtual WXHWND
GetEditHWND() const = 0;
88 // enumerator for strings currently used for auto-completion or NULL
89 class wxIEnumString
*m_enumStrings
;
93 #endif // _WX_MSW_TEXTENTRY_H_