]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textentry.cpp
Do not propagate key events from child controls unless they have modifiers
[wxWidgets.git] / src / msw / textentry.cpp
index 79c0fa201ed13207a37d362c7bf00f94bd2fb362..f8b91e383cd78c7f5deb7f32e05fcc2b87ca1dd5 100644 (file)
@@ -51,7 +51,7 @@
 #include "wx/msw/ole/oleutils.h"
 #include <shldisp.h>
 
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) || defined (__WATCOMC__)
     // needed for IID_IAutoComplete, IID_IAutoComplete2 and ACO_AUTOSUGGEST
     #include <shlguid.h>
 #endif
@@ -103,7 +103,7 @@ public:
 
             memcpy(olestr, wcbuf, size);
 
-            *rgelt++ = wx_static_cast(LPOLESTR, olestr);
+            *rgelt++ = static_cast<LPOLESTR>(olestr);
 
             ++(*pceltFetched);
         }
@@ -243,6 +243,11 @@ bool wxTextEntry::CanRedo() const
 
 void wxTextEntry::SetInsertionPoint(long pos)
 {
+    // calling DoSetSelection(-1, -1) would select everything which is not what
+    // we want here
+    if ( pos == -1 )
+        pos = GetLastPosition();
+
     // be careful to call DoSetSelection() which is overridden in wxTextCtrl
     // and not just SetSelection() here
     DoSetSelection(pos, pos);
@@ -287,6 +292,7 @@ void wxTextEntry::GetSelection(long *from, long *to) const
 // auto-completion
 // ----------------------------------------------------------------------------
 
+#if wxUSE_OLE
 bool wxTextEntry::AutoCompleteFileNames()
 {
 #ifdef HAS_AUTOCOMPLETE
@@ -295,9 +301,7 @@ bool wxTextEntry::AutoCompleteFileNames()
     static wxDynamicLibrary s_dllShlwapi;
     if ( s_pfnSHAutoComplete == (SHAutoComplete_t)-1 )
     {
-        wxLogNull noLog;
-
-        if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM) )
+        if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )
         {
             s_pfnSHAutoComplete = NULL;
         }
@@ -337,7 +341,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices)
                     NULL,
                     CLSCTX_INPROC_SERVER,
                     IID_IAutoComplete,
-                    wx_reinterpret_cast(void **, &pAutoComplete)
+                    reinterpret_cast<void **>(&pAutoComplete)
                  );
     if ( FAILED(hr) )
     {
@@ -361,7 +365,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices)
     hr = pAutoComplete->QueryInterface
                         (
                            IID_IAutoComplete2,
-                           wx_reinterpret_cast(void **, &pAutoComplete2)
+                           reinterpret_cast<void **>(&pAutoComplete2)
                         );
     if ( SUCCEEDED(hr) )
     {
@@ -375,9 +379,12 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices)
     pAutoComplete->Release();
     return true;
 #else // !HAS_AUTOCOMPLETE
+    wxUnusedVar(choices);
+
     return false;
 #endif // HAS_AUTOCOMPLETE/!HAS_AUTOCOMPLETE
 }
+#endif // wxUSE_OLE
 
 // ----------------------------------------------------------------------------
 // editable state