Exemplo n.º 1
0
        private void lstMarkers_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Marker         marker   = (Marker)lstMarkers.SelectedItem;
            CustomLineForm lineForm = new CustomLineForm(marker, getUnitConverter(), settings.Theme);

            if (lineForm.ShowDialog(this.Owner) == DialogResult.OK)
            {
                MarkerCollection.Markers.Remove(marker);
                lstMarkers.Items.Remove(marker);
                this.Owner.Invalidate();
            }
        }
Exemplo n.º 2
0
        private void RulerForm_MouseClick(object sender, MouseEventArgs e)
        {
            Marker marker = CustomMarkers.GetMarker(e.Location, RestrictSize);

            if (marker != Marker.Default)
            {
                CustomLineForm lineForm = new CustomLineForm(marker,
                                                             getUnitConverter(), Settings.Theme);
                if (lineForm.ShowDialog(this) == DialogResult.OK)
                {
                    CustomMarkers.Markers.Remove(marker);
                    this.Invalidate();
                }
            }
        }
Exemplo n.º 3
0
        private void RulerForm_MouseClick(object sender, MouseEventArgs e)
        {
            var position = Vertical ? e.Y : e.X;
            var line     = CustomLines.Where((val) => Math.Abs(position - val) <= 2).FirstOrDefault();

            if (line != default(int))
            {
                CustomLineForm lineForm = new CustomLineForm(line,
                                                             getUnitConverter(), Settings.Theme);
                if (lineForm.ShowDialog(this) == DialogResult.OK)
                {
                    CustomLines.Remove(line);
                    this.Invalidate();
                }
            }
        }
Exemplo n.º 4
0
 private void RulerForm_MouseClick(object sender, MouseEventArgs e)
 {
     if (!Settings.HideRulerScale)
     {
         using (Matrix matrix = painter.GetTransformationMatrix())
         {
             Point[] points = new[] { e.Location };
             matrix.TransformPoints(points);
             Marker marker = CustomMarkers.GetMarker(points[0], RestrictSize);
             if (marker != Marker.Default)
             {
                 CustomLineForm lineForm = new CustomLineForm(marker,
                                                              getUnitConverter(), Settings.Theme);
                 if (lineForm.ShowDialog(this) == DialogResult.OK)
                 {
                     CustomMarkers.RemoveMarker(marker);
                     this.Invalidate();
                 }
             }
         }
     }
 }