git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66826
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class wxComboBox;
class wxNotebook;
class wxTextCtrl;
class wxComboBox;
class wxNotebook;
class wxTextCtrl;
WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
long style,
long extraStyle) ;
long style,
long extraStyle) ;
- static wxWidgetImplType* CreateSearchControl( wxTextCtrl* wxpeer,
+ static wxWidgetImplType* CreateSearchControl( wxSearchCtrl* wxpeer,
wxWindowMac* parent,
wxWindowID id,
const wxString& content,
wxWindowMac* parent,
wxWindowID id,
const wxString& content,
-wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
+wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxSearchCtrl* wxpeer,
wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
const wxString& str,
wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
const wxString& str,
- (id)initWithFrame:(NSRect)frame
{
[super initWithFrame:frame];
- (id)initWithFrame:(NSRect)frame
{
[super initWithFrame:frame];
- [self setTarget: self];
- [self setAction: @selector(searchAction:)];
-
-- (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);
- (void)controlTextDidChange:(NSNotification *)aNotification
{
wxUnusedVar(aNotification);
return wxNSTextFieldControl::SetFocus();
}
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;
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,
wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
const wxString& str,