git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43950
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
static const EventTypeSpec eventList[] =
{
{ kEventClassSearchField, kEventSearchFieldCancelClicked } ,
static const EventTypeSpec eventList[] =
{
{ kEventClassSearchField, kEventSearchFieldCancelClicked } ,
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
{ kEventClassSearchField, kEventSearchFieldSearchClicked } ,
{ kEventClassSearchField, kEventSearchFieldSearchClicked } ,
};
class wxMacSearchFieldControl : public wxMacUnicodeTextControl
};
class wxMacSearchFieldControl : public wxMacUnicodeTextControl
void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf )
{
OptionBits attributes = 0;
void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf )
{
OptionBits attributes = 0;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if ( UMAGetSystemVersion() >= 0x1040 )
{
attributes = kHISearchFieldAttributesSearchIcon;
}
if ( UMAGetSystemVersion() >= 0x1040 )
{
attributes = kHISearchFieldAttributesSearchIcon;
}
HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
verify_noerr( HISearchFieldCreate(
&hibounds,
HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
verify_noerr( HISearchFieldCreate(
&hibounds,
// search field options
void wxMacSearchFieldControl::ShowSearchButton( bool show )
{
// search field options
void wxMacSearchFieldControl::ShowSearchButton( bool show )
{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if ( UMAGetSystemVersion() >= 0x1040 )
{
OptionBits set = 0;
if ( UMAGetSystemVersion() >= 0x1040 )
{
OptionBits set = 0;
}
HISearchFieldChangeAttributes( m_controlRef, set, clear );
}
}
HISearchFieldChangeAttributes( m_controlRef, set, clear );
}
}
bool wxMacSearchFieldControl::IsSearchButtonVisible() const
{
}
bool wxMacSearchFieldControl::IsSearchButtonVisible() const
{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
OptionBits attributes = 0;
verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) );
return ( attributes & kHISearchFieldAttributesSearchIcon ) != 0;
OptionBits attributes = 0;
verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) );
return ( attributes & kHISearchFieldAttributesSearchIcon ) != 0;
+#else
+ return false;
+#endif
}
void wxMacSearchFieldControl::ShowCancelButton( bool show )
}
void wxMacSearchFieldControl::ShowCancelButton( bool show )
case kEventSearchFieldCancelClicked :
thisWindow->MacSearchFieldCancelHit( handler , event ) ;
break ;
case kEventSearchFieldCancelClicked :
thisWindow->MacSearchFieldCancelHit( handler , event ) ;
break ;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
case kEventSearchFieldSearchClicked :
thisWindow->MacSearchFieldSearchHit( handler , event ) ;
break ;
case kEventSearchFieldSearchClicked :
thisWindow->MacSearchFieldSearchHit( handler , event ) ;
break ;