]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
1. wxGetOsDescription() function added
[wxWidgets.git] / src / msw / combobox.cpp
index 6dcb98fccb441a07f0398e8263e5a2941ffd88ee..0593b9342e9d804ce2ce2af40e1f41fc0b5a533d 100644 (file)
@@ -38,11 +38,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 {
   if (param == CBN_SELCHANGE)
   {
-    wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
-    event.SetInt(GetSelection());
-    event.SetEventObject(this);
-    event.SetString(GetStringSelection());
-    ProcessCommand(event);
+    if (GetSelection() > -1)
+    {
+        wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
+        event.SetInt(GetSelection());
+        event.SetEventObject(this);
+        event.SetString(GetStringSelection());
+        ProcessCommand(event);
+    }
 
     return TRUE;
   }
@@ -107,12 +110,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
   if ( want3D || wxStyleHasBorder(m_windowStyle) )
     msStyle |= WS_BORDER;
 
-  m_hWnd = (WXHWND)::CreateWindowEx(exStyle, T("COMBOBOX"), NULL,
+  m_hWnd = (WXHWND)::CreateWindowEx(exStyle, wxT("COMBOBOX"), NULL,
                    msStyle,
                    0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
                    wxGetInstance(), NULL);
 
-  wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create combobox") );
+  wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create combobox") );
 
 /*
 #if wxUSE_CTL3D