+wxEMPTY_HANDLERS_TABLE(wxFrame)
+
+wxCONSTRUCTOR_6( wxFrame, wxWindow*, Parent, wxWindowID, Id, wxString, Title, \
+ wxPoint, Position, wxSize, Size, long, WindowStyle)
+
+// ----------------------------------------------------------------------------
+// construction/destruction
+// ----------------------------------------------------------------------------
+
+wxFrameBase::wxFrameBase()
+{
+#if wxUSE_MENUS
+ m_frameMenuBar = NULL;
+#endif // wxUSE_MENUS
+
+#if wxUSE_TOOLBAR
+ m_frameToolBar = NULL;
+#endif // wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
+ m_frameStatusBar = NULL;
+#endif // wxUSE_STATUSBAR
+
+ m_statusBarPane = 0;
+}
+
+wxFrameBase::~wxFrameBase()
+{
+ // this destructor is required for Darwin
+}
+
+wxFrame *wxFrameBase::New(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
+{
+ return new wxFrame(parent, id, title, pos, size, style, name);
+}
+
+void wxFrameBase::DeleteAllBars()
+{
+#if wxUSE_MENUS
+ wxDELETE(m_frameMenuBar);
+#endif // wxUSE_MENUS
+
+#if wxUSE_STATUSBAR
+ wxDELETE(m_frameStatusBar);
+#endif // wxUSE_STATUSBAR
+
+#if wxUSE_TOOLBAR
+ wxDELETE(m_frameToolBar);
+#endif // wxUSE_TOOLBAR
+}
+
+bool wxFrameBase::IsOneOfBars(const wxWindow *win) const
+{
+#if wxUSE_MENUS
+ if ( win == GetMenuBar() )
+ return true;
+#endif // wxUSE_MENUS
+
+#if wxUSE_STATUSBAR
+ if ( win == GetStatusBar() )
+ return true;
+#endif // wxUSE_STATUSBAR
+
+#if wxUSE_TOOLBAR
+ if ( win == GetToolBar() )
+ return true;
+#endif // wxUSE_TOOLBAR
+
+ wxUnusedVar(win);
+
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// wxFrame size management: we exclude the areas taken by menu/status/toolbars
+// from the client area, so the client area is what's really available for the
+// frame contents
+// ----------------------------------------------------------------------------
+
+// get the origin of the client area in the client coordinates
+wxPoint wxFrameBase::GetClientAreaOrigin() const
+{
+ wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
+
+#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__)
+ wxToolBar *toolbar = GetToolBar();
+ if ( toolbar && toolbar->IsShown() )
+ {
+ int w, h;
+ toolbar->GetSize(&w, &h);
+
+ if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
+ {
+ pt.x += w;
+ }
+ else
+ {
+ pt.y += h;
+ }
+ }
+#endif // wxUSE_TOOLBAR
+
+ return pt;
+}
+
+// ----------------------------------------------------------------------------
+// misc
+// ----------------------------------------------------------------------------
+
+#if wxUSE_MENUS
+
+bool wxFrameBase::ProcessCommand(int id)
+{
+ wxMenuItem* const item = FindItemInMenuBar(id);
+ if ( !item )
+ return false;
+
+ return ProcessCommand(item);
+}
+
+bool wxFrameBase::ProcessCommand(wxMenuItem *item)
+{
+ wxCHECK_MSG( item, false, wxS("Menu item can't be NULL") );
+
+ if (!item->IsEnabled())
+ return true;
+
+ if ((item->GetKind() == wxITEM_RADIO) && item->IsChecked() )
+ return true;
+
+ int checked;
+ if (item->IsCheckable())
+ {
+ item->Toggle();
+
+ // use the new value
+ checked = item->IsChecked();
+ }
+ else // Uncheckable item.
+ {
+ checked = -1;
+ }
+
+ wxMenu* const menu = item->GetMenu();
+ wxCHECK_MSG( menu, false, wxS("Menu item should be attached to a menu") );
+
+ return menu->SendEvent(item->GetId(), checked);
+}
+
+#endif // wxUSE_MENUS
+
+// 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
+}
+
+// ----------------------------------------------------------------------------
+// event handlers for status bar updates from menus
+// ----------------------------------------------------------------------------
+
+#if wxUSE_MENUS && wxUSE_STATUSBAR
+
+void wxFrameBase::OnMenuHighlight(wxMenuEvent& event)
+{
+#if wxUSE_STATUSBAR
+ (void)ShowMenuHelp(event.GetMenuId());
+#endif // wxUSE_STATUSBAR
+}
+
+void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
+{
+ if ( !ShouldUpdateMenuFromIdle() )
+ {
+ // as we didn't update the menus from idle time, do it now
+ DoMenuUpdates(event.GetMenu());
+ }
+}
+
+void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event))
+{
+ DoGiveHelp(wxEmptyString, false);
+}
+
+#endif // wxUSE_MENUS && wxUSE_STATUSBAR
+
+// Implement internal behaviour (menu updating on some platforms)
+void wxFrameBase::OnInternalIdle()
+{
+ wxTopLevelWindow::OnInternalIdle();
+
+#if wxUSE_MENUS
+ if ( ShouldUpdateMenuFromIdle() && wxUpdateUIEvent::CanUpdate(this) )
+ DoMenuUpdates();
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// status bar stuff
+// ----------------------------------------------------------------------------
+
+#if wxUSE_STATUSBAR
+
+wxStatusBar* wxFrameBase::CreateStatusBar(int number,
+ long style,
+ wxWindowID id,
+ const wxString& name)