1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/textentry.h
3 // Purpose: wxTextEntry class
4 // Author: Stefan Csomor
5 // Modified by: Kevin Ollivier
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_OSX_TEXTENTRY_H_
12 #define _WX_OSX_TEXTENTRY_H_
14 #if wxUSE_SYSTEM_OPTIONS
15 // set this to 'true' if you want to use the 'classic' MLTE-based implementation
16 // instead of the HIView-based implementation in 10.3 and upwards, the former
17 // has more features (backgrounds etc.), but may show redraw artefacts and other
18 // problems depending on your usage; hence, the default is 'false'.
19 #define wxMAC_TEXTCONTROL_USE_MLTE wxT("mac.textcontrol-use-mlte")
20 // set this to 'true' if you want editable text controls to have spell checking turned
21 // on by default, you can change this setting individually on a control using MacCheckSpelling
22 #define wxMAC_TEXTCONTROL_USE_SPELL_CHECKER wxT("mac.textcontrol-use-spell-checker")
25 #include "wx/control.h"
27 // forward decl for wxListWidgetImpl implementation type.
28 class WXDLLIMPEXP_FWD_CORE wxTextWidgetImpl
;
30 class WXDLLIMPEXP_CORE wxTextEntry
: public wxTextEntryBase
35 virtual ~wxTextEntry();
37 virtual bool IsEditable() const;
39 // If the return values from and to are the same, there is no selection.
40 virtual void GetSelection(long* from
, long* to
) const;
47 virtual void Remove(long from
, long to
);
49 // set the max number of characters which may be entered
50 // in a single line text control
51 virtual void SetMaxLength(unsigned long len
);
53 // writing text inserts it at the current position;
54 // appending always inserts it at the end
55 virtual void WriteText(const wxString
& text
);
57 // Clipboard operations
62 virtual bool CanCopy() const;
63 virtual bool CanCut() const;
64 virtual bool CanPaste() const;
70 virtual bool CanUndo() const;
71 virtual bool CanRedo() const;
74 virtual void SetInsertionPoint(long pos
);
75 virtual void SetInsertionPointEnd();
76 virtual long GetInsertionPoint() const;
77 virtual wxTextPos
GetLastPosition() const;
79 virtual void SetSelection(long from
, long to
);
80 virtual void SetEditable(bool editable
);
82 virtual bool SendMaxLenEvent();
87 virtual wxTextWidgetImpl
* GetTextPeer() const;
88 wxTextCompleter
*OSXGetCompleter() const { return m_completer
; }
92 virtual wxString
DoGetValue() const;
94 virtual bool DoAutoCompleteStrings(const wxArrayString
& choices
);
95 virtual bool DoAutoCompleteCustom(wxTextCompleter
*completer
);
97 // The object providing auto-completions or NULL if none.
98 wxTextCompleter
*m_completer
;
102 // need to make this public because of the current implementation via callbacks
103 unsigned long m_maxLength
;
107 #endif // _WX_OSX_TEXTENTRY_H_