]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
fixes fo inheriting colours set with SetOwnBackround()
[wxWidgets.git] / src / msw / combobox.cpp
index 46c52b5358f4effb887e5e805fee3961ba779825..a9bb62cb5eb9ecbf4b996e7e51e7b902e79d4c80 100644 (file)
@@ -110,9 +110,13 @@ wxBEGIN_HANDLERS_TABLE(wxComboBox)
 wxEND_HANDLERS_TABLE()
 
 wxCONSTRUCTOR_5( wxComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size )
+
 #else
+
 IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
 
+#endif
+
 BEGIN_EVENT_TABLE(wxComboBox, wxControl)
     EVT_MENU(wxID_CUT, wxComboBox::OnCut)
     EVT_MENU(wxID_COPY, wxComboBox::OnCopy)
@@ -131,8 +135,6 @@ BEGIN_EVENT_TABLE(wxComboBox, wxControl)
     EVT_UPDATE_UI(wxID_SELECTALL, wxComboBox::OnUpdateSelectAll)
 END_EVENT_TABLE()
 
-#endif
-
 // ----------------------------------------------------------------------------
 // function prototypes
 // ----------------------------------------------------------------------------
@@ -249,6 +251,7 @@ WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                 m_value = wxEmptyString;
             else
                 m_value = GetString(wParam);
+            m_selectionOld = -1;
             break;
     }
 
@@ -268,7 +271,13 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
                 InitCommandEvent(event);
                 event.SetString(GetValue());
                 event.SetInt(GetSelection());
-                ProcessCommand(event);
+                if ( ProcessCommand(event) )
+                {
+                    // don't let the event through to the native control
+                    // because it doesn't need it and may generate an annoying
+                    // beep if it gets it
+                    return true;
+                }
             }
 
             return HandleChar(wParam, lParam, true /* isASCII */);
@@ -686,8 +695,8 @@ void wxComboBox::GetSelection(long* from, long* to) const
 }
 
 int wxComboBox::GetSelection() const
-{   
-    return wxChoice::GetSelection();    
+{
+    return wxChoice::GetSelection();
 }
 
 // ----------------------------------------------------------------------------