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