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 );
wxMenu* m_menu;
} ;
-void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf )
+void wxMacSearchFieldControl::CreateControl(wxTextCtrl* WXUNUSED(peer),
+ const Rect* bounds,
+ CFStringRef WXUNUSED(crf))
{
OptionBits attributes = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
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
// ============================================================================
GetEventTypeCount(eventList), eventList, this,
(EventHandlerRef *)&searchEventHandler);
+ SetValue(value);
+
return true;
}
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 );