]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/sashwin.cpp
Fixed a crash when deleting the last timer
[wxWidgets.git] / src / generic / sashwin.cpp
index 3581f95e065311557929e58483f9b7b41164e6c0..b9e554da14270c6530724dd1dedcbcd6f8051b30 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 
 #include "wx/dcscreen.h"
+#include "wx/dcclient.h"
 #include "wx/sashwin.h"
 #include "wx/laywin.h"
 
@@ -94,7 +95,7 @@ void wxSashWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
 
 void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
 {
-    wxCoord x, y;
+    wxCoord x = 0, y = 0;
     event.GetPosition(&x, &y);
 
     wxSashEdgePosition sashHit = SashHitTest(x, y);
@@ -276,11 +277,11 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
 
         dragRect = wxRect(x, y, newWidth, newHeight);
 
-        wxSashEvent event(GetId(), edge);
-        event.SetEventObject(this);
-        event.SetDragStatus(status);
-        event.SetDragRect(dragRect);
-        GetEventHandler()->ProcessEvent(event);
+        wxSashEvent eventSash(GetId(), edge);
+        eventSash.SetEventObject(this);
+        eventSash.SetDragStatus(status);
+        eventSash.SetDragRect(dragRect);
+        GetEventHandler()->ProcessEvent(eventSash);
     }
     else if ( event.LeftUp() )
     {