-
-// ============================================================================
-// implementation
-// ============================================================================
-
-static pascal OSStatus wxMacSearchControlEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
-{
- OSStatus result = eventNotHandledErr ;
-
- wxMacCarbonEvent cEvent( event ) ;
-
- ControlRef controlRef ;
- wxSearchCtrl* thisWindow = (wxSearchCtrl*) data ;
- cEvent.GetParameter( kEventParamDirectObject , &controlRef ) ;
-
- switch( GetEventKind( event ) )
- {
- case kEventSearchFieldCancelClicked :
- thisWindow->MacSearchFieldCancelHit( handler , event ) ;
- break ;
- case kEventSearchFieldSearchClicked :
- thisWindow->MacSearchFieldSearchHit( handler , event ) ;
- break ;
- }
-
- return result ;
-}
-
-DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacSearchControlEventHandler )
-
-
-// ----------------------------------------------------------------------------
-// wxSearchCtrl creation
-// ----------------------------------------------------------------------------
-
-// creation
-// --------
-
-wxSearchCtrl::wxSearchCtrl()
-{
- Init();
-}
-
-wxSearchCtrl::wxSearchCtrl(wxWindow *parent, wxWindowID id,
- const wxString& value,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxValidator& validator,
- const wxString& name)
-{
- Init();
-
- Create(parent, id, value, pos, size, style, validator, name);
-}
-
-void wxSearchCtrl::Init()
-{
- m_menu = 0;
-}
-
-bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
- const wxString& value,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxValidator& validator,
- const wxString& name)
-{
- if ( !wxTextCtrl::Create(parent, id, wxEmptyString, pos, size, wxBORDER_NONE | style, validator, name) )
- {
- return false;
- }
-
- EventHandlerRef searchEventHandler;
- InstallControlEventHandler( m_peer->GetControlRef(), GetwxMacSearchControlEventHandlerUPP(),
- GetEventTypeCount(eventList), eventList, this,
- (EventHandlerRef *)&searchEventHandler);
-
- SetValue(value);
-
- return true;
-}
-
-wxSearchCtrl::~wxSearchCtrl()
-{
- delete m_menu;
-}
-
-wxSize wxSearchCtrl::DoGetBestSize() const