-public :
- wxMacSearchFieldControl( wxTextCtrl *wxPeer,
- const wxString& str,
- const wxPoint& pos,
- const wxSize& size, long style ) : wxMacUnicodeTextControl( wxPeer )
- {
- Create( wxPeer, str, pos, size, style );
- }
-
- // search field options
- virtual void ShowSearchButton( bool show );
- virtual bool IsSearchButtonVisible() const;
-
- virtual void ShowCancelButton( bool show );
- virtual bool IsCancelButtonVisible() const;
-
- virtual void SetSearchMenu( wxMenu* menu );
- virtual wxMenu* GetSearchMenu() const;
-
- virtual void SetDescriptiveText(const wxString& text);
- virtual wxString GetDescriptiveText() const;
-
- virtual bool SetFocus();
-
-protected :
- virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef crf );
-
-private:
- wxMenu* m_menu;
-} ;
-
-void wxMacSearchFieldControl::CreateControl(wxTextCtrl* WXUNUSED(peer),
- const Rect* bounds,
- CFStringRef WXUNUSED(crf))
-{
- OptionBits attributes = kHISearchFieldAttributesSearchIcon;
-
- HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
- verify_noerr( HISearchFieldCreate(
- &hibounds,
- attributes,
- 0, // MenuRef
- CFSTR("Search"),
- &m_controlRef
- ) );
- HIViewSetVisible (m_controlRef, true);