]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
Added missing wx_aui.dsp file
[wxWidgets.git] / src / msw / combobox.cpp
index f893200c1afab0fb39fde9aaa62c5f95f1f57796..41b73b447894ab39d9ed317dbd9c2d72aa572da1 100644 (file)
     // for wxEVT_COMMAND_TEXT_ENTER
     #include "wx/textctrl.h"
     #include "wx/app.h"
+    #include "wx/brush.h"
 #endif
 
-#include "wx/brush.h"
 #include "wx/clipbrd.h"
 #include "wx/msw/private.h"
 
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
+
 #if wxUSE_TOOLTIPS
-    #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
-        #include <commctrl.h>
-    #endif
     #include "wx/tooltip.h"
 #endif // wxUSE_TOOLTIPS
 
@@ -208,28 +208,12 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
             }
             break;
 
-        // deal with tooltips here
-#if wxUSE_TOOLTIPS && defined(TTN_NEEDTEXT)
-        case WM_NOTIFY:
-            {
-                wxCHECK_MSG( win, 0, _T("should have a parent") );
-
-                NMHDR* hdr = (NMHDR *)lParam;
-                if ( hdr->code == TTN_NEEDTEXT )
-                {
-                    wxToolTip *tooltip = win->GetToolTip();
-                    if ( tooltip )
-                    {
-                        TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
-                        ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
-                    }
-
-                    // processed
-                    return 0;
-                }
-            }
+        case WM_CUT:
+        case WM_COPY:
+        case WM_PASTE:
+            if( win->HandleClipboardEvent( message ) )
+                return 0;
             break;
-#endif // wxUSE_TOOLTIPS
     }
 
     return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
@@ -282,9 +266,12 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
             if ( wParam == VK_RETURN )
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
-                InitCommandEvent(event);
+
+                const int sel = GetSelection();
+                event.SetInt(sel);
                 event.SetString(GetValue());
-                event.SetInt(GetSelection());
+                InitCommandEventWithItems(event, sel);
+
                 if ( ProcessCommand(event) )
                 {
                     // don't let the event through to the native control
@@ -336,9 +323,10 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
             value = GetStringSelection();
             {
                 wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
-                event.SetEventObject(this);
                 event.SetInt(sel);
                 event.SetString(value);
+                InitCommandEventWithItems(event, sel);
+
                 ProcessCommand(event);
             }
 
@@ -349,7 +337,6 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
         case CBN_EDITCHANGE:
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
-                event.SetEventObject(this);
 
                 // if sel != -1, value was already initialized above
                 if ( sel == -1 )
@@ -358,6 +345,8 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
                 }
 
                 event.SetString(value);
+                InitCommandEventWithItems(event, sel);
+
                 ProcessCommand(event);
             }
             break;