Be more paranoid about parent window possibly being NULL (partly fixes #11195).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2009-09-13 15:47:25 +00:00
parent 9a2e7481ba
commit 76738ae8b7
2 changed files with 10 additions and 4 deletions

View File

@@ -63,8 +63,11 @@ bool wxSpinButton::Create(
m_windowId = NewControlId();
else
m_windowId = vId;
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
if (pParent)
{
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
}
SetName(rsName);
SetParent(pParent);
m_windowStyle = lStyle;

View File

@@ -126,8 +126,11 @@ bool wxSpinCtrl::Create( wxWindow* pParent,
m_windowId = NewControlId();
else
m_windowId = vId;
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
if (pParent)
{
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
}
SetName(rsName);
SetParent(pParent);
m_windowStyle = lStyle;