Example #1
0
 public void Window_OnMouseMove(object sender, MouseEventArgs args) {
     if (closing) {
         Point point = args.GetPosition(this);
         bool anyChanged = false;
         if (point.x == 3 && point.y == 0) {
             if (!showClosingGlyph) {
                 showClosingGlyph = true;
                 anyChanged = true;
             }
         } else {
             if (showClosingGlyph) {
                 showClosingGlyph = false;
                 anyChanged = true;
             }
         }
         if (anyChanged)
             Invalidate();
         args.Handled = true;
     }
     if (moving) {
         Point parentPoint = args.GetPosition(getWindowsHost());
         Vector vector = new Vector(parentPoint.X - movingStartPoint.x, parentPoint.Y - movingStartPoint.y);
         X = movingStartX + vector.X;
         Y = movingStartY + vector.Y;
         getWindowsHost().Invalidate();
         args.Handled = true;
     }
     if (resizing) {
         Point parentPoint = args.GetPosition(getWindowsHost());
         int deltaWidth = parentPoint.X - resizingStartPoint.x;
         int deltaHeight = parentPoint.Y - resizingStartPoint.y;
         int width = resizingStartWidth + deltaWidth;
         int height = resizingStartHeight + deltaHeight;
         bool anyChanged = false;
         if (width >= 4) {
             this.Width = width;
             anyChanged = true;
         }
         if (height >= 3) {
             this.Height = height;
             anyChanged = true;
         }
         if (anyChanged)
             Invalidate();
         args.Handled = true;
     }
 }
Example #2
0
 private void OnMouseMove( object sender, MouseEventArgs args )
 {
     if ( args.LeftButton == MouseButtonState.Pressed ) {
         int index = args.GetPosition( this ).Y;
         if ( !disabledItemsIndexes.Contains(index) && SelectedItemIndex != index ) {
             SelectedItemIndex = index;
             Invalidate(  );
         }
     }
     args.Handled = true;
 }