X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9412f8f03171fdd3606a4ad3db9c9da8fe6bd7c..7f0c3a63a0eee38206d22d29db5c7eef260574ea:/src/mac/carbon/listbox.cpp diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 128f87af9e..8322a7a2f2 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -72,16 +72,19 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect Cell cell, short dataOffset, short dataLength, ListHandle listHandle ) { + wxListBox* list; + list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); + if ( list == NULL ) + return ; + GrafPtr savePort; GrafPtr grafPtr; RgnHandle savedClipRegion; SInt32 savedPenMode; - wxListBox* list; GetPort(&savePort); SetPort((**listHandle).port); grafPtr = (**listHandle).port ; // typecast our refCon - list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); // Calculate the cell rect. @@ -286,11 +289,11 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, OptionBits options = 0; if ( style & wxLB_MULTIPLE ) { - options += lNoExtend ; + options += lExtendDrag + lUseSense ; } else if ( style & wxLB_EXTENDED ) { - options += lExtendDrag ; + // default behaviour } else { @@ -313,6 +316,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, wxListBox::~wxListBox() { FreeData() ; + // avoid access during destruction + SetControlReference( (ControlHandle) m_macControl , NULL ) ; if ( m_macList ) { #if !TARGET_CARBON @@ -823,7 +828,7 @@ void wxListBox::MacScrollTo( int n ) // TODO implement scrolling } -void wxListBox::OnSize( const wxSizeEvent &event) +void wxListBox::OnSize( wxSizeEvent &event) { Point pt;