+
+void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+#if wxUSE_CONSTRAINTS
+ if (GetAutoLayout()) Layout();
+#endif
+}
+
+void wxPanel::SetFocus()
+{
+ // If the panel gets the focus *by way of getting it set directly*
+ // we move the focus to the first window that can get it.
+
+ wxNode *node = GetChildren().First();
+ while (node)
+ {
+ wxWindow *child = (wxWindow*) node->Data();
+ if (child->AcceptsFocus())
+ {
+ m_winLastFocused = child; // should be redundant, but it is not
+ child->SetFocus();
+ return;
+ }
+ node = node->Next();
+ }
+
+ m_winLastFocused = (wxWindow*) NULL;
+
+ wxWindow::SetFocus();
+}
+