X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ef585df0c08670ac9a208d827b69375fac72ebb..fa1c12bdd76acc21ddb45b90bb53b2f58aed946d:/src/mac/choice.cpp diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp index 0559853584..9f05a58372 100644 --- a/src/mac/choice.cpp +++ b/src/mac/choice.cpp @@ -23,7 +23,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) #endif -short nextMenuId = 100 ; // wxMenu takes the lower ids +extern MenuHandle NewUniqueMenu() ; wxChoice::~wxChoice() { @@ -45,10 +45,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 , + m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 , kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; - m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ; + m_macPopUpMenuHandle = NewUniqueMenu() ; SetControlData( m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; SetControlMinimum( m_macControl , 0 ) ; SetControlMaximum( m_macControl , 0) ; @@ -216,6 +216,13 @@ void wxChoice::MacHandleControlClick( ControlHandle control , SInt16 controlpart event.SetString(GetStringSelection()); ProcessCommand(event); } + +wxSize wxChoice::DoGetBestSize() const +{ + // TODO should modify this to take into account string length ala wxGTK + return wxSize(100,20); +} + /* void wxChoice::Command(wxCommandEvent & event) {