Changeset 2596


Ignore:
Timestamp:
Feb 5, 2011, 3:23:45 PM (11 years ago)
Author:
matkovic
Message:

-ConnectorView: Instead MouseLeftButtonDown to drag now please use MouseRightButtonDown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/View/Container/PluginContainerView.xaml.cs

    r2594 r2596  
    479479                if (ConnectorMouseLeftButtonDown != null)
    480480                    ConnectorMouseLeftButtonDown.Invoke(this, new ConnectorViewEventArgs() { connector = connector });
     481
     482            e.Handled = true;
    481483        }
    482484
    483485        void connector_MouseLeave(object sender, MouseEventArgs e)
    484486        {
    485             if (e.LeftButton == MouseButtonState.Pressed)
     487            if (e.RightButton == MouseButtonState.Pressed)
    486488            {
    487489                ConnectorView connector = (sender as ConnectorView);
    488490                DataObject dragData = new DataObject("connector", connector);
     491                DragDrop.AddQueryContinueDragHandler(this, QueryContinueDragHandler);
    489492                DragDrop.DoDragDrop(connector.Parent, dragData, DragDropEffects.Move);
     493            }
     494            e.Handled = true;
     495        }
     496
     497        private void QueryContinueDragHandler(Object source, QueryContinueDragEventArgs e)
     498        {
     499            e.Handled = true;
     500
     501            // Check if we need to bail
     502            if (e.EscapePressed)
     503            {
     504                e.Action = DragAction.Cancel;
     505                return;
     506            }
     507
     508            // Now, default to actually having dropped
     509            e.Action = DragAction.Drop;
     510
     511            if ((e.KeyStates & DragDropKeyStates.LeftMouseButton) != DragDropKeyStates.None)
     512            {
     513                // Still dragging with Left Mouse Button
     514                e.Action = DragAction.Continue;
     515            }
     516            else if ((e.KeyStates & DragDropKeyStates.RightMouseButton) != DragDropKeyStates.None)
     517            {
     518                // Still dragging with Right Mouse Button
     519                e.Action = DragAction.Continue;
    490520            }
    491521        }
Note: See TracChangeset for help on using the changeset viewer.