Exemplo n.º 1
0
 /// <summary>
 /// When we stylus down, we begin a new selection box
 /// </summary>
 /// <param name="sender"></param> Ignored :(
 /// <param name="e"></param> MouseEventArgs, contains mouse location
 protected override void InkCanvas_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     if (!e.Inverted)
     {
         BeginSelection(e.GetPosition(sketchPanel.InkCanvas));
     }
 }
Exemplo n.º 2
0
        private void imageColorPicker_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
        {
            if (Source != null)
            {
                Point s = e.GetPosition(this);
                Point p = PointToScreen(s);

                if (!dc_present)
                {
                    dc         = GetDC(IntPtr.Zero);
                    dc_present = true;
                }

                SelectedColor    = GetPixelPointColor(p);
                SelectedPosition = s;

                RoutedEventArgs re = new RoutedEventArgs(SelectedColorChangedEvent);
                RaiseEvent(re);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// When we stylus down, we begin a new selection box
        /// </summary>
        /// <param name="sender"></param> Ignored :(
        /// <param name="e"></param> MouseEventArgs, contains mouse location
        public override void InkCanvas_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
        {
            if (!subscribed || e.Inverted)
            {
                return;
            }

            // We don't want to do anything if we clicked inside of our bounding box...
            System.Windows.Rect selectBounds = new System.Windows.Rect();
            selectBounds.Location = new System.Windows.Point(BoundingBox.X - 18, BoundingBox.Y - 18);
            selectBounds.Size     = new System.Windows.Size(BoundingBox.Width + 36, BoundingBox.Height + 36);

            // Unless we are above a stroke
            System.Windows.Point point          = e.GetPosition(sketchPanel.InkCanvas);
            Sketch.Substroke     substrokeBelow = sketchPanel.InkSketch.Sketch.substrokeAtPoint(point.X, point.Y, SEARCH_RADIUS);

            if (substrokeBelow == null && selectBounds.Contains(point))
            {
                selection = new StrokeCollection();
                return;
            }
            else if (substrokeBelow != null)
            {
                selection = Selection;
            }
            else
            {
                selection = new StrokeCollection();
            }

            // Set the editing mode to none (removes selections)
            sketchPanel.DisableDrawing();

            // Begin new selection
            start       = e.GetPosition(sketchPanel.InkCanvas);
            currentRect = new System.Windows.Rect(start.X, start.Y, 1.0, 1.0);

            selectionMade   = false;
            makingSelection = true;
            DrawBox();
        }
Exemplo n.º 4
0
 private void SearchLabel_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     SearchBox.Focus();
 }
Exemplo n.º 5
0
 protected internal virtual new void OnStylusDown(System.Windows.Input.StylusDownEventArgs e)
 {
 }
Exemplo n.º 6
0
 private void Window_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     logger.InfoFormat("{0:D3}.{1}", ++numberIndex, MethodBase.GetCurrentMethod().Name);
 }
 public virtual void InkCanvas_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     this.makingSelection = true;
 }
Exemplo n.º 8
0
 private void ParagraphFigureUserControl_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     ParagraphFigureUserControl_GotFocus(sender, e);
 }
Exemplo n.º 9
0
 private void TextboxInkcavasUserControl_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     textboxInkcavasUserControl_GotFocus(sender, e);
 }
Exemplo n.º 10
0
 protected virtual void InkCanvas_StylusDown(object sender, System.Windows.Input.StylusDownEventArgs e)
 {
     BeginSelection(e.GetPosition(sketchPanel.InkCanvas));
 }