]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
make control children of a panel and not directly the frame
[wxWidgets.git] / src / msw / combobox.cpp
index 41b73b447894ab39d9ed317dbd9c2d72aa572da1..8d049cb564694ca5be8e68c6e92986cfb570b426 100644 (file)
@@ -42,6 +42,7 @@
 
 // include <commctrl.h> "properly"
 #include "wx/msw/wrapcctl.h"
+#include "wx/msw/wrapshl.h"
 
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
@@ -321,6 +322,12 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
             // CBN_EDITCHANGE below
             sel = GetSelection();
             value = GetStringSelection();
+
+            // this string is going to become the new combobox value soon but
+            // we need it to be done right now, otherwise the event handler
+            // could get a wrong value when it calls our GetValue()
+            ::SetWindowText(GetHwnd(), value);
+
             {
                 wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
                 event.SetInt(sel);
@@ -411,8 +418,14 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
     // edit control, we must subclass it as well
     if ( !(style & wxCB_READONLY) )
     {
-        gs_wndprocEdit = wxSetWindowProc((HWND)GetEditHWND(),
-                                         wxComboEditWndProc);
+        const HWND hwndEdit = (HWND)GetEditHWND();
+
+        gs_wndprocEdit = wxSetWindowProc(hwndEdit, wxComboEditWndProc);
+
+        if ( style & wxCB_FILENAME )
+        {
+            wxEnableFileNameAutoComplete(hwndEdit);
+        }
     }
 
     // and finally, show the control