]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/textentry.h
reuse wxObjectRefData for various ref-counted classes (closes #10886)
[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
7bc7db45 6// RCS-ID: $Id$
6c09235c
RD
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
18class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
19{
20public:
21 wxTextEntry() { }
22
23 // implement wxTextEntryBase pure virtual methods
24 virtual void WriteText(const wxString& text);
6c09235c
RD
25 virtual void Remove(long from, long to);
26
27 virtual void Copy();
28 virtual void Cut();
29 virtual void Paste();
30
31 virtual void Undo();
32 virtual void Redo();
33 virtual bool CanUndo() const;
34 virtual bool CanRedo() const;
35
36 virtual void SetInsertionPoint(long pos);
37 virtual long GetInsertionPoint() const;
38 virtual long GetLastPosition() const;
39
40 virtual void SetSelection(long from, long to)
41 { DoSetSelection(from, to); }
42 virtual void GetSelection(long *from, long *to) const;
43
44 // auto-completion uses COM under Windows so they won't work without
45 // wxUSE_OLE as OleInitialize() is not called then
46#if wxUSE_OLE
47 virtual bool AutoComplete(const wxArrayString& choices);
48 virtual bool AutoCompleteFileNames();
49#endif // wxUSE_OLE
50
51 virtual bool IsEditable() const;
52 virtual void SetEditable(bool editable);
53
54 virtual void SetMaxLength(unsigned long len);
55
63f7d502
VZ
56#if wxUSE_UXTHEME
57 virtual bool SetHint(const wxString& hint);
58 virtual wxString GetHint() const;
59#endif // wxUSE_UXTHEME
60
6c09235c 61protected:
135b23b2
VZ
62 virtual wxString DoGetValue() const;
63
6c09235c
RD
64 // this is really a hook for multiline text controls as the single line
65 // ones don't need to ever scroll to show the selection but having it here
66 // allows us to put Remove() in the base class
67 enum
68 {
69 SetSel_NoScroll = 0, // don't do anything special
70 SetSel_Scroll = 1 // default: scroll to make the selection visible
71 };
72 virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll);
73
74private:
75 // implement this to return the HWND of the EDIT control
76 virtual WXHWND GetEditHWND() const = 0;
77};
78
79#endif // _WX_MSW_TEXTENTRY_H_
80