Implemented Enable for wxMenuBar to avoid assert
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -124,6 +124,7 @@ public:
|
|||||||
virtual void EnableTop( size_t pos, bool flag );
|
virtual void EnableTop( size_t pos, bool flag );
|
||||||
virtual void SetLabelTop( size_t pos, const wxString& label );
|
virtual void SetLabelTop( size_t pos, const wxString& label );
|
||||||
virtual wxString GetLabelTop( size_t pos ) const;
|
virtual wxString GetLabelTop( size_t pos ) const;
|
||||||
|
virtual bool Enable( bool enable = TRUE );
|
||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
WXHMENU Create();
|
WXHMENU Create();
|
||||||
|
@@ -617,6 +617,17 @@ void wxMenuBar::EnableTop(size_t pos, bool enable)
|
|||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxMenuBar::Enable( bool enable)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") );
|
||||||
|
size_t i;
|
||||||
|
for (i = 0; i < GetMenuCount(); i++)
|
||||||
|
{
|
||||||
|
EnableTop(i, enable);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
|
void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") );
|
wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") );
|
||||||
|
Reference in New Issue
Block a user