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:
@@ -82,6 +82,7 @@ private:
|
||||
CPPUNIT_TEST_SUITE( MenuTestCase );
|
||||
CPPUNIT_TEST( FindInMenubar );
|
||||
CPPUNIT_TEST( FindInMenu );
|
||||
CPPUNIT_TEST( EnableTop );
|
||||
CPPUNIT_TEST( Count );
|
||||
CPPUNIT_TEST( Labels );
|
||||
CPPUNIT_TEST( RadioItems );
|
||||
@@ -92,6 +93,7 @@ private:
|
||||
|
||||
void FindInMenubar();
|
||||
void FindInMenu();
|
||||
void EnableTop();
|
||||
void Count();
|
||||
void Labels();
|
||||
void RadioItems();
|
||||
@@ -258,6 +260,16 @@ void MenuTestCase::FindInMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestCase::EnableTop()
|
||||
{
|
||||
wxMenuBar* const bar = m_frame->GetMenuBar();
|
||||
CPPUNIT_ASSERT( bar->IsEnabledTop(0) );
|
||||
bar->EnableTop( 0, false );
|
||||
CPPUNIT_ASSERT( !bar->IsEnabledTop(0) );
|
||||
bar->EnableTop( 0, true );
|
||||
CPPUNIT_ASSERT( bar->IsEnabledTop(0) );
|
||||
}
|
||||
|
||||
void MenuTestCase::Count()
|
||||
{
|
||||
wxMenuBar* bar = m_frame->GetMenuBar();
|
||||
|
Reference in New Issue
Block a user