use kind, not id, of a menu item to test whether it's a separator: this allows having separators with ids other than wxID_SEPARATOR in case it's useful to distinguish between them (patch 1929039)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-04-06 15:55:42 +00:00
parent 9b8d875536
commit fa7134b05a
7 changed files with 9 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ void wxMenuItem::Init()
ResetOwnerDrawn();
// switch ownerdraw back on if using a non default margin
if ( GetId() != wxID_SEPARATOR )
if ( !IsSeparator() )
SetMarginWidth(GetMarginWidth());
// tell the owner drawing code to show the accel string as well
@@ -203,7 +203,7 @@ bool wxMenuItem::IsChecked() const
{
// fix that RTTI is always getting the correct state (separators cannot be checked, but the call below
// returns true
if ( GetId() == wxID_SEPARATOR )
if ( IsSeparator() )
return false ;
int flag = ::GetMenuState(GetHMenuOf(m_parentMenu), GetMSWId(), MF_BYCOMMAND);