switched to MacOS 8.5+ implementation for submenus
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
404dfcae70
commit
867e99f57d
@ -70,7 +70,6 @@ void wxMenu::Init()
|
||||
Str255 label;
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_title , false );
|
||||
m_macMenuId = s_macNextMenuId++;
|
||||
wxCHECK_RET( s_macNextMenuId < 236 , "menu ids > 235 cannot be used for submenus on mac" );
|
||||
m_hMenu = ::NewMenu(m_macMenuId, label);
|
||||
|
||||
if ( !m_hMenu )
|
||||
|
@ -222,40 +222,17 @@ void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex inItem )
|
||||
|
||||
void UMAAppendSubMenuItem( MenuRef menu , StringPtr l , SInt16 id )
|
||||
{
|
||||
Str255 label ;
|
||||
memcpy( label , l , l[0]+1 ) ;
|
||||
// hardcoded adding of the submenu combination for mac
|
||||
|
||||
int theEnd = label[0] + 1;
|
||||
if (theEnd > 251)
|
||||
theEnd = 251; // mac allows only 255 characters
|
||||
label[theEnd++] = '/';
|
||||
label[theEnd++] = hMenuCmd;
|
||||
label[theEnd++] = '!';
|
||||
label[theEnd++] = id ;
|
||||
label[theEnd] = 0x00;
|
||||
label[0] = theEnd;
|
||||
MacAppendMenu(menu, label);
|
||||
MacAppendMenu(menu, l);
|
||||
SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ;
|
||||
}
|
||||
|
||||
void UMAInsertSubMenuItem( MenuRef menu , StringPtr l , MenuItemIndex item , SInt16 id )
|
||||
{
|
||||
Str255 label ;
|
||||
memcpy( label , l , l[0]+1 ) ;
|
||||
// hardcoded adding of the submenu combination for mac
|
||||
|
||||
int theEnd = label[0] + 1;
|
||||
if (theEnd > 251)
|
||||
theEnd = 251; // mac allows only 255 characters
|
||||
label[theEnd++] = '/';
|
||||
label[theEnd++] = hMenuCmd;
|
||||
label[theEnd++] = '!';
|
||||
label[theEnd++] = id;
|
||||
label[theEnd] = 0x00;
|
||||
label[0] = theEnd;
|
||||
MacInsertMenuItem(menu, label , item);
|
||||
MacInsertMenuItem(menu, l , item);
|
||||
SetMenuItemHierarchicalID( menu , item , id ) ;
|
||||
}
|
||||
|
||||
|
||||
void UMAAppendMenuItem( MenuRef menu , StringPtr l , SInt16 key, UInt8 modifiers )
|
||||
{
|
||||
Str255 label ;
|
||||
|
@ -70,7 +70,6 @@ void wxMenu::Init()
|
||||
Str255 label;
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_title , false );
|
||||
m_macMenuId = s_macNextMenuId++;
|
||||
wxCHECK_RET( s_macNextMenuId < 236 , "menu ids > 235 cannot be used for submenus on mac" );
|
||||
m_hMenu = ::NewMenu(m_macMenuId, label);
|
||||
|
||||
if ( !m_hMenu )
|
||||
|
@ -222,40 +222,17 @@ void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex inItem )
|
||||
|
||||
void UMAAppendSubMenuItem( MenuRef menu , StringPtr l , SInt16 id )
|
||||
{
|
||||
Str255 label ;
|
||||
memcpy( label , l , l[0]+1 ) ;
|
||||
// hardcoded adding of the submenu combination for mac
|
||||
|
||||
int theEnd = label[0] + 1;
|
||||
if (theEnd > 251)
|
||||
theEnd = 251; // mac allows only 255 characters
|
||||
label[theEnd++] = '/';
|
||||
label[theEnd++] = hMenuCmd;
|
||||
label[theEnd++] = '!';
|
||||
label[theEnd++] = id ;
|
||||
label[theEnd] = 0x00;
|
||||
label[0] = theEnd;
|
||||
MacAppendMenu(menu, label);
|
||||
MacAppendMenu(menu, l);
|
||||
SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ;
|
||||
}
|
||||
|
||||
void UMAInsertSubMenuItem( MenuRef menu , StringPtr l , MenuItemIndex item , SInt16 id )
|
||||
{
|
||||
Str255 label ;
|
||||
memcpy( label , l , l[0]+1 ) ;
|
||||
// hardcoded adding of the submenu combination for mac
|
||||
|
||||
int theEnd = label[0] + 1;
|
||||
if (theEnd > 251)
|
||||
theEnd = 251; // mac allows only 255 characters
|
||||
label[theEnd++] = '/';
|
||||
label[theEnd++] = hMenuCmd;
|
||||
label[theEnd++] = '!';
|
||||
label[theEnd++] = id;
|
||||
label[theEnd] = 0x00;
|
||||
label[0] = theEnd;
|
||||
MacInsertMenuItem(menu, label , item);
|
||||
MacInsertMenuItem(menu, l , item);
|
||||
SetMenuItemHierarchicalID( menu , item , id ) ;
|
||||
}
|
||||
|
||||
|
||||
void UMAAppendMenuItem( MenuRef menu , StringPtr l , SInt16 key, UInt8 modifiers )
|
||||
{
|
||||
Str255 label ;
|
||||
|
Loading…
Reference in New Issue
Block a user