]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/ogl/src/canvas.cpp
Added test for sprintf and vsnprintf to fix string.cpp for non-GNU systems.
[wxWidgets.git] / utils / ogl / src / canvas.cpp
index d0ca4ee7c84f655a5d1e7cdf9c15c510e1fb06c2..edc898be237505a02aa2ce14219701454490b242 100644 (file)
 #include <wx/wx.h>
 #endif
 
-#ifdef PROLOGIO
 #include <wx/wxexpr.h>
-#endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -122,8 +120,8 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
   // from, this may not be an intentional drag at all.
   if (dragging)
   {
-    int dx = abs(dc.LogicalToDeviceX(x - m_firstDragX));
-    int dy = abs(dc.LogicalToDeviceY(y - m_firstDragY));
+    int dx = abs(dc.LogicalToDeviceX((long) (x - m_firstDragX)));
+    int dy = abs(dc.LogicalToDeviceY((long) (y - m_firstDragY)));
     if (m_checkTolerance && (dx <= GetDiagram()->GetMouseTolerance()) && (dy <= GetDiagram()->GetMouseTolerance()))
     {
       return;
@@ -275,6 +273,13 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
         m_draggedShape = NULL;
         m_dragState = NoDragging;
       }
+      else if (event.LeftDClick())
+      {
+        nearest_object->GetEventHandler()->OnLeftDoubleClick((double)x, (double)y, keys, attachment);
+
+        m_draggedShape = NULL;
+        m_dragState = NoDragging;
+      }
       else if (event.RightDown())
       {
         m_draggedShape = nearest_object;