made wxPanel be auto layout aware

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-10-20 04:57:45 +00:00
parent 78d50441dd
commit 27dc7e21d9
2 changed files with 18 additions and 7 deletions

View File

@@ -78,6 +78,8 @@ public:
// set the focus to the first child if we get it
void OnFocus(wxFocusEvent& event);
void OnSize(wxSizeEvent& event);
// called by wxWindow whenever it gets focus
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
wxWindow *GetLastFocus() const { return m_winLastFocused; }

View File

@@ -36,6 +36,7 @@ BEGIN_EVENT_TABLE(wxPanel, wxWindow)
EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged)
EVT_SET_FOCUS(wxPanel::OnFocus)
EVT_NAVIGATION_KEY(wxPanel::OnNavigationKey)
EVT_SIZE(wxPanel::OnSize)
END_EVENT_TABLE()
#endif
@@ -166,6 +167,14 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
event.Skip();
}
void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event))
{
#if wxUSE_CONSTRAINTS
if (GetAutoLayout()) Layout();
#endif
}
void wxPanel::OnFocus(wxFocusEvent& event)
{
if ( m_winLastFocused )