-
- if ( child ) {
- // we have exactly one child - set it's size to fill the whole frame
- int clientW, clientH;
- GetClientSize(&clientW, &clientH);
-
- int x = 0;
- int y = 0;
-
- child->SetSize(x, y, clientW, clientH);
- }
-}
-
-// Default activation behaviour - set the focus for the first child
-// subwindow found.
-void wxFrame::OnActivate(wxActivateEvent& event)
-{
- for(wxNode *node = GetChildren().First(); node; node = node->Next())
- {
- // Find a child that's a subwindow, but not a dialog box.
- wxWindow *child = (wxWindow *)node->Data();
- if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
- !child->IsKindOf(CLASSINFO(wxDialog)))
- {
- child->SetFocus();
- return;
- }
- }
-}
-
-// The default implementation for the close window event.
-void wxFrame::OnCloseWindow(wxCloseEvent& event)
-{
- Destroy();
-}
-
-// Destroy the window (delayed, if a managed window)
-bool wxFrame::Destroy()
-{
- if (!wxPendingDelete.Member(this))
- wxPendingDelete.Append(this);
- return TRUE;
-}
-
-// Default menu selection behaviour - display a help string
-void wxFrame::OnMenuHighlight(wxMenuEvent& event)
-{
- if (GetStatusBar())
- {
- int menuId = event.GetMenuId();
- if ( menuId != -1 )
- {
- wxMenuBar *menuBar = GetMenuBar();
- if (menuBar && menuBar->FindItem(menuId))
- {
- // set status text even if the string is empty - this will at
- // least remove the string from the item which was previously
- // selected
- SetStatusText(menuBar->GetHelpString(menuId));
- }
- }
- }
-}
-
-wxMenuBar *wxFrame::GetMenuBar() const
-{
- return m_frameMenuBar;
-}
-
-bool wxFrame::ProcessCommand(int id)
-{
- wxMenuBar *bar = GetMenuBar() ;
- if ( !bar )
- return FALSE;
-
- wxMenuItem *item = bar->FindItemForId(id);
- if ( !item )
- return FALSE;
-
- if ( item->IsCheckable() )
- {
- bar->Check(id, !bar->IsChecked(id)) ;
- }
-
- wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
- commandEvent.SetInt( id );
- commandEvent.SetEventObject( this );
-
- return GetEventHandler()->ProcessEvent(commandEvent);
-}
-
-// Checks if there is a toolbar, and returns the first free client position
-wxPoint wxFrame::GetClientAreaOrigin() const
-{
- wxPoint pt(0, 0);
- if (GetToolBar())