Create real separator items instead of items without titles
(NOTE: Use diff -w to see what this really changes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
461bdfcc1d
commit
67352554ff
@ -135,17 +135,22 @@ wxMenuItemCocoa::wxMenuItemCocoa(wxMenu *pParentMenu,
|
||||
: wxMenuItemBase(pParentMenu, itemid, strName, strHelp, kind, pSubMenu)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
NSString *menuTitle = wxInitNSStringWithWxString([NSString alloc],wxStripMenuCodes(strName));
|
||||
m_cocoaNSMenuItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:@selector(wxMenuItemAction:) keyEquivalent:@""];
|
||||
sm_cocoaHash.insert(wxMenuItemCocoaHash::value_type(m_cocoaNSMenuItem,this));
|
||||
[m_cocoaNSMenuItem setTarget:sm_cocoaTarget];
|
||||
if(pSubMenu)
|
||||
if(m_kind == wxITEM_SEPARATOR)
|
||||
m_cocoaNSMenuItem = [[NSMenuItem separatorItem] retain];
|
||||
else
|
||||
{
|
||||
wxASSERT(pSubMenu->GetNSMenu());
|
||||
[pSubMenu->GetNSMenu() setTitle:menuTitle];
|
||||
[m_cocoaNSMenuItem setSubmenu:pSubMenu->GetNSMenu()];
|
||||
NSString *menuTitle = wxInitNSStringWithWxString([NSString alloc],wxStripMenuCodes(strName));
|
||||
m_cocoaNSMenuItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:@selector(wxMenuItemAction:) keyEquivalent:@""];
|
||||
sm_cocoaHash.insert(wxMenuItemCocoaHash::value_type(m_cocoaNSMenuItem,this));
|
||||
[m_cocoaNSMenuItem setTarget:sm_cocoaTarget];
|
||||
if(pSubMenu)
|
||||
{
|
||||
wxASSERT(pSubMenu->GetNSMenu());
|
||||
[pSubMenu->GetNSMenu() setTitle:menuTitle];
|
||||
[m_cocoaNSMenuItem setSubmenu:pSubMenu->GetNSMenu()];
|
||||
}
|
||||
[menuTitle release];
|
||||
}
|
||||
[menuTitle release];
|
||||
}
|
||||
|
||||
wxMenuItem::~wxMenuItem()
|
||||
|
Loading…
Reference in New Issue
Block a user