Fix showing MDI child from wxDocManager::ActivateDocument().
This fix has 2 components: first, call Raise() instead of simple SetFocus() from ActivateDocument() as this corresponds better to what we want to do here. And second, override Raise() to call Activate() in wxMDIChildFrame to ensure that it works as expected as raising an MDI child doesn't work otherwise in most ports (with the exceptions for wxOSX which, on the contrary, needs a small fix to preserve the existing working Raise() behaviour). Closes #13946. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70790 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e709239889
commit
3285e9a347
@ -181,6 +181,11 @@ public:
|
||||
// return true.
|
||||
virtual bool IsTopNavigationDomain() const { return true; }
|
||||
|
||||
// Raising any frame is supposed to show it but wxFrame Raise()
|
||||
// implementation doesn't work for MDI child frames in most forms so
|
||||
// forward this to Activate() which serves the same purpose by default.
|
||||
virtual void Raise() { Activate(); }
|
||||
|
||||
protected:
|
||||
wxMDIParentFrame *m_mdiParent;
|
||||
};
|
||||
|
@ -1414,7 +1414,7 @@ void wxDocManager::ActivateDocument(wxDocument *doc)
|
||||
|
||||
view->Activate(true);
|
||||
if ( wxWindow *win = view->GetFrame() )
|
||||
win->SetFocus();
|
||||
win->Raise();
|
||||
}
|
||||
|
||||
wxDocument *wxDocManager::CreateDocument(const wxString& pathOrig, long flags)
|
||||
|
@ -417,7 +417,9 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating)
|
||||
// MDI operations
|
||||
void wxMDIChildFrame::Activate()
|
||||
{
|
||||
Raise ();
|
||||
// The base class method calls Activate() so skip it to avoid infinite
|
||||
// recursion and go directly to the real Raise() implementation.
|
||||
wxFrame::Raise();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user