]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/textentry_osx.cpp
add src/common/affinematrix2d.cpp to OpenVMS makefiles
[wxWidgets.git] / src / osx / textentry_osx.cpp
index 5f51fca1b7bb9524088b0e9e0c3917430bd237d6..8061d068e40f22e28d446f0cb5939f8e8a5d9679 100644 (file)
 #include "wx/filefn.h"
 #include "wx/sysopt.h"
 #include "wx/thread.h"
+#include "wx/textcompleter.h"
 
 #include "wx/osx/private.h"
 
+wxTextEntry::wxTextEntry()
+{
+    m_completer = NULL;
+    m_editable = true;
+    m_maxLength = 0;
+}
+
+wxTextEntry::~wxTextEntry()
+{
+    delete m_completer;
+}
+
 wxString wxTextEntry::DoGetValue() const
 {
     return GetTextPeer()->GetStringValue() ;
@@ -224,4 +237,23 @@ wxTextWidgetImpl * wxTextEntry::GetTextPeer() const
     return win ? dynamic_cast<wxTextWidgetImpl *>(win->GetPeer()) : NULL;
 }
 
+// ----------------------------------------------------------------------------
+// Auto-completion
+// ----------------------------------------------------------------------------
+
+bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
+{
+    wxTextCompleterFixed * const completer = new wxTextCompleterFixed;
+    completer->SetCompletions(choices);
+
+    return DoAutoCompleteCustom(completer);
+}
+
+bool wxTextEntry::DoAutoCompleteCustom(wxTextCompleter *completer)
+{
+    m_completer = completer;
+
+    return true;
+}
+
 #endif // wxUSE_TEXTCTRL