IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
#endif
-short nextMenuId = 100 ; // wxMenu takes the lower ids
+extern MenuHandle NewUniqueMenu() ;
wxChoice::~wxChoice()
{
m_macControl = UMANewControl( 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) ;
// right now we don't support editable comboboxes
+static nextPopUpMenuId = 1000 ;
+MenuHandle NewUniqueMenu()
+{
+ MenuHandle handle = NewMenu( nextPopUpMenuId , "\pMenu" ) ;
+ nextPopUpMenuId++ ;
+ return handle ;
+}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
kControlPopupButtonProc , (long) this ) ;
- m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ;
+ m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
for ( int i = 0 ; i < n ; i++ )
{
if ( event.m_metaDown )
modifiers |= cmdKey ;
-
-// controlpart = FindControl( localwhere , window , &control ) ;
+
+#if TARGET_CARBON
control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
+#else
+// control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
+ controlpart = FindControl( localwhere , window , &control ) ;
+#endif
{
/*
if ( AcceptsFocus() && FindFocus() != this )
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
#endif
-short nextMenuId = 100 ; // wxMenu takes the lower ids
+extern MenuHandle NewUniqueMenu() ;
wxChoice::~wxChoice()
{
m_macControl = UMANewControl( 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) ;
// right now we don't support editable comboboxes
+static nextPopUpMenuId = 1000 ;
+MenuHandle NewUniqueMenu()
+{
+ MenuHandle handle = NewMenu( nextPopUpMenuId , "\pMenu" ) ;
+ nextPopUpMenuId++ ;
+ return handle ;
+}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
kControlPopupButtonProc , (long) this ) ;
- m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ;
+ m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
for ( int i = 0 ; i < n ; i++ )
{
if ( event.m_metaDown )
modifiers |= cmdKey ;
-
-// controlpart = FindControl( localwhere , window , &control ) ;
+
+#if TARGET_CARBON
control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
+#else
+// control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
+ controlpart = FindControl( localwhere , window , &control ) ;
+#endif
{
/*
if ( AcceptsFocus() && FindFocus() != this )