// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "framebase.h"
#endif
{
wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
-#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__)
+#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && !defined(__WXWINCE__)
wxToolBar *toolbar = GetToolBar();
if ( toolbar && toolbar->IsShown() )
{
// Implement internal behaviour (menu updating on some platforms)
void wxFrameBase::OnInternalIdle()
{
+ wxTopLevelWindow::OnInternalIdle();
+
#if wxUSE_MENUS && wxUSE_IDLEMENUUPDATES
if (wxUpdateUIEvent::CanUpdate(this))
DoMenuUpdates();
#endif
}
-void wxFrameBase::OnMenuOpen(wxMenuEvent& WXUNUSED(event))
+void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
{
#if wxUSE_MENUS && !wxUSE_IDLEMENUUPDATES
- DoMenuUpdates();
+ DoMenuUpdates(event.GetMenu());
#endif
}
wxCHECK_MSG( !m_frameToolBar, (wxToolBar *)NULL,
wxT("recreating toolbar in wxFrame") );
+ if ( style == -1 )
+ {
+ // use default style
+ //
+ // NB: we don't specify the default value in the method declaration
+ // because
+ // a) this allows us to have different defaults for different
+ // platforms (even if we don't have them right now)
+ // b) we don't need to include wx/toolbar.h in the header then
+ style = wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT;
+ }
+
m_frameToolBar = OnCreateToolBar(style, id, name);
return m_frameToolBar;
#if wxUSE_MENUS
// update all menus
-void wxFrameBase::DoMenuUpdates()
+void wxFrameBase::DoMenuUpdates(wxMenu* menu)
{
+ wxEvtHandler* source = GetEventHandler();
wxMenuBar* bar = GetMenuBar();
- if ( bar != NULL )
+ if (menu)
+ menu->UpdateUI(source);
+ else if ( bar != NULL )
{
- wxEvtHandler* source = GetEventHandler();
int nCount = bar->GetMenuCount();
for (int n = 0; n < nCount; n++)
bar->GetMenu(n)->UpdateUI(source);