X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/mac/classic/listbox.cpp diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp index b1d70172ae..e68a7f9b72 100644 --- a/src/mac/classic/listbox.cpp +++ b/src/mac/classic/listbox.cpp @@ -6,7 +6,7 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -265,7 +265,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, long result ; wxStAppResource resload ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , + m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , 0 , 0, kControlListBoxProc , (long) this ) ; ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , @@ -401,6 +401,8 @@ void wxListBox::Delete(int N) int wxListBox::DoAppend(const wxString& item) { + InvalidateBestSize(); + int index = m_noItems ; m_stringArray.Add( item ) ; m_dataArray.Add( NULL ); @@ -513,7 +515,7 @@ void wxListBox::Clear() MacClear() ; } -void wxListBox::SetSelection(int N, bool select) +void wxListBox::DoSetSelection(int N, bool select) { wxCHECK_RET( N >= 0 && N < m_noItems, wxT("invalid index in wxListBox::SetSelection") ); @@ -595,6 +597,8 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos) wxCHECK_RET( pos >= 0 && pos <= m_noItems, wxT("invalid index in wxListBox::InsertItems") ); + InvalidateBestSize(); + int nItems = items.GetCount(); for ( int i = 0 ; i < nItems ; i++ ) @@ -905,7 +909,7 @@ void wxListBox::MacDoClick() n = -1; } - event.m_commandInt = n; + event.SetInt(n); GetEventHandler()->ProcessEvent(event); } @@ -986,7 +990,7 @@ void wxListBox::OnChar(wxKeyEvent& event) n = -1; } - event.m_commandInt = n; + event.SetInt(n); GetEventHandler()->ProcessEvent(event); } @@ -1013,7 +1017,7 @@ void wxListBox::OnChar(wxKeyEvent& event) event.SetClientData( GetClientData(line) ); event.SetString( GetString(line) ); - event.m_commandInt = line ; + event.SetInt(line); GetEventHandler()->ProcessEvent(event); }