]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
String changes for translations,
[wxWidgets.git] / src / msw / choice.cpp
index 9c7c335392f680ea16ac986d63231d27178dc207..90714d1e5ad0a88d8dc52708e1aa06e5276b6cd8 100644 (file)
@@ -317,11 +317,19 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
         return FALSE;
     }
 
-    wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
-    event.SetInt(GetSelection());
-    event.SetEventObject(this);
-    event.SetString(GetStringSelection());
-    ProcessCommand(event);
+    int n = GetSelection();
+    if (n > -1)
+    {
+        wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
+        event.SetInt(n);
+        event.SetEventObject(this);
+        event.SetString(GetStringSelection());
+        if ( HasClientObjectData() )
+            event.SetClientObject( GetClientObject(n) );
+        else if ( HasClientUntypedData() )
+            event.SetClientData( GetClientData(n) );
+        ProcessCommand(event);
+    }
 
     return TRUE;
 }