{
public:
wxPanel() { Init(); }
-
+
// Old-style constructor (no default values for coordinates to avoid
// ambiguity with the new one)
wxPanel(wxWindow *parent,
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
}
-
+
// Constructor
wxPanel(wxWindow *parent,
wxWindowID id = -1,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr);
-
+
// Sends an OnInitDialog event, which in turns transfers data to
// to the dialog via validators.
virtual void InitDialog();
// responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
-
+
// process a keyboard navigation message (Tab traversal)
void OnNavigationKey(wxNavigationKeyEvent& event);
-
+
// 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; }
EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged)
EVT_SET_FOCUS(wxPanel::OnFocus)
EVT_NAVIGATION_KEY(wxPanel::OnNavigationKey)
+ EVT_SIZE(wxPanel::OnSize)
END_EVENT_TABLE()
#endif
wxWindow *winFocus = event.GetCurrentFocus();
if (!winFocus)
winFocus = wxWindow::FindFocus();
-
+
if (!winFocus)
{
event.Skip();
// we don't want to tab into a different dialog or frame
if ( focussed_child_of_p->IsTopLevel() )
break;
-
+
if ( wxDynamicCast(p, wxPanel) )
{
event.SetCurrentFocus( focussed_child_of_p );
event.Skip();
}
+
+void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+#if wxUSE_CONSTRAINTS
+ if (GetAutoLayout()) Layout();
+#endif
+}
+
void wxPanel::OnFocus(wxFocusEvent& event)
{
if ( m_winLastFocused )