//
// The (popup) menu title has this special id
//
-static const int idMenuTitle = -2;
+static const int idMenuTitle = -3;
//
// The unique ID for Menus
if (IsAttached())
{
- m_menuBar->RebuildAccelTable();
+ GetMenuBar()->RebuildAccelTable();
}
}
} // wxMenu::UpdateAccel
rItem.id = pItem->GetId();
}
- BYTE* pData;
+ BYTE* pData=NULL;
#if wxUSE_OWNER_DRAWN
if (pItem->IsOwnerDrawn())
}
else
{
- //
- // Menu is just a normal string (passed in data parameter)
- //
- rItem.afStyle |= MIS_TEXT;
+ if (pItem->GetId() == idMenuTitle)
+ {
+ // Item is an unselectable title to be passed via pData
+ rItem.afStyle = MIS_STATIC;
+ }
+ else
+ {
+ //
+ // Menu is just a normal string (passed in data parameter)
+ //
+ rItem.afStyle |= MIS_TEXT;
+ }
pData = (char*)pItem->GetText().c_str();
}
//
// If we're already attached to the menubar, we must update it
//
- if (IsAttached() && m_menuBar->IsAttached())
+ if (IsAttached() && GetMenuBar()->IsAttached())
{
- m_menuBar->Refresh();
+ GetMenuBar()->Refresh();
}
return TRUE;
}
,MPFROM2SHORT(pItem->GetId(), TRUE)
,(MPARAM)0
);
- if (IsAttached() && m_menuBar->IsAttached())
+ if (IsAttached() && GetMenuBar()->IsAttached())
{
//
// Otherwise, the chane won't be visible
//
- m_menuBar->Refresh();
+ GetMenuBar()->Refresh();
}
//
{
if (m_invokingWindow != NULL)
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return GetMenuBar()->GetFrame();
return NULL;
} // end of wxMenu::GetWindow