don't show the status bar after restoring normal view after full screen if it had been hidden all along (bug 1071354); code cleanup: removed unused variables, reduced #ifdefs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
ff2b312fc8
commit
b01a88e050
@ -142,11 +142,6 @@ protected:
|
|||||||
static bool m_useNativeStatusBar;
|
static bool m_useNativeStatusBar;
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
// Data to save/restore when calling ShowFullScreen
|
|
||||||
int m_fsStatusBarFields; // 0 for no status bar
|
|
||||||
int m_fsStatusBarHeight;
|
|
||||||
int m_fsToolBarHeight;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
WXHWND m_hwndToolTip;
|
WXHWND m_hwndToolTip;
|
||||||
|
@ -173,11 +173,6 @@ void wxFrame::Init()
|
|||||||
m_hwndToolTip = 0;
|
m_hwndToolTip = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Data to save/restore when calling ShowFullScreen
|
|
||||||
m_fsStatusBarFields = 0;
|
|
||||||
m_fsStatusBarHeight = 0;
|
|
||||||
m_fsToolBarHeight = 0;
|
|
||||||
|
|
||||||
m_wasMinimized = false;
|
m_wasMinimized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,92 +434,75 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
// Pass true to show full screen, false to restore.
|
// Pass true to show full screen, false to restore.
|
||||||
bool wxFrame::ShowFullScreen(bool show, long style)
|
bool wxFrame::ShowFullScreen(bool show, long style)
|
||||||
{
|
{
|
||||||
|
// TODO-CE: add support for CE
|
||||||
|
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
||||||
if ( IsFullScreen() == show )
|
if ( IsFullScreen() == show )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
|
// zap the toolbar, menubar, and statusbar if needed
|
||||||
|
//
|
||||||
|
// TODO: hide commandbar for WINCE_WITH_COMMANDBAR
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
|
|
||||||
#if defined(WINCE_WITH_COMMANDBAR)
|
|
||||||
// TODO: hide commandbar
|
|
||||||
#else
|
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
if (theToolBar)
|
|
||||||
theToolBar->GetSize(NULL, &m_fsToolBarHeight);
|
|
||||||
|
|
||||||
// zap the toolbar, menubar, and statusbar
|
|
||||||
|
|
||||||
if ((style & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
|
if ((style & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
|
||||||
{
|
{
|
||||||
theToolBar->SetSize(wxDefaultCoord,0);
|
if ( theToolBar->IsShown() )
|
||||||
theToolBar->Show(false);
|
{
|
||||||
|
theToolBar->SetSize(wxDefaultCoord,0);
|
||||||
|
theToolBar->Show(false);
|
||||||
|
}
|
||||||
|
else // prevent it from being restored later
|
||||||
|
{
|
||||||
|
style &= ~wxFULLSCREEN_NOTOOLBAR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // __WXWINCE__
|
|
||||||
#endif // wxUSE_TOOLBAR
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
#if defined(__WXMICROWIN__)
|
|
||||||
#elif defined(__WXWINCE__)
|
|
||||||
// TODO: make it work for WinCE
|
|
||||||
#else
|
|
||||||
if (style & wxFULLSCREEN_NOMENUBAR)
|
if (style & wxFULLSCREEN_NOMENUBAR)
|
||||||
SetMenu((HWND)GetHWND(), (HMENU) NULL);
|
SetMenu((HWND)GetHWND(), (HMENU) NULL);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
wxStatusBar *theStatusBar = GetStatusBar();
|
wxStatusBar *theStatusBar = GetStatusBar();
|
||||||
if (theStatusBar)
|
|
||||||
theStatusBar->GetSize(NULL, &m_fsStatusBarHeight);
|
|
||||||
|
|
||||||
// Save the number of fields in the statusbar
|
// Save the number of fields in the statusbar
|
||||||
if ((style & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
|
if ((style & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
|
||||||
{
|
{
|
||||||
//m_fsStatusBarFields = theStatusBar->GetFieldsCount();
|
if ( theStatusBar->IsShown() )
|
||||||
//SetStatusBar((wxStatusBar*) NULL);
|
theStatusBar->Show(false);
|
||||||
//delete theStatusBar;
|
else
|
||||||
theStatusBar->Show(false);
|
style &= ~wxFULLSCREEN_NOSTATUSBAR;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_fsStatusBarFields = 0;
|
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
}
|
}
|
||||||
else
|
else // restore to normal
|
||||||
{
|
{
|
||||||
|
// restore the toolbar, menubar, and statusbar if we had hid them
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
|
||||||
// TODO: show commandbar
|
|
||||||
#else
|
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
|
|
||||||
// restore the toolbar, menubar, and statusbar
|
if ((m_fsStyle & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
|
||||||
if (theToolBar && (m_fsStyle & wxFULLSCREEN_NOTOOLBAR))
|
|
||||||
{
|
{
|
||||||
theToolBar->SetSize(wxDefaultCoord, m_fsToolBarHeight);
|
|
||||||
theToolBar->Show(true);
|
theToolBar->Show(true);
|
||||||
}
|
}
|
||||||
#endif // __WXWINCE__
|
|
||||||
#endif // wxUSE_TOOLBAR
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
|
if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && m_hMenu)
|
||||||
|
::SetMenu(GetHwnd(), (HMENU)m_hMenu);
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
if ( m_fsStyle & wxFULLSCREEN_NOSTATUSBAR )
|
wxStatusBar *theStatusBar = GetStatusBar();
|
||||||
|
|
||||||
|
if ((m_fsStyle & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
|
||||||
{
|
{
|
||||||
//CreateStatusBar(m_fsStatusBarFields);
|
theStatusBar->Show(true);
|
||||||
if (GetStatusBar())
|
PositionStatusBar();
|
||||||
{
|
|
||||||
GetStatusBar()->Show(true);
|
|
||||||
PositionStatusBar();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
#if defined(__WXMICROWIN__)
|
|
||||||
#elif defined(__WXWINCE__)
|
|
||||||
// TODO: make it work for WinCE
|
|
||||||
#else
|
|
||||||
if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
|
|
||||||
SetMenu((HWND)GetHWND(), (HMENU)m_hMenu);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif // !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
||||||
|
|
||||||
return wxFrameBase::ShowFullScreen(show, style);
|
return wxFrameBase::ShowFullScreen(show, style);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user