]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/spinctrl.cpp
Ensure that the default wxWebView backends are registered.
[wxWidgets.git] / src / os2 / spinctrl.cpp
index 72d677a720fb1af74c162dbca49fa5e6f213e6cb..a826c0957dde3b056f732d817d040514428f92e5 100644 (file)
@@ -40,8 +40,6 @@ extern void  wxAssociateWinWithHandle( HWND         hWnd
 static WXFARPROC fnWndProcSpinCtrl = (WXFARPROC)NULL;
 wxArraySpins                        wxSpinCtrl::m_svAllSpins;
 
-IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
-
 BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
     EVT_CHAR(wxSpinCtrl::OnChar)
     EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
@@ -126,8 +124,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;
@@ -325,7 +326,7 @@ void wxSpinCtrl::OnChar (
     {
         case WXK_RETURN:
             {
-                wxCommandEvent              vEvent( wxEVT_COMMAND_TEXT_ENTER
+                wxCommandEvent              vEvent( wxEVT_TEXT_ENTER
                                                    ,m_windowId
                                                   );
                 wxString                    sVal = wxGetWindowText(m_hWndBuddy);
@@ -367,7 +368,7 @@ void wxSpinCtrl::OnSpinChange(
   wxSpinEvent&                      rEventSpin
 )
 {
-    wxCommandEvent                  vEvent( wxEVT_COMMAND_SPINCTRL_UPDATED
+    wxCommandEvent                  vEvent( wxEVT_SPINCTRL
                                            ,GetId()
                                           );
 
@@ -399,7 +400,7 @@ bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd,
     {
         case SPBN_CHANGE:
         {
-            wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() );
+            wxCommandEvent vEvent( wxEVT_TEXT, GetId() );
             vEvent.SetEventObject(this);
 
             wxString sVal = wxGetWindowText(m_hWndBuddy);