- (id)initWithFrame:(NSRect)frame
{
[super initWithFrame:frame];
- [self setTarget: self];
- [self setAction: @selector(searchAction:)];
return self;
}
-
-- (void) searchAction: (id) sender
-{
- (void) sender;
- wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
- if ( impl )
- {
- wxSearchCtrl* wxpeer = dynamic_cast<wxSearchCtrl*>( impl->GetWXPeer() );
- if ( wxpeer )
- {
- NSString *searchString = [self stringValue];
- if ( searchString == nil )
- {
- wxpeer->HandleSearchFieldCancelHit();
- }
- else
- {
- wxpeer->HandleSearchFieldSearchHit();
- }
- }
- }
-}
-
+
- (void)controlTextDidChange:(NSNotification *)aNotification
{
wxUnusedVar(aNotification);
return wxNSTextFieldControl::SetFocus();
}
+ void controlAction( WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd), void *WXUNUSED(sender))
+ {
+ wxSearchCtrl* wxpeer = (wxSearchCtrl*) GetWXPeer();
+ if ( wxpeer )
+ {
+ NSString *searchString = [m_searchField stringValue];
+ if ( searchString == nil )
+ {
+ wxpeer->HandleSearchFieldCancelHit();
+ }
+ else
+ {
+ wxpeer->HandleSearchFieldSearchHit();
+ }
+ }
+ }
+
private:
wxNSSearchField* m_searchField;
NSSearchFieldCell* m_searchFieldCell;
{
}
-wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
+wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxSearchCtrl* wxpeer,
wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
const wxString& str,