statusbar handling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -57,6 +57,11 @@ protected:
|
|||||||
virtual void PositionMenuBar();
|
virtual void PositionMenuBar();
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
// override to update statusbar position when the frame size changes
|
||||||
|
virtual void PositionStatusBar();
|
||||||
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||||
};
|
};
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
|
#include "wx/statusbr.h"
|
||||||
#endif // WX_PRECOMP
|
#endif // WX_PRECOMP
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -68,6 +69,9 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
|||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
PositionMenuBar();
|
PositionMenuBar();
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
PositionStatusBar();
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@@ -88,6 +92,20 @@ void wxFrame::PositionMenuBar()
|
|||||||
|
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
void wxFrame::PositionStatusBar()
|
||||||
|
{
|
||||||
|
if ( m_frameStatusBar )
|
||||||
|
{
|
||||||
|
wxCoord heightBar = m_frameStatusBar->GetSize().y;
|
||||||
|
m_frameStatusBar->SetSize(0, GetClientSize().y,
|
||||||
|
GetClientSize().x, heightBar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
wxPoint wxFrame::GetClientAreaOrigin() const
|
wxPoint wxFrame::GetClientAreaOrigin() const
|
||||||
{
|
{
|
||||||
wxPoint pt = wxFrameBase::GetClientAreaOrigin();
|
wxPoint pt = wxFrameBase::GetClientAreaOrigin();
|
||||||
@@ -105,12 +123,20 @@ wxPoint wxFrame::GetClientAreaOrigin() const
|
|||||||
void wxFrame::DoGetClientSize(int *width, int *height) const
|
void wxFrame::DoGetClientSize(int *width, int *height) const
|
||||||
{
|
{
|
||||||
wxFrameBase::DoGetClientSize(width, height);
|
wxFrameBase::DoGetClientSize(width, height);
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
if ( m_frameMenuBar && height )
|
if ( m_frameMenuBar && height )
|
||||||
{
|
{
|
||||||
(*height) -= m_frameMenuBar->GetSize().y;
|
(*height) -= m_frameMenuBar->GetSize().y;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
if ( m_frameStatusBar && height )
|
||||||
|
{
|
||||||
|
(*height) -= m_frameStatusBar->GetSize().y;
|
||||||
|
}
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrame::DoSetClientSize(int width, int height)
|
void wxFrame::DoSetClientSize(int width, int height)
|
||||||
@@ -121,6 +147,14 @@ void wxFrame::DoSetClientSize(int width, int height)
|
|||||||
height += m_frameMenuBar->GetSize().y;
|
height += m_frameMenuBar->GetSize().y;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
if ( m_frameStatusBar )
|
||||||
|
{
|
||||||
|
height += m_frameStatusBar->GetSize().y;
|
||||||
|
}
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
wxFrameBase::DoSetClientSize(width, height);
|
wxFrameBase::DoSetClientSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user