wxFrame::OnSize() calls Layout() if GetAutoLayout()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-07-10 17:45:38 +00:00
parent 2049ba38ad
commit ed7a557b53
2 changed files with 126 additions and 122 deletions

View File

@@ -252,32 +252,34 @@ void wxFrame::GtkOnSize( int width, int height )
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{ {
wxWindow *child = NULL; if ( GetAutoLayout() )
int noChildren = 0; Layout();
for(wxNode *node = GetChildren()->First(); node; node = node->Next()) else {
{ // do we have exactly one child?
wxWindow *win = (wxWindow *)node->Data(); wxWindow *child = NULL;
if (!win->IsKindOf(CLASSINFO(wxFrame)) && for(wxNode *node = GetChildren()->First(); node; node = node->Next())
!win->IsKindOf(CLASSINFO(wxDialog))
/* && (win != m_frameMenuBar) &&
(win != m_frameStatusBar) not in m_children anyway */
)
{ {
child = win; wxWindow *win = (wxWindow *)node->Data();
noChildren ++; if (!win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog))
#if 0 // not in m_children anyway
&& (win != m_frameMenuBar) &&
(win != m_frameStatusBar)
#endif
)
{
if ( child ) // it's the second one: do nothing
return;
child = win;
};
}; };
}
;
if ((child) && (noChildren == 1)) // yes: set it's size to fill all the frame
{
int client_x, client_y; int client_x, client_y;
GetClientSize(&client_x, &client_y); GetClientSize(&client_x, &client_y);
child->SetSize( 1, 1, client_x-2, client_y); child->SetSize( 1, 1, client_x-2, client_y);
} }
;
}; };
void SetInvokingWindow( wxMenu *menu, wxWindow *win ) void SetInvokingWindow( wxMenu *menu, wxWindow *win )

View File

@@ -252,32 +252,34 @@ void wxFrame::GtkOnSize( int width, int height )
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{ {
wxWindow *child = NULL; if ( GetAutoLayout() )
int noChildren = 0; Layout();
for(wxNode *node = GetChildren()->First(); node; node = node->Next()) else {
{ // do we have exactly one child?
wxWindow *win = (wxWindow *)node->Data(); wxWindow *child = NULL;
if (!win->IsKindOf(CLASSINFO(wxFrame)) && for(wxNode *node = GetChildren()->First(); node; node = node->Next())
!win->IsKindOf(CLASSINFO(wxDialog))
/* && (win != m_frameMenuBar) &&
(win != m_frameStatusBar) not in m_children anyway */
)
{ {
child = win; wxWindow *win = (wxWindow *)node->Data();
noChildren ++; if (!win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog))
#if 0 // not in m_children anyway
&& (win != m_frameMenuBar) &&
(win != m_frameStatusBar)
#endif
)
{
if ( child ) // it's the second one: do nothing
return;
child = win;
};
}; };
}
;
if ((child) && (noChildren == 1)) // yes: set it's size to fill all the frame
{
int client_x, client_y; int client_x, client_y;
GetClientSize(&client_x, &client_y); GetClientSize(&client_x, &client_y);
child->SetSize( 1, 1, client_x-2, client_y); child->SetSize( 1, 1, client_x-2, client_y);
} }
;
}; };
void SetInvokingWindow( wxMenu *menu, wxWindow *win ) void SetInvokingWindow( wxMenu *menu, wxWindow *win )