simply switch to using const methods.
 - EVT_XXX macros are now type-safe; code that uses wrong type for event
   handler's argument will no longer compile.
-- Identical functionality of wxFileDialog::ParseWildcard and 
-  wxGenericDirCtrl::ParseFilter is now accessible in ::wxParseWildcard
+- Identical functionality of wxFileDialog::ParseWildcard,
+  wxGenericDirCtrl::ParseFilter, Motif and MSW parsing native dialogs
+  is now accessible in ::wxParseCommonDialogsFilter
 
 
 
 
 \helpref{wxNow}{wxnow}\\
 \helpref{wxOnAssert}{wxonassert}\\
 \helpref{wxOpenClipboard}{wxopenclipboard}\\
-\helpref{wxParseWildcard}{wxparsewildcard}\\
+\helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
 \helpref{wxPathOnly}{wxpathonly}\\
 \helpref{wxPostDelete}{wxpostdelete}\\
 \helpref{wxPostEvent}{wxpostevent}\\
 supported (Unix) and doesn't have effect for the other ones.
 
 
-\membersection{::wxParseWildcard}\label{wxparsewildcard}
+\membersection{::wxParseCommonDialogsFilter}\label{wxparsecommondialogsfilter}
 
-\func{int}{wxParseWildcard}{\param{const wxString\& }{wildCard}, \param{wxArrayString\& }{descriptions}, \param{wxArrayString\& }{filters}}
+\func{int}{wxParseCommonDialogsFilter}{\param{const wxString\& }{wildCard}, \param{wxArrayString\& }{descriptions}, \param{wxArrayString\& }{filters}}
 
 Parses the \arg{wildCard}, returning the number of filters.
 Returns 0 if none or if there's a problem.
 The arrays will contain an equal number of items found before the error.
+On platforms where native dialogs handle only one filter per entry,
+entries in arrays are automatically adjusted.
 \arg{wildCard} is in the form:
 \begin{verbatim}
  "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
 
 // The arrays will contain an equal number of items found before the error.
 // wildCard is in the form:
 // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
-WXDLLIMPEXP_BASE int wxParseWildcard(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
+WXDLLIMPEXP_BASE int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
 
 // ----------------------------------------------------------------------------
 // classes
 
 #ifdef __WXMOTIF__
                     _T("C++ files (*.cpp)|*.cpp")
 #else
-                    _T("C++ files (*.h;*.cpp)|*.h;*.cpp")
+                    _T("C++ files (*.cpp;*.h)|*.cpp;*.h")
 #endif
                  );
 
 #ifdef __WXMOTIF__
                     _T("C++ files (*.cpp)|*.cpp");
 #else
-                    _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
+                    _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h");
 #endif
     wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
                         wxEmptyString, wxEmptyString, wildcards,
                     _T("Testing open file dialog"),
                     wxEmptyString,
                     wxEmptyString,
-                    _T("C++ files (*.h;*.cpp)|*.h;*.cpp")
+                    _T("C++ files (*.cpp;*.h)|*.cpp;*.h")
                  );
 
     dialog.SetDirectory(wxGetHomeDir());
 
 void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) )
 {
-    wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
+    wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h");
     wxGenericFileDialog dialog(this, _T("Testing open multiple file dialog"),
                         wxEmptyString, wxEmptyString, wildcards,
                         wxMULTIPLE);
 
 
 // Parses the filterStr, returning the number of filters.
 // Returns 0 if none or if there's a problem.
-// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg"
+// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpeg"
 
-int WXDLLEXPORT wxParseWildcard(const wxString& filterStr, wxArrayString& descriptions, wxArrayString& filters)
+int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, wxArrayString& descriptions, wxArrayString& filters)
 {
     descriptions.Clear();
     filters.Clear();
         if ( pos == wxNOT_FOUND )
         {
             // if there are no '|'s at all in the string just take the entire
-            // string as filter
+            // string as filter and make description empty for later autocompletion
             if ( filters.IsEmpty() )
             {
-                descriptions.Add(filterStr);
+                descriptions.Add(wxEmptyString);
                 filters.Add(filterStr);
             }
             else
         filters.Add(filter);
     }
 
+#if defined(__WXMOTIF__)
+    // split it so there is one wildcard per entry
+    for( size_t i = 0 ; i < descriptions.GetCount() ; i++ )
+    {
+        pos = filters[i].Find(wxT(';'));
+        if (pos != wxNOT_FOUND)
+        {
+            // first split only filters
+            descriptions.Insert(descriptions[i],i+1);
+            filters.Insert(filters[i].Mid(pos+1),i+1);
+            filters[i]=filters[i].Left(pos);
+
+            // autoreplace new filter in description with pattern:
+            //     C/C++ Files(*.cpp;*.c;*.h)|*.cpp;*.c;*.h
+            // cause split into:
+            //     C/C++ Files(*.cpp)|*.cpp
+            //     C/C++ Files(*.c;*.h)|*.c;*.h
+            // and next iteration cause another split into:
+            //     C/C++ Files(*.cpp)|*.cpp
+            //     C/C++ Files(*.c)|*.c
+            //     C/C++ Files(*.h)|*.h
+            for ( size_t k=i;k<i+2;k++ )
+            {
+                pos = descriptions[k].Find(filters[k]);
+                if (pos != wxNOT_FOUND)
+                {
+                    wxString before = descriptions[k].Left(pos);
+                    wxString after = descriptions[k].Mid(pos+filters[k].Len());
+                    pos = before.Find(_T('('),true);
+                    if (pos>before.Find(_T(')'),true))
+                    {
+                        before = before.Left(pos+1);
+                        before << filters[k];
+                        pos = after.Find(_T(')'));
+                        int pos1 = after.Find(_T('('));
+                        if (pos != wxNOT_FOUND && (pos<pos1 || pos1==wxNOT_FOUND))
+                        {
+                            before << after.Mid(pos);
+                            descriptions[k] = before;
+                        }
+                    }
+                }
+            }
+        }
+    }
+#endif
+
+    // autocompletion
+    for( size_t j = 0 ; j < descriptions.GetCount() ; j++ )
+    {
+        if ( descriptions[j] == wxEmptyString && filters[j] != wxEmptyString )
+        {
+            descriptions[j].Printf(_("Files (%s)"), filters[j].c_str());
+        }
+    }
+
     return filters.GetCount();
 }
 
 
                                     wxArrayString& descriptions,
                                     wxArrayString& filters)
 {
-    return ::wxParseWildcard(filterStr, descriptions, filters);
+    return ::wxParseCommonDialogsFilter(filterStr, descriptions, filters);
 }
 #endif // WXWIN_COMPATIBILITY_2_4
 
 
         wxArrayString descriptions, filters;
         // don't care about errors, handled already by wxFileDialog
-        (void)wxParseWildcard(filter2, descriptions, filters);
+        (void)wxParseCommonDialogsFilter(filter2, descriptions, filters);
         for (size_t n=0; n<filters.GetCount(); n++)
                 {
             if (filters[n].Contains(defaultExtension))
 
 bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description)
 {
     wxArrayString filters, descriptions;
-    int count = wxParseWildcard(filterStr, filters, descriptions);
+    int count = wxParseCommonDialogsFilter(filterStr, descriptions, filters);
     if (count > 0 && n < count)
     {
         filter = filters[n];
 // filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg"
 int wxGenericDirCtrl::ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions)
 {
-    return wxParseWildcard(filterStr, descriptions, filters );
+    return wxParseCommonDialogsFilter(filterStr, descriptions, filters );
 }
 #endif // WXWIN_COMPATIBILITY_2_4
 
 {
     Clear();
     wxArrayString descriptions, filters;
-    size_t n = (size_t) wxParseWildcard(filter, filters, descriptions);
+    size_t n = (size_t) wxParseCommonDialogsFilter(filter, filters, descriptions);
 
     if (n > 0 && defaultFilter < (int) n)
     {
 
 
     // interpret wildcards
     wxArrayString wildDescriptions, wildFilters;
-    if ( !wxParseWildcard(m_wildCard, wildDescriptions, wildFilters) )
+    if ( !wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters) )
     {
         wxFAIL_MSG( wxT("Wrong file type description") );
     }
 
 
     of.Flags             = msw_flags;
 
+    wxArrayString wildDescriptions, wildFilters;
 
-    //=== Like Alejandro Sierra's wildcard modification >>===================
-    /*
-       In wxFileSelector you can put, instead of a single wild_card,
-       pairs of strings separated by '|'.
-       The first string is a description, and the
-       second is the wild card. You can put any number of pairs.
+    size_t items = wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters);
 
-       eg.  "description1 (*.ex1)|*.ex1|description2 (*.ex2)|*.ex2"
+    wxASSERT_MSG( items > 0 , _T("empty wildcard list") );
 
-       If you put a single wild card, it works as before the modification.
-     */
-    //=======================================================================
-
-    wxString theFilter;
-    if ( wxStrlen(m_wildCard) == 0 )
-        theFilter = wxString(wxT("*.*"));
-    else
-        theFilter = m_wildCard ;
     wxString filterBuffer;
 
-    if ( !wxStrchr( theFilter, wxT('|') ) ) {    // only one filter ==> default text
-        filterBuffer.Printf(_("Files (%s)|%s"),
-                            theFilter.c_str(), theFilter.c_str());
-    }
-    else {                                // more then one filter
-        filterBuffer = theFilter;
-
+    for (i = 0; i < items ; i++)
+    {
+        filterBuffer += wildDescriptions[i];
+        filterBuffer += wxT("|");
+        filterBuffer += wildFilters[i];
+        filterBuffer += wxT("|");
     }
 
-    filterBuffer += wxT("|");
     // Replace | with \0
     for (i = 0; i < filterBuffer.Len(); i++ ) {
         if ( filterBuffer.GetChar(i) == wxT('|') ) {
         }
     }
 
-    of.lpstrFilter  = (LPTSTR)(const wxChar *)filterBuffer;
+    of.lpstrFilter  = (LPTSTR)filterBuffer.c_str();
     of.nFilterIndex = m_filterIndex + 1;
 
     //=== Setting defaultFileName >>=========================================
 
 // // The arrays will contain an equal number of items found before the error.
 // // wildCard is in the form:
 // // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
-// int wxParseWildcard(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
+// int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
 
 #if defined(__WXMSW__) || defined(__WXMAC__)
 long wxGetFreeMemory();