Implement wxMenuBar::EnableTop() for wxMSW and wxGTK.
This method was only available in wxUniv before and just always returned true in the other ports. Implement it for wxMSW and wxGTK too now and document it. Also add a unit test. Closes #795. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -833,6 +833,17 @@ void wxMenuBar::EnableTop(size_t pos, bool enable)
|
||||
Refresh();
|
||||
}
|
||||
|
||||
bool wxMenuBar::IsEnabledTop(size_t pos) const
|
||||
{
|
||||
wxCHECK_MSG( IsAttached(), true,
|
||||
wxT("doesn't work with unattached menubars") );
|
||||
|
||||
wxMenuItem* const item = m_rootMenu->FindItemByPosition(pos+firstMenuPos);
|
||||
wxCHECK_MSG( item, false, wxT("invalid menu index") );
|
||||
|
||||
return item->IsEnabled();
|
||||
}
|
||||
|
||||
bool wxMenuBar::Enable(bool enable)
|
||||
{
|
||||
wxCHECK_MSG( IsAttached(), false, wxT("doesn't work with unattached menubars") );
|
||||
|
||||
Reference in New Issue
Block a user