X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9de1027152fd1bd3e8c0d9b5e9f4b19b0bbc3a10..5d7792236f7e4fcbb94cdc2a5213e0c5788e8c28:/src/os2/spinctrl.cpp diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 6fb50893aa..c9d8187d94 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -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; @@ -296,7 +299,7 @@ wxSpinCtrl* wxSpinCtrl::GetSpinForTextCtrl( // sanity check wxASSERT_MSG( pSpin->m_hWndBuddy == hWndBuddy, - _T("wxSpinCtrl has incorrect buddy HWND!") ); + wxT("wxSpinCtrl has incorrect buddy HWND!") ); return pSpin; } // end of wxSpinCtrl::GetSpinForTextCtrl @@ -333,7 +336,7 @@ void wxSpinCtrl::OnChar ( InitCommandEvent(vEvent); vEvent.SetString(sVal); vEvent.SetInt(GetValue()); - if (GetEventHandler()->ProcessEvent(vEvent)) + if (HandleWindowEvent(vEvent)) return; break; } @@ -351,7 +354,7 @@ void wxSpinCtrl::OnChar ( vEventNav.SetDirection(!rEvent.ShiftDown()); vEventNav.SetWindowChange(rEvent.ControlDown()); vEventNav.SetEventObject(this); - if (GetParent()->GetEventHandler()->ProcessEvent(vEventNav)) + if (GetParent()->HandleWindowEvent(vEventNav)) return; } break; @@ -373,7 +376,7 @@ void wxSpinCtrl::OnSpinChange( vEvent.SetEventObject(this); vEvent.SetInt(rEventSpin.GetPosition()); - (void)GetEventHandler()->ProcessEvent(vEvent); + (void)HandleWindowEvent(vEvent); if (rEventSpin.GetSkipped()) { vEvent.Skip(); @@ -406,7 +409,7 @@ bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd, vEvent.SetString(sVal); vEvent.SetInt(GetValue()); - return (GetEventHandler()->ProcessEvent(vEvent)); + return (HandleWindowEvent(vEvent)); } case SPBN_SETFOCUS: @@ -417,7 +420,7 @@ bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd, ); vEvent.SetEventObject(this); - return(GetEventHandler()->ProcessEvent(vEvent)); + return(HandleWindowEvent(vEvent)); } default: break; @@ -456,7 +459,7 @@ void wxSpinCtrl::SetValue( { long lVal; - lVal = atol((char*)rsText.c_str()); + lVal = atol(rsText.c_str()); wxSpinButton::SetValue(lVal); } // end of wxSpinCtrl::SetValue