]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/textentry.h
use wxTextEntry in wxTextValidator (modified patch 1821743)
[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
45 virtual bool IsEditable() const;\r
46 virtual void SetEditable(bool editable);\r
47\r
48 virtual void SetMaxLength(unsigned long len);\r
49\r
50protected:\r
51 // this is really a hook for multiline text controls as the single line\r
52 // ones don't need to ever scroll to show the selection but having it here\r
53 // allows us to put Remove() in the base class\r
54 enum\r
55 {\r
56 SetSel_NoScroll = 0, // don't do anything special\r
57 SetSel_Scroll = 1 // default: scroll to make the selection visible\r
58 };\r
59 virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll);\r
60\r
61private:\r
62 // implement this to return the HWND of the EDIT control\r
63 virtual WXHWND GetEditHWND() const = 0;\r
64};\r
65\r
66#endif // _WX_MSW_TEXTENTRY_H_\r
67\r