X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/519cb848a8f4c91c73421bb75314754284e593a4..3fd81d8740bd0123b154e2f0901dd8ff6a609138:/src/mac/carbon/combobox.cpp diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 905f3180aa..a2841c7996 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -14,6 +14,7 @@ #endif #include "wx/combobox.h" +#include "wx/menu.h" #include "wx/mac/uma.h" #if !USE_SHARED_LIBRARY @@ -46,7 +47,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, SetControlData( m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; for ( int i = 0 ; i < n ; i++ ) { - appendmenu( m_macPopUpMenuHandle , choices[i] ) ; + Str255 label; + wxMenuItem::MacBuildMenuString( label , NULL , NULL , choices[i] ,false); + AppendMenu( m_macPopUpMenuHandle , label ) ; } SetControlMinimum( m_macControl , 0 ) ; SetControlMaximum( m_macControl , m_noStrings) ; @@ -127,7 +130,9 @@ void wxComboBox::SetSelection(long from, long to) void wxComboBox::Append(const wxString& item) { - appendmenu( m_macPopUpMenuHandle , item ) ; + Str255 label; + wxMenuItem::MacBuildMenuString( label , NULL , NULL , item ,false); + AppendMenu( m_macPopUpMenuHandle , label ) ; m_noStrings ++; SetControlMaximum( m_macControl , m_noStrings) ; } @@ -172,10 +177,16 @@ int wxComboBox::FindString(const wxString& s) const wxString wxComboBox::GetString(int n) const { - Str255 text ; - ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , text ) ; - p2cstr( text ) ; - return wxString( text ); + Str255 p_text ; + char c_text[255]; + ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , p_text ) ; +#if TARGET_CARBON + p2cstrcpy( c_text, p_text ) ; +#else + p2cstr( p_text ) ; + strcpy( c_text, (char *) p_text ) ; +#endif + return wxString( c_text ); } wxString wxComboBox::GetStringSelection() const