Compile fixes for Panther

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-12-12 07:23:17 +00:00
parent e6239913ac
commit 68fc5c8025

View File

@@ -43,7 +43,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxSearchCtrl, wxSearchCtrlBase)
static const EventTypeSpec eventList[] = static const EventTypeSpec eventList[] =
{ {
{ kEventClassSearchField, kEventSearchFieldCancelClicked } , { kEventClassSearchField, kEventSearchFieldCancelClicked } ,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
{ kEventClassSearchField, kEventSearchFieldSearchClicked } , { kEventClassSearchField, kEventSearchFieldSearchClicked } ,
#endif
}; };
class wxMacSearchFieldControl : public wxMacUnicodeTextControl class wxMacSearchFieldControl : public wxMacUnicodeTextControl
@@ -76,10 +78,12 @@ private:
void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf ) void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf )
{ {
OptionBits attributes = 0; OptionBits attributes = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if ( UMAGetSystemVersion() >= 0x1040 ) if ( UMAGetSystemVersion() >= 0x1040 )
{ {
attributes = kHISearchFieldAttributesSearchIcon; attributes = kHISearchFieldAttributesSearchIcon;
} }
#endif
HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } }; HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
verify_noerr( HISearchFieldCreate( verify_noerr( HISearchFieldCreate(
&hibounds, &hibounds,
@@ -94,6 +98,7 @@ void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* b
// search field options // search field options
void wxMacSearchFieldControl::ShowSearchButton( bool show ) void wxMacSearchFieldControl::ShowSearchButton( bool show )
{ {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if ( UMAGetSystemVersion() >= 0x1040 ) if ( UMAGetSystemVersion() >= 0x1040 )
{ {
OptionBits set = 0; OptionBits set = 0;
@@ -108,13 +113,18 @@ void wxMacSearchFieldControl::ShowSearchButton( bool show )
} }
HISearchFieldChangeAttributes( m_controlRef, set, clear ); HISearchFieldChangeAttributes( m_controlRef, set, clear );
} }
#endif
} }
bool wxMacSearchFieldControl::IsSearchButtonVisible() const bool wxMacSearchFieldControl::IsSearchButtonVisible() const
{ {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
OptionBits attributes = 0; OptionBits attributes = 0;
verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) ); verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) );
return ( attributes & kHISearchFieldAttributesSearchIcon ) != 0; return ( attributes & kHISearchFieldAttributesSearchIcon ) != 0;
#else
return false;
#endif
} }
void wxMacSearchFieldControl::ShowCancelButton( bool show ) void wxMacSearchFieldControl::ShowCancelButton( bool show )
@@ -178,9 +188,11 @@ static pascal OSStatus wxMacSearchControlEventHandler( EventHandlerCallRef handl
case kEventSearchFieldCancelClicked : case kEventSearchFieldCancelClicked :
thisWindow->MacSearchFieldCancelHit( handler , event ) ; thisWindow->MacSearchFieldCancelHit( handler , event ) ;
break ; break ;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
case kEventSearchFieldSearchClicked : case kEventSearchFieldSearchClicked :
thisWindow->MacSearchFieldSearchHit( handler , event ) ; thisWindow->MacSearchFieldSearchHit( handler , event ) ;
break ; break ;
#endif
} }
return result ; return result ;