]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textentry.cpp
respect wxBU_NOTEXT style in wxButton
[wxWidgets.git] / src / msw / textentry.cpp
index 7a30e5daf8d80c8d090937e899ac1470ae0bd6ff..5e1b753ee73e498e56a8645f6df1cf755f3fafff 100644 (file)
 
 #include "wx/msw/private.h"
 
 
 #include "wx/msw/private.h"
 
+#if wxUSE_UXTHEME
+    #include "wx/msw/uxtheme.h"
+#endif
+
 #define GetEditHwnd() ((HWND)(GetEditHWND()))
 
 // ----------------------------------------------------------------------------
 #define GetEditHwnd() ((HWND)(GetEditHWND()))
 
 // ----------------------------------------------------------------------------
@@ -180,7 +184,7 @@ void wxTextEntry::WriteText(const wxString& text)
     ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, (LPARAM)text.wx_str());
 }
 
     ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, (LPARAM)text.wx_str());
 }
 
-wxString wxTextEntry::GetValue() const
+wxString wxTextEntry::DoGetValue() const
 {
     return wxGetWindowText(GetEditHWND());
 }
 {
     return wxGetWindowText(GetEditHWND());
 }
@@ -416,4 +420,44 @@ void wxTextEntry::SetMaxLength(unsigned long len)
     ::SendMessage(GetEditHwnd(), EM_LIMITTEXT, len, 0);
 }
 
     ::SendMessage(GetEditHwnd(), EM_LIMITTEXT, len, 0);
 }
 
+// ----------------------------------------------------------------------------
+// hints
+// ----------------------------------------------------------------------------
+
+#if wxUSE_UXTHEME
+
+#ifndef EM_SETCUEBANNER
+    #define EM_SETCUEBANNER 0x1501
+    #define EM_GETCUEBANNER 0x1502
+#endif
+
+bool wxTextEntry::SetHint(const wxString& hint)
+{
+    if ( wxUxThemeEngine::GetIfActive() )
+    {
+        // notice that this message always works with Unicode strings
+        if ( ::SendMessage(GetEditHwnd(), EM_SETCUEBANNER,
+                             0, (LPARAM)(const wchar_t *)hint.wc_str()) )
+            return true;
+    }
+
+    return wxTextEntryBase::SetHint(hint);
+}
+
+wxString wxTextEntry::GetHint() const
+{
+    if ( wxUxThemeEngine::GetIfActive() )
+    {
+        wchar_t buf[256];
+        if ( ::SendMessage(GetEditHwnd(), EM_GETCUEBANNER,
+                            (WPARAM)buf, WXSIZEOF(buf)) )
+            return wxString(buf);
+    }
+
+    return wxTextEntryBase::GetHint();
+}
+
+
+#endif // wxUSE_UXTHEME
+
 #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX
 #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX