use a virtual function instead of wxDynamicCast(wxMDIParentFrame) in wxFrame code: this not only makes the code cleaner but should also remove the last dependency on MDI code when linking wx applications not using MDI
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -580,24 +580,9 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
||||
#if wxUSE_MENUS
|
||||
if (m_fsStyle & wxFULLSCREEN_NOMENUBAR)
|
||||
{
|
||||
WXHMENU menu = m_hMenu;
|
||||
|
||||
#if wxUSE_MDI_ARCHITECTURE
|
||||
wxMDIParentFrame *frame = wxDynamicCast(this, wxMDIParentFrame);
|
||||
if (frame)
|
||||
{
|
||||
wxMDIChildFrame *child = frame->GetActiveChild();
|
||||
if (child)
|
||||
{
|
||||
menu = child->GetWinMenu();
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_MDI_ARCHITECTURE
|
||||
|
||||
if (menu)
|
||||
{
|
||||
::SetMenu(GetHwnd(), (HMENU)menu);
|
||||
}
|
||||
const WXHMENU hmenu = MSWGetActiveMenu();
|
||||
if ( hmenu )
|
||||
::SetMenu(GetHwnd(), (HMENU)hmenu);
|
||||
}
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user