|
using System;
using System.Windows.Forms;
using System.Drawing;
using BizDraw.Objects;
using BizDraw.Controls;
using System.Reflection;
using System.IO;
using System.Collections.Generic;
namespace BizDraw.Tools
{
[System.Runtime.InteropServices.ComVisible(true)]
/// <summary>
/// Base class for all drawing tools
/// </summary>
public abstract class Tool
{
private Dictionary<string , Cursor > Cursors = new Dictionary<string,Cursor>();
protected Cursor GetCursor(string name)
{
if (Cursors.ContainsKey(name))
return Cursors[name];
else
{
Stream s = Assembly.GetAssembly(typeof(Tool)).GetManifestResourceStream("BizDraw.Resources." + name + ".cur");
Cursor c = new Cursor(s);
Cursors.Add(name, c);
return c;
}
}
/// <summary>
/// Left nous button is pressed
/// </summary>
/// <param name="drawArea"></param>
/// <param name="e"></param>
public virtual void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
{
}
/// <summary>
/// Mouse is moved, left mouse button is pressed or none button is pressed
/// </summary>
/// <param name="drawArea"></param>
/// <param name="e"></param>
public virtual void OnMouseMove(DrawArea drawArea, MouseEventArgs e)
{
}
/// <summary>
/// Left mouse button is released
/// </summary>
/// <param name="drawArea"></param>
/// <param name="e"></param>
public virtual void OnMouseUp(DrawArea drawArea, MouseEventArgs e)
{
}
/// <summary>
/// Left mouse button is released
/// </summary>
/// <param name="drawArea"></param>
/// <param name="e"></param>
public virtual void OnDoubleClick(DrawArea drawArea,EventArgs e)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here