X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/facd6764872eede45605ba7c9dfa0e1d0c708fa2..be5a51fb592f3fa2ba38ac6cd1e488d6d806058c:/src/mac/carbon/choice.cpp?ds=inline diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 1a617ef6a5..489243e04a 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -66,8 +66,9 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, return false; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , -12345 , 0 , - kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; + + verify_noerr ( CreatePopupButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , + -12345 , false /* no variable width */ , 0 , 0 , 0 , (ControlRef*) &m_macControl ) ) ; m_macPopUpMenuHandle = NewUniqueMenu() ; SetControlData( (ControlRef) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; @@ -81,6 +82,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, { Append(choices[i]); } + SetBestSize(size); // Needed because it is a wxControlWithItems return TRUE; } @@ -228,7 +230,7 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const return (wxClientData *)DoGetItemClientData(n); } -void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) +wxInt32 wxChoice::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) ) { wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); int n = GetSelection(); @@ -244,6 +246,7 @@ void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , b event.SetClientData( GetClientData(n) ); ProcessCommand(event); } + return noErr ; } wxSize wxChoice::DoGetBestSize() const