예제 #1
0
        private void IC_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
        {
            if (e.Cursor.Inverted && Root.CurrentPen != -1)
            {
                EnterEraserMode(true);

                /*
                 * // temperary eraser icon light
                 * if (btEraser.Image == image_eraser)
                 * {
                 *      btEraser.Image = image_eraser_act;
                 *      Root.FormDisplay.DrawButtons(true);
                 *      Root.FormDisplay.UpdateFormDisplay();
                 * }
                 */
            }
            else if (!e.Cursor.Inverted && Root.CurrentPen != -1)
            {
                EnterEraserMode(false);

                /*
                 * if (btEraser.Image == image_eraser_act)
                 * {
                 *      btEraser.Image = image_eraser;
                 *      Root.FormDisplay.DrawButtons(true);
                 *      Root.FormDisplay.UpdateFormDisplay();
                 * }
                 */
            }
        }
예제 #2
0
 /// <summary>
 /// Switches Ink editing mode to delete when the stylus is inverted.  NOTE: This feature
 /// might not be supported on all Tablets.
 /// </summary>
 private void inkPic_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
 {
     // Using explicit comparisons to minimize the number of refreshes
     // that the cursor event causes; only switch modes once and don't
     // keep pushing into sketch or erase if we're already in that mode.
     if (e.Cursor.Inverted && inkPic.EditingMode == InkOverlayEditingMode.Ink)
     {
         inkPic.EditingMode = InkOverlayEditingMode.Delete;
     }
     else if (!e.Cursor.Inverted && inkPic.EditingMode == InkOverlayEditingMode.Delete)
     {
         inkPic.EditingMode = InkOverlayEditingMode.Ink;
     }
 }
예제 #3
0
 private void inkCollector_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
 {
     if (e.Cursor.Inverted == true)
     {
         if (inkOverlay.EditingMode != InkOverlayEditingMode.Delete)
         {
             inkOverlay.EditingMode = InkOverlayEditingMode.Delete;
         }
     }
     else
     {
         if (inkOverlay.EditingMode == InkOverlayEditingMode.Delete)
         {
             inkOverlay.EditingMode = inkModeSaved;
         }
     }
 }
 private void inkOverlay_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
 {
     // Ignore the case of the mouse cursor entering the control
     if (e.Cursor.Id != (int)CursorID.Mouse)
     {
         // Check to see if the pen cursor is inverted or the toolbar is in erase mode
         if (e.Cursor.Inverted || inkToolBar.Mode == InkToolBarMode.Eraser)
         {
             if (inkOverlay.EditingMode != InkOverlayEditingMode.Delete)
             {
                 inkOverlay.EditingMode = InkOverlayEditingMode.Delete;
             }
         }
         else
         {
             if (inkOverlay.EditingMode != InkOverlayEditingMode.Ink)
             {
                 inkOverlay.EditingMode = InkOverlayEditingMode.Ink;
             }
         }
     }
 }
예제 #5
0
    private void inkoverlay_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
    {
        dbg.WriteLine("----- inkoverlay_CursorInRange -----");

        // Ensure we're on the UI thread.
        dbg.Assert(!this.InvokeRequired);

        try         // To prevent exceptions from propagating back to ink runtime.
        {
            if (e.Cursor.Inverted)
            {
                SetEditingMode(InkOverlayEditingMode.Delete, false);
            }
            else
            {
                SetEditingMode(declaredmode, false);
            }
        }
        catch (Exception ex)
        {
            // Log the error.
            Global.HandleThreadException(this, new System.Threading.ThreadExceptionEventArgs(ex));
        }
    }
예제 #6
0
        void tab_overlay_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
        {
            if (e.Cursor.Inverted && this.tab_overlay.EditingMode != InkOverlayEditingMode.Delete)
            {
                this.tab_overlay.Enabled     = false;
                this.tab_overlay.EditingMode = InkOverlayEditingMode.Delete;

                // specify stroke deleting
                this.tab_overlay.EraserMode = Microsoft.Ink.InkOverlayEraserMode.StrokeErase;

                // re-enable the overlay, we're done!
                this.tab_overlay.Enabled = true;
            }
            else
            {
                if (form.menuItemInkErase.Checked == false && form.menuItemInkSelect.Checked == false)
                {
                    this.tab_overlay.Enabled     = false;
                    this.tab_overlay.EditingMode = InkOverlayEditingMode.Ink;
                    // re-enable the overlay, we're done!
                    this.tab_overlay.Enabled = true;
                }
            }
        }
예제 #7
0
 private void inkOverlay_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
 {
     // Ignore the case of the mouse cursor entering the control
     if (e.Cursor.Id != (int)CursorID.Mouse)
     {
         // Check to see if the pen cursor is inverted or the toolbar is in erase mode
         if(e.Cursor.Inverted || inkToolBar.Mode == InkToolBarMode.Eraser)        
         {
             if(inkOverlay.EditingMode != InkOverlayEditingMode.Delete)
             {
                 inkOverlay.EditingMode = InkOverlayEditingMode.Delete;
             }
         }   
         else
         {   
             if(inkOverlay.EditingMode != InkOverlayEditingMode.Ink)
             {
                 inkOverlay.EditingMode = InkOverlayEditingMode.Ink;
             }
         }
     }
 }
예제 #8
0
    private void inkoverlay_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
    {
        dbg.WriteLine("----- inkoverlay_CursorInRange -----");

        // Ensure we're on the UI thread.
        dbg.Assert(!this.InvokeRequired);

        try // To prevent exceptions from propagating back to ink runtime.
        {
            if (e.Cursor.Inverted)
                SetEditingMode(InkOverlayEditingMode.Delete,false);
            else
                SetEditingMode(declaredmode,false);
        }
        catch (Exception ex)
        {
            // Log the error.
            Global.HandleThreadException(this, new System.Threading.ThreadExceptionEventArgs(ex));
        }
    }
예제 #9
0
		private void IC_CursorInRange(object sender, InkCollectorCursorInRangeEventArgs e)
		{
			if (e.Cursor.Inverted && Root.CurrentPen != 0)
			{
				EnterEraserMode(true);
				/*
				// temperary eraser icon light
				if (btEraser.Image == image_eraser)
				{
					btEraser.Image = image_eraser_act;
					Root.FormDisplay.DrawButtons(true);
					Root.FormDisplay.UpdateFormDisplay();
				}
				*/
			}
			else if (!e.Cursor.Inverted && Root.CurrentPen != 0)
			{
				EnterEraserMode(false);
				/*
				if (btEraser.Image == image_eraser_act)
				{
					btEraser.Image = image_eraser;
					Root.FormDisplay.DrawButtons(true);
					Root.FormDisplay.UpdateFormDisplay();
				}
				*/
			}
		}