Esempio n. 1
0
void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
{
    if ( !ShouldUpdateMenuFromIdle() )
    {
        // as we didn't update the menus from idle time, do it now
        DoMenuUpdates(event.GetMenu());
    }
}
Esempio n. 2
0
// Implement internal behaviour (menu updating on some platforms)
void wxFrameBase::OnInternalIdle()
{
    wxTopLevelWindow::OnInternalIdle();

#if wxUSE_MENUS
    if ( ShouldUpdateMenuFromIdle() && wxUpdateUIEvent::CanUpdate(this) )
        DoMenuUpdates();
#endif
}
Esempio n. 3
0
// Do the UI update processing for this window. This is
// provided for the application to call if it wants to
// force a UI update, particularly for the menus and toolbar.
void wxFrameBase::UpdateWindowUI(long flags)
{
    wxWindowBase::UpdateWindowUI(flags);

#if wxUSE_TOOLBAR
    if (GetToolBar())
        GetToolBar()->UpdateWindowUI(flags);
#endif

#if wxUSE_MENUS
    if (GetMenuBar())
    {
        // If coming from an idle event, we only want to update the menus if
        // we're in the wxUSE_IDLEMENUUPDATES configuration, otherwise they
        // will be update when the menu is opened later
        if ( !(flags & wxUPDATE_UI_FROMIDLE) || ShouldUpdateMenuFromIdle() )
            DoMenuUpdates();
    }
#endif // wxUSE_MENUS
}