X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/683e36bcccfdd389c708b9771563d5dd90f57e9c..fd04970ab45eb2f392af48b71aa9ecd5d4b1c8c2:/src/mac/carbon/checklst.cpp diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index f321e7718f..466c722e7b 100644 --- a/src/mac/carbon/checklst.cpp +++ b/src/mac/carbon/checklst.cpp @@ -13,11 +13,11 @@ // headers & declarations // ============================================================================ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "checklst.h" #endif -#include "wx/defs.h" +#include "wx/wxprec.h" #if wxUSE_CHECKLISTBOX @@ -73,7 +73,7 @@ static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrow if ( ref ) { wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; - size_t i = itemID - 1 ; + int i = itemID - 1 ; if (i >= 0 && i < list->GetCount() ) { bool trigger = false ; @@ -132,7 +132,7 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser, if ( ref ) { wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; - size_t i = itemID - 1 ; + int i = itemID - 1 ; if (i >= 0 && i < list->GetCount() ) { wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ; @@ -148,7 +148,7 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser, if ( ref ) { wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; - size_t i = itemID - 1 ; + int i = itemID - 1 ; if (i >= 0 && i < list->GetCount() ) { verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ; @@ -177,7 +177,7 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser, if ( ref ) { wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; - size_t i = itemID - 1 ; + int i = itemID - 1 ; if (i >= 0 && i < list->GetCount() ) { // we have to change this behind the back, since Check() would be triggering another update round @@ -224,7 +224,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl() ; + m_peer = new wxMacControl(this) ; verify_noerr( ::CreateDataBrowserControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, kDataBrowserListView , m_peer->GetControlRefAddr() ) ); @@ -300,6 +300,12 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, #endif m_peer->SetCallbacks( &callbacks); +#if 0 + // shouldn't be necessary anymore under 10.2 + m_peer->SetData( kControlNoPart, kControlDataBrowserIncludesFrameAndFocusTag, (Boolean) false ) ; + m_peer->SetNeedsFocusRect( true ) ; +#endif + MacPostControlCreate(pos,size) ; for ( int i = 0 ; i < n ; i++ )