1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/textentry.h
3 // Purpose: wxTextEntry class
4 // Author: Stefan Csomor
5 // Modified by: Kevin Ollivier
7 // RCS-ID: $Id: textctrl.h 62531 2009-11-01 00:58:04Z KO $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OSX_TEXTENTRY_H_
13 #define _WX_OSX_TEXTENTRY_H_
15 #if wxUSE_SYSTEM_OPTIONS
16 // set this to 'true' if you want to use the 'classic' MLTE-based implementation
17 // instead of the HIView-based implementation in 10.3 and upwards, the former
18 // has more features (backgrounds etc.), but may show redraw artefacts and other
19 // problems depending on your usage; hence, the default is 'false'.
20 #define wxMAC_TEXTCONTROL_USE_MLTE wxT("mac.textcontrol-use-mlte")
21 // set this to 'true' if you want editable text controls to have spell checking turned
22 // on by default, you can change this setting individually on a control using MacCheckSpelling
23 #define wxMAC_TEXTCONTROL_USE_SPELL_CHECKER wxT("mac.textcontrol-use-spell-checker")
26 #include "wx/control.h"
28 // forward decl for wxListWidgetImpl implementation type.
29 class WXDLLIMPEXP_FWD_CORE wxTextWidgetImpl
;
31 class WXDLLIMPEXP_CORE wxTextEntry
: public wxTextEntryBase
38 virtual ~wxTextEntry() {};
40 virtual bool IsEditable() const;
42 // If the return values from and to are the same, there is no selection.
43 virtual void GetSelection(long* from
, long* to
) const;
50 virtual void Remove(long from
, long to
);
52 // set the max number of characters which may be entered
53 // in a single line text control
54 virtual void SetMaxLength(unsigned long len
);
56 // writing text inserts it at the current position;
57 // appending always inserts it at the end
58 virtual void WriteText(const wxString
& text
);
60 // Clipboard operations
65 virtual bool CanCopy() const;
66 virtual bool CanCut() const;
67 virtual bool CanPaste() const;
73 virtual bool CanUndo() const;
74 virtual bool CanRedo() const;
77 virtual void SetInsertionPoint(long pos
);
78 virtual void SetInsertionPointEnd();
79 virtual long GetInsertionPoint() const;
80 virtual wxTextPos
GetLastPosition() const;
82 virtual void SetSelection(long from
, long to
);
83 virtual void SetEditable(bool editable
);
88 virtual wxTextWidgetImpl
* GetTextPeer() const;
91 virtual wxString
DoGetValue() const;
95 // need to make this public because of the current implementation via callbacks
96 unsigned long m_maxLength
;
98 virtual void EnableTextChangedEvents(bool enable
)
100 m_triggerUpdateEvents
= enable
;
103 bool m_triggerUpdateEvents
;
107 #endif // _WX_OSX_TEXTENTRY_H_