]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/srchctrl.cpp
Fixed uninstalled toolbars in native toolbar mode, with a method for
[wxWidgets.git] / src / mac / carbon / srchctrl.cpp
index 223ed8fcb137d013fc56cf9abd807aeb745f707c..3fcb8d7d6686bdb05336d56939c70c94efa45c85 100644 (file)
@@ -68,6 +68,10 @@ public :
 
     virtual void SetSearchMenu( wxMenu* menu );
     virtual wxMenu* GetSearchMenu() const;
+
+    virtual void SetDescriptiveText(const wxString& text);
+    virtual wxString GetDescriptiveText() const;
+    
 protected :
     virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef crf );
 
@@ -167,6 +171,28 @@ wxMenu* wxMacSearchFieldControl::GetSearchMenu() const
     return m_menu;
 }
 
+
+void wxMacSearchFieldControl::SetDescriptiveText(const wxString& text)
+{
+    verify_noerr( HISearchFieldSetDescriptiveText(
+                      m_controlRef,
+                      wxMacCFStringHolder( text, wxFont::GetDefaultEncoding() )));
+}
+
+wxString wxMacSearchFieldControl::GetDescriptiveText() const
+{
+    CFStringRef cfStr;
+    verify_noerr( HISearchFieldCopyDescriptiveText( m_controlRef, &cfStr ));
+    if ( cfStr )
+    {
+        return wxMacCFStringHolder(cfStr).AsString();
+    }
+    else
+    {
+        return wxEmptyString;
+    }
+}
+
 #endif
 
 // ============================================================================
@@ -351,6 +377,16 @@ bool wxSearchCtrl::IsCancelButtonVisible() const
     return GetPeer()->IsCancelButtonVisible();
 }
 
+void wxSearchCtrl::SetDescriptiveText(const wxString& text)
+{
+    GetPeer()->SetDescriptiveText(text);
+}
+
+wxString wxSearchCtrl::GetDescriptiveText() const
+{
+    return GetPeer()->GetDescriptiveText();
+}
+
 wxInt32 wxSearchCtrl::MacSearchFieldSearchHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
 {
     wxCommandEvent event(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, m_windowId );