]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/srchctrl.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / mac / carbon / srchctrl.cpp
index a99d21664952a1b2433dfb0cdc162d449831f550..24da3d7f70a895977e1e0b285c223de2aa20b83d 100644 (file)
@@ -40,9 +40,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSearchCtrl, wxSearchCtrlBase)
 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 } ,
-#endif
 };
 
 class wxMacSearchFieldControl : public wxMacUnicodeTextControl
 };
 
 class wxMacSearchFieldControl : public wxMacUnicodeTextControl
@@ -80,13 +78,8 @@ void wxMacSearchFieldControl::CreateControl(wxTextCtrl* WXUNUSED(peer),
                                             const Rect* bounds,
                                             CFStringRef WXUNUSED(crf))
 {
                                             const Rect* bounds,
                                             CFStringRef WXUNUSED(crf))
 {
-    OptionBits attributes = 0;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
-    if ( UMAGetSystemVersion() >= 0x1040 )
-    {
-        attributes = kHISearchFieldAttributesSearchIcon;
-    }
-#endif
+    OptionBits 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,
@@ -101,33 +94,24 @@ void wxMacSearchFieldControl::CreateControl(wxTextCtrl* WXUNUSED(peer),
 // 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;
+    OptionBits clear = 0;
+    if ( show )
     {
     {
-        OptionBits set = 0;
-        OptionBits clear = 0;
-        if ( show )
-        {
-            set |= kHISearchFieldAttributesSearchIcon;
-        }
-        else
-        {
-            clear |= kHISearchFieldAttributesSearchIcon;
-        }
-        HISearchFieldChangeAttributes( m_controlRef, set, clear );
+        set |= kHISearchFieldAttributesSearchIcon;
     }
     }
-#endif
+    else
+    {
+        clear |= kHISearchFieldAttributesSearchIcon;
+    }
+    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 )
@@ -211,11 +195,9 @@ static pascal OSStatus wxMacSearchControlEventHandler( EventHandlerCallRef handl
         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 ;
-#endif
     }
 
     return result ;
     }
 
     return result ;
@@ -408,16 +390,7 @@ void wxSearchCtrl::CreatePeer(
            const wxPoint& pos,
            const wxSize& size, long style )
 {
            const wxPoint& pos,
            const wxSize& size, long style )
 {
-#ifdef __WXMAC_OSX__
-    if ( UMAGetSystemVersion() >= 0x1030 )
-    {
-        m_peer = new wxMacSearchFieldControl( this , str , pos , size , style );
-    }
-#endif
-    if ( !m_peer )
-    {
-        wxTextCtrl::CreatePeer( str, pos, size, style );
-    }
+    m_peer = new wxMacSearchFieldControl( this , str , pos , size , style );
 }
 
 #endif // wxUSE_NATIVE_SEARCH_CONTROL
 }
 
 #endif // wxUSE_NATIVE_SEARCH_CONTROL