added wxTextEntry::SetHint() (a.k.a. cue banner or placeholder string)
[wxWidgets.git] / include / wx / msw / textentry.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/textentry.h
3 // Purpose: wxMSW-specific wxTextEntry implementation
4 // Author: Vadim Zeitlin
5 // Created: 2007-09-26
6 // RCS-ID: $Id: textentry.h 48944 2007-09-26 00:30:22Z VZ $
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
14 // ----------------------------------------------------------------------------
15 // wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
16 // ----------------------------------------------------------------------------
17
18 class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
19 {
20 public:
21 wxTextEntry() { }
22
23 // implement wxTextEntryBase pure virtual methods
24 virtual void WriteText(const wxString& text);
25 virtual wxString GetValue() const;
26 virtual void Remove(long from, long to);
27
28 virtual void Copy();
29 virtual void Cut();
30 virtual void Paste();
31
32 virtual void Undo();
33 virtual void Redo();
34 virtual bool CanUndo() const;
35 virtual bool CanRedo() const;
36
37 virtual void SetInsertionPoint(long pos);
38 virtual long GetInsertionPoint() const;
39 virtual long GetLastPosition() const;
40
41 virtual void SetSelection(long from, long to)
42 { DoSetSelection(from, to); }
43 virtual void GetSelection(long *from, long *to) const;
44
45 // auto-completion uses COM under Windows so they won't work without
46 // wxUSE_OLE as OleInitialize() is not called then
47 #if wxUSE_OLE
48 virtual bool AutoComplete(const wxArrayString& choices);
49 virtual bool AutoCompleteFileNames();
50 #endif // wxUSE_OLE
51
52 virtual bool IsEditable() const;
53 virtual void SetEditable(bool editable);
54
55 virtual void SetMaxLength(unsigned long len);
56
57 #if wxUSE_UXTHEME
58 virtual bool SetHint(const wxString& hint);
59 virtual wxString GetHint() const;
60 #endif // wxUSE_UXTHEME
61
62 protected:
63 // this is really a hook for multiline text controls as the single line
64 // ones don't need to ever scroll to show the selection but having it here
65 // allows us to put Remove() in the base class
66 enum
67 {
68 SetSel_NoScroll = 0, // don't do anything special
69 SetSel_Scroll = 1 // default: scroll to make the selection visible
70 };
71 virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll);
72
73 private:
74 // implement this to return the HWND of the EDIT control
75 virtual WXHWND GetEditHWND() const = 0;
76 };
77
78 #endif // _WX_MSW_TEXTENTRY_H_
79