]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ctrlsub.cpp
don't crash on weird line endings like \r\r\n
[wxWidgets.git] / src / common / ctrlsub.cpp
index d2bc3e8ef26e4b26978bf83d05d5e8f0813118ba..c94e8f2ca3a7edc06b3b093642bea01603f9a421 100644 (file)
@@ -172,6 +172,23 @@ void *wxItemContainer::GetClientData(unsigned int n) const
     return DoGetItemClientData(n);
 }
 
+// ============================================================================
+// wxControlWithItems implementation
+// ============================================================================
+
+void wxControlWithItems::InitCommandEventWithItems(wxCommandEvent& event, int n)
+{
+    InitCommandEvent(event);
+
+    if ( n != wxNOT_FOUND )
+    {
+        if ( HasClientObjectData() )
+            event.SetClientObject(GetClientObject(n));
+        else if ( HasClientUntypedData() )
+            event.SetClientData(GetClientData(n));
+    }
+}
+
 wxControlWithItems::~wxControlWithItems()
 {
     // this destructor is required for Darwin