예제 #1
0
 private void OnWidgetMouseDown(object sender, WidgetMouseEventArgs e)
 {
     if (Widget.IsEnabled && e.Buttons == MouseButtons.Left)
     {
         _lastLocation = e.Location;
         IsMoving      = true;
     }
 }
예제 #2
0
 private void OnWidgetMouseMove(object sender, WidgetMouseEventArgs e)
 {
     if (IsMoving)
     {
         var offsetX = e.Location.X - _lastLocation.X;
         var offsetY = e.Location.Y - _lastLocation.Y;
         if (offsetX != 0 || offsetY != 0)
         {
             var offset = Move(new Point(offsetX, offsetY));
             _lastLocation.Offset(offset);
             OnRegionMoved(RegionChangedEventArgs.ForLocationChanged);
         }
     }
 }
예제 #3
0
 private void OnWidgetMouseUp(object sender, WidgetMouseEventArgs e)
 {
     IsMoving = false;
 }