X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaf37267a8d038f61f06c4a12d16bf3df38fc3be..5ed8879eaf9d220414e85764b0b97fa11a15a6aa:/src/osx/choice_osx.cpp diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index f871ed3d26..f303ec637c 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: choice.cpp 54129 2008-06-11 19:30:52Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -72,10 +72,10 @@ bool wxChoice::Create(wxWindow *parent, if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) ) return false; - + m_popUpMenu = new wxMenu(); m_popUpMenu->SetNoEventsMode(true); - + m_peer = wxWidgetImpl::CreateChoice( this, parent, id, m_popUpMenu, pos, size, style, GetExtraStyle() ); MacPostControlCreate( pos, size ); @@ -142,7 +142,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) if ( HasClientObjectData() ) delete GetClientObject( n ); - + m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) ); m_strings.RemoveAt( n ) ; @@ -230,7 +230,7 @@ void * wxChoice::DoGetItemClientData(unsigned int n) const return (void *)m_datas[n]; } -bool wxChoice::HandleClicked( double timestampsec ) +bool wxChoice::OSXHandleClicked( double WXUNUSED(timestampsec) ) { wxCommandEvent event( wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); @@ -241,7 +241,7 @@ bool wxChoice::HandleClicked( double timestampsec ) event.SetInt( n ); event.SetString( GetStringSelection() ); event.SetEventObject( this ); - + if ( HasClientObjectData() ) event.SetClientObject( GetClientObject( n ) ); else if ( HasClientUntypedData() ) @@ -256,7 +256,8 @@ bool wxChoice::HandleClicked( double timestampsec ) wxSize wxChoice::DoGetBestSize() const { int lbWidth = GetCount() > 0 ? 20 : 100; // some defaults - int lbHeight = 20; + wxSize baseSize = wxWindow::DoGetBestSize(); + int lbHeight = baseSize.y; int wLine; { @@ -280,7 +281,6 @@ wxSize wxChoice::DoGetBestSize() const wxCoord width, height ; dc.GetTextExtent( wxT("X"), &width, &height); int cx = width ; - lbHeight += 4; lbWidth += cx ; }