unsuccessful attempts to fix wxMenuBar positioning under wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -749,7 +749,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
|
|||||||
wxWindow::DoGetClientSize( width, height );
|
wxWindow::DoGetClientSize( width, height );
|
||||||
if (height)
|
if (height)
|
||||||
{
|
{
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
/* menu bar */
|
/* menu bar */
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
@@ -758,7 +758,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
|
|||||||
else
|
else
|
||||||
(*height) -= wxPLACE_HOLDER;
|
(*height) -= wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
/* status bar */
|
/* status bar */
|
||||||
@@ -802,7 +802,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
|
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
/* menu bar */
|
/* menu bar */
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
@@ -811,7 +811,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
|
|||||||
else
|
else
|
||||||
height += wxPLACE_HOLDER;
|
height += wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
/* status bar */
|
/* status bar */
|
||||||
@@ -900,7 +900,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
* this hurts in the eye, but I don't want to call SetSize()
|
* this hurts in the eye, but I don't want to call SetSize()
|
||||||
* because I don't want to call any non-native functions here. */
|
* because I don't want to call any non-native functions here. */
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
int xx = m_miniEdge;
|
int xx = m_miniEdge;
|
||||||
@@ -917,7 +917,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
xx, yy, ww, hh );
|
xx, yy, ww, hh );
|
||||||
client_area_y_offset += hh;
|
client_area_y_offset += hh;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
|
if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
|
||||||
@@ -925,7 +925,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
{
|
{
|
||||||
int xx = m_miniEdge;
|
int xx = m_miniEdge;
|
||||||
int yy = m_miniEdge + m_miniTitle;
|
int yy = m_miniEdge + m_miniTitle;
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
if (!m_menuBarDetached)
|
if (!m_menuBarDetached)
|
||||||
@@ -933,7 +933,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
else
|
else
|
||||||
yy += wxPLACE_HOLDER;
|
yy += wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
m_frameToolBar->m_x = xx;
|
m_frameToolBar->m_x = xx;
|
||||||
m_frameToolBar->m_y = yy;
|
m_frameToolBar->m_y = yy;
|
||||||
@@ -1035,9 +1035,9 @@ void wxFrameGTK::OnInternalIdle()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
|
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -749,7 +749,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
|
|||||||
wxWindow::DoGetClientSize( width, height );
|
wxWindow::DoGetClientSize( width, height );
|
||||||
if (height)
|
if (height)
|
||||||
{
|
{
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
/* menu bar */
|
/* menu bar */
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
@@ -758,7 +758,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
|
|||||||
else
|
else
|
||||||
(*height) -= wxPLACE_HOLDER;
|
(*height) -= wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
/* status bar */
|
/* status bar */
|
||||||
@@ -802,7 +802,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
|
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
/* menu bar */
|
/* menu bar */
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
@@ -811,7 +811,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
|
|||||||
else
|
else
|
||||||
height += wxPLACE_HOLDER;
|
height += wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
/* status bar */
|
/* status bar */
|
||||||
@@ -900,7 +900,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
* this hurts in the eye, but I don't want to call SetSize()
|
* this hurts in the eye, but I don't want to call SetSize()
|
||||||
* because I don't want to call any non-native functions here. */
|
* because I don't want to call any non-native functions here. */
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
int xx = m_miniEdge;
|
int xx = m_miniEdge;
|
||||||
@@ -917,7 +917,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
xx, yy, ww, hh );
|
xx, yy, ww, hh );
|
||||||
client_area_y_offset += hh;
|
client_area_y_offset += hh;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
|
if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
|
||||||
@@ -925,7 +925,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
{
|
{
|
||||||
int xx = m_miniEdge;
|
int xx = m_miniEdge;
|
||||||
int yy = m_miniEdge + m_miniTitle;
|
int yy = m_miniEdge + m_miniTitle;
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
if (!m_menuBarDetached)
|
if (!m_menuBarDetached)
|
||||||
@@ -933,7 +933,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
else
|
else
|
||||||
yy += wxPLACE_HOLDER;
|
yy += wxPLACE_HOLDER;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
|
|
||||||
m_frameToolBar->m_x = xx;
|
m_frameToolBar->m_x = xx;
|
||||||
m_frameToolBar->m_y = yy;
|
m_frameToolBar->m_y = yy;
|
||||||
@@ -1035,9 +1035,9 @@ void wxFrameGTK::OnInternalIdle()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS_NATIVE
|
||||||
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS_NATIVE
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
|
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -84,10 +84,19 @@ void wxFrame::PositionMenuBar()
|
|||||||
{
|
{
|
||||||
// the menubar is positioned above the client size, hence the negative
|
// the menubar is positioned above the client size, hence the negative
|
||||||
// y coord
|
// y coord
|
||||||
m_frameMenuBar->SetSize(0, -m_frameMenuBar->GetSize().y,
|
wxCoord heightMbar = m_frameMenuBar->GetSize().y;
|
||||||
GetClientSize().x, -1);
|
m_frameMenuBar->SetSize(0,
|
||||||
|
|
||||||
|
// FIXME: why doesn't this work as expected in wxGTK??
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
0,
|
||||||
|
#else
|
||||||
|
-heightMbar,
|
||||||
|
#endif
|
||||||
|
GetClientSize().x, heightMbar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
wxPoint wxFrame::GetClientAreaOrigin() const
|
wxPoint wxFrame::GetClientAreaOrigin() const
|
||||||
|
Reference in New Issue
Block a user