]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/spinctlg.cpp
Add markup support to wxMSW wxButton and show it in the sample.
[wxWidgets.git] / src / generic / spinctlg.cpp
index 2628efefa62c8f49fe7ae6564b0301854d2c3d72..796f89efb584df931bf6755adff014c32ea464ef 100644 (file)
@@ -64,7 +64,7 @@ class wxSpinCtrlTextGeneric : public wxTextCtrl
 public:
     wxSpinCtrlTextGeneric(wxSpinCtrlGenericBase *spin, const wxString& value, long style=0)
         : wxTextCtrl(spin->GetParent(), wxID_ANY, value, wxDefaultPosition, wxDefaultSize,
 public:
     wxSpinCtrlTextGeneric(wxSpinCtrlGenericBase *spin, const wxString& value, long style=0)
         : wxTextCtrl(spin->GetParent(), wxID_ANY, value, wxDefaultPosition, wxDefaultSize,
-                     ( style & wxALIGN_MASK ) | wxTE_PROCESS_ENTER)
+                     style & wxALIGN_MASK)
     {
         m_spin = spin;
 
     {
         m_spin = spin;
 
@@ -81,12 +81,6 @@ public:
         m_spin = NULL;
     }
 
         m_spin = NULL;
     }
 
-    void OnTextEnter(wxCommandEvent& event)
-    {
-        if (m_spin)
-            m_spin->OnTextEnter(event);
-    }
-
     void OnChar( wxKeyEvent &event )
     {
         if (m_spin)
     void OnChar( wxKeyEvent &event )
     {
         if (m_spin)
@@ -96,10 +90,7 @@ public:
     void OnKillFocus(wxFocusEvent& event)
     {
         if (m_spin)
     void OnKillFocus(wxFocusEvent& event)
     {
         if (m_spin)
-        {
-            if ( m_spin->SyncSpinToText() )
-                m_spin->DoSendEvent();
-        }
+            m_spin->OnTextLostFocus();
 
         event.Skip();
     }
 
         event.Skip();
     }
@@ -111,8 +102,6 @@ private:
 };
 
 BEGIN_EVENT_TABLE(wxSpinCtrlTextGeneric, wxTextCtrl)
 };
 
 BEGIN_EVENT_TABLE(wxSpinCtrlTextGeneric, wxTextCtrl)
-    EVT_TEXT_ENTER(wxID_ANY, wxSpinCtrlTextGeneric::OnTextEnter)
-
     EVT_CHAR(wxSpinCtrlTextGeneric::OnChar)
 
     EVT_KILL_FOCUS(wxSpinCtrlTextGeneric::OnKillFocus)
     EVT_CHAR(wxSpinCtrlTextGeneric::OnChar)
 
     EVT_KILL_FOCUS(wxSpinCtrlTextGeneric::OnKillFocus)
@@ -367,11 +356,10 @@ void wxSpinCtrlGenericBase::OnSpinButton(wxSpinEvent& event)
         DoSendEvent();
 }
 
         DoSendEvent();
 }
 
-void wxSpinCtrlGenericBase::OnTextEnter(wxCommandEvent& event)
+void wxSpinCtrlGenericBase::OnTextLostFocus()
 {
     SyncSpinToText();
     DoSendEvent();
 {
     SyncSpinToText();
     DoSendEvent();
-    event.Skip();
 }
 
 void wxSpinCtrlGenericBase::OnTextChar(wxKeyEvent& event)
 }
 
 void wxSpinCtrlGenericBase::OnTextChar(wxKeyEvent& event)