changed menu creation for choice and combobox (unique ids), control changed back to old selection code for non carbon targets
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
short nextMenuId = 100 ; // wxMenu takes the lower ids
|
||||
extern MenuHandle NewUniqueMenu() ;
|
||||
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
@@ -48,7 +48,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
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) ;
|
||||
|
@@ -23,6 +23,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||
|
||||
// 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,
|
||||
@@ -43,7 +50,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
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++ )
|
||||
{
|
||||
|
@@ -835,8 +835,12 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
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 )
|
||||
|
@@ -23,7 +23,7 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
short nextMenuId = 100 ; // wxMenu takes the lower ids
|
||||
extern MenuHandle NewUniqueMenu() ;
|
||||
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
@@ -48,7 +48,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
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) ;
|
||||
|
@@ -23,6 +23,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||
|
||||
// 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,
|
||||
@@ -43,7 +50,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
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++ )
|
||||
{
|
||||
|
@@ -835,8 +835,12 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
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 )
|
||||
|
Reference in New Issue
Block a user