Avoid a crash due to OnSize being called before initialisation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4188,6 +4188,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
Create();
|
Create();
|
||||||
SetInitialSize(size);
|
SetInitialSize(size);
|
||||||
|
CalcDimensions();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -6905,8 +6906,11 @@ void wxGrid::Refresh(bool eraseb, const wxRect* rect)
|
|||||||
|
|
||||||
void wxGrid::OnSize( wxSizeEvent& WXUNUSED(event) )
|
void wxGrid::OnSize( wxSizeEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
|
if (m_targetWindow != this) // check whether initialisation has been done
|
||||||
|
{
|
||||||
// update our children window positions and scrollbars
|
// update our children window positions and scrollbars
|
||||||
CalcDimensions();
|
CalcDimensions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGrid::OnKeyDown( wxKeyEvent& event )
|
void wxGrid::OnKeyDown( wxKeyEvent& event )
|
||||||
|
Reference in New Issue
Block a user