mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-06 23:39:09 +02:00
- Add MouseButton enum to plugin API to determine which mouse button was pressed
- Add some missing documentation
This commit is contained in:
@@ -210,7 +210,7 @@ namespace DesktopMagic
|
|||||||
private void LoadOptions(object instance)
|
private void LoadOptions(object instance)
|
||||||
{
|
{
|
||||||
Debug.WriteLine(instance.GetType().FullName);
|
Debug.WriteLine(instance.GetType().FullName);
|
||||||
FieldInfo[] props = instance.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField);
|
FieldInfo[] props = instance.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField);
|
||||||
|
|
||||||
List<SettingElement> settingElements = new List<SettingElement>();
|
List<SettingElement> settingElements = new List<SettingElement>();
|
||||||
foreach (FieldInfo prop in props)
|
foreach (FieldInfo prop in props)
|
||||||
@@ -330,7 +330,26 @@ namespace DesktopMagic
|
|||||||
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||||
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||||
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||||
Clicked(new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY));
|
|
||||||
|
MouseButton mouseButton;
|
||||||
|
|
||||||
|
switch (e.ChangedButton)
|
||||||
|
{
|
||||||
|
case System.Windows.Input.MouseButton.Left:
|
||||||
|
mouseButton = MouseButton.Left;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case System.Windows.Input.MouseButton.Middle:
|
||||||
|
mouseButton = MouseButton.Middle;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case System.Windows.Input.MouseButton.Right:
|
||||||
|
mouseButton = MouseButton.Right;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: return;
|
||||||
|
};
|
||||||
|
Clicked(new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY), mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
||||||
@@ -346,9 +365,9 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
#region Plugin Methods
|
#region Plugin Methods
|
||||||
|
|
||||||
private void Clicked(System.Drawing.Point positon)
|
private void Clicked(System.Drawing.Point positon, MouseButton mouseButton)
|
||||||
{
|
{
|
||||||
pluginClassInstance.OnMouseClick(positon);
|
pluginClassInstance.OnMouseClick(positon, mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Moved(System.Drawing.Point positon)
|
private void Moved(System.Drawing.Point positon)
|
||||||
|
|||||||
@@ -1,54 +1,28 @@
|
|||||||
using DesktopMagicPluginAPI;
|
using DesktopMagicPluginAPI;
|
||||||
using DesktopMagicPluginAPI.Inputs;
|
using DesktopMagicPluginAPI.Inputs;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Diagnostics;
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace DesktopMagicPlugin.Test
|
namespace DesktopMagicPlugin.Test
|
||||||
{
|
{
|
||||||
public class GifPlugin : Plugin
|
public class GifPlugin : Plugin
|
||||||
{
|
{
|
||||||
[Element("Gif path:")]
|
[Element("Gif path:")]
|
||||||
private TextBox input = new TextBox("");
|
public TextBox input = new TextBox("");
|
||||||
|
|
||||||
private List<Bitmap> bitmaps = new List<Bitmap>();
|
|
||||||
|
|
||||||
public override int UpdateInterval { get; set; } = 100;
|
public override int UpdateInterval { get; set; } = 100;
|
||||||
private int frameCount = -1;
|
|
||||||
|
|
||||||
public GifPlugin()
|
public override void OnMouseClick(Point position, MouseButton mouseButton)
|
||||||
{
|
{
|
||||||
input.OnValueChanged += Input_OnValueChanged;
|
Debug.WriteLine(position + " | " + mouseButton);
|
||||||
}
|
|
||||||
|
|
||||||
private void Input_OnValueChanged()
|
|
||||||
{
|
|
||||||
if (File.Exists(input.Value))
|
|
||||||
{
|
|
||||||
Image gif = Image.FromFile(input.Value);
|
|
||||||
bitmaps.Clear();
|
|
||||||
for (int i = 0; i < gif.GetFrameCount(FrameDimension.Time); i++)
|
|
||||||
{
|
|
||||||
gif.SelectActiveFrame(FrameDimension.Time, i);
|
|
||||||
|
|
||||||
bitmaps.Add(new Bitmap(gif));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Bitmap Main()
|
public override Bitmap Main()
|
||||||
{
|
{
|
||||||
if (bitmaps.Count == 0)
|
Bitmap bmp = new Bitmap(100, 100);
|
||||||
return new Bitmap(1, 1);
|
using Graphics graphics = Graphics.FromImage(bmp);
|
||||||
|
graphics.Clear(Color.Red);
|
||||||
frameCount++;
|
return bmp;
|
||||||
|
|
||||||
if (frameCount >= bitmaps.Count)
|
|
||||||
frameCount = 0;
|
|
||||||
|
|
||||||
return bitmaps[frameCount];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,19 +4,23 @@
|
|||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Company>Stone_Red</Company>
|
<Company>Stone_Red</Company>
|
||||||
<Product>Stone_Red</Product>
|
<Product>Stone_Red</Product>
|
||||||
<Version>0.0.0.2</Version>
|
<Version>0.0.0.4</Version>
|
||||||
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
|
||||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<AssemblyVersion>0.0.0.2</AssemblyVersion>
|
<AssemblyVersion>0.0.0.4</AssemblyVersion>
|
||||||
<PackageProjectUrl></PackageProjectUrl>
|
<PackageProjectUrl></PackageProjectUrl>
|
||||||
<FileVersion>0.0.0.2</FileVersion>
|
<FileVersion>0.0.0.4</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<DocumentationFile>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPluginAPI\DesktopMagicPluginAPI.xml</DocumentationFile>
|
<DocumentationFile>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPluginAPI\DesktopMagicPluginAPI.xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
<DocumentationFile>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPluginAPI\DesktopMagicPluginAPI.xml</DocumentationFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
|
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
|
||||||
<PackageReference Include="Vsxmd" Version="1.4.5">
|
<PackageReference Include="Vsxmd" Version="1.4.5">
|
||||||
|
|||||||
@@ -38,11 +38,15 @@
|
|||||||
- [#ctor(value,bold)](#M-DesktopMagicPluginAPI-Inputs-Label-#ctor-System-String,System-Boolean- 'DesktopMagicPluginAPI.Inputs.Label.#ctor(System.String,System.Boolean)')
|
- [#ctor(value,bold)](#M-DesktopMagicPluginAPI-Inputs-Label-#ctor-System-String,System-Boolean- 'DesktopMagicPluginAPI.Inputs.Label.#ctor(System.String,System.Boolean)')
|
||||||
- [Bold](#P-DesktopMagicPluginAPI-Inputs-Label-Bold 'DesktopMagicPluginAPI.Inputs.Label.Bold')
|
- [Bold](#P-DesktopMagicPluginAPI-Inputs-Label-Bold 'DesktopMagicPluginAPI.Inputs.Label.Bold')
|
||||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-Label-Value 'DesktopMagicPluginAPI.Inputs.Label.Value')
|
- [Value](#P-DesktopMagicPluginAPI-Inputs-Label-Value 'DesktopMagicPluginAPI.Inputs.Label.Value')
|
||||||
|
- [MouseButton](#T-DesktopMagicPluginAPI-Inputs-MouseButton 'DesktopMagicPluginAPI.Inputs.MouseButton')
|
||||||
|
- [Left](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Left 'DesktopMagicPluginAPI.Inputs.MouseButton.Left')
|
||||||
|
- [Middle](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Middle 'DesktopMagicPluginAPI.Inputs.MouseButton.Middle')
|
||||||
|
- [Right](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Right 'DesktopMagicPluginAPI.Inputs.MouseButton.Right')
|
||||||
- [Plugin](#T-DesktopMagicPluginAPI-Plugin 'DesktopMagicPluginAPI.Plugin')
|
- [Plugin](#T-DesktopMagicPluginAPI-Plugin 'DesktopMagicPluginAPI.Plugin')
|
||||||
- [Application](#P-DesktopMagicPluginAPI-Plugin-Application 'DesktopMagicPluginAPI.Plugin.Application')
|
- [Application](#P-DesktopMagicPluginAPI-Plugin-Application 'DesktopMagicPluginAPI.Plugin.Application')
|
||||||
- [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval 'DesktopMagicPluginAPI.Plugin.UpdateInterval')
|
- [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval 'DesktopMagicPluginAPI.Plugin.UpdateInterval')
|
||||||
- [Main()](#M-DesktopMagicPluginAPI-Plugin-Main 'DesktopMagicPluginAPI.Plugin.Main')
|
- [Main()](#M-DesktopMagicPluginAPI-Plugin-Main 'DesktopMagicPluginAPI.Plugin.Main')
|
||||||
- [OnMouseClick(position)](#M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point- 'DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point)')
|
- [OnMouseClick(position,mouseButton)](#M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point,DesktopMagicPluginAPI-Inputs-MouseButton- 'DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point,DesktopMagicPluginAPI.Inputs.MouseButton)')
|
||||||
- [OnMouseMove(position)](#M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point- 'DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)')
|
- [OnMouseMove(position)](#M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point- 'DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)')
|
||||||
- [Start()](#M-DesktopMagicPluginAPI-Plugin-Start 'DesktopMagicPluginAPI.Plugin.Start')
|
- [Start()](#M-DesktopMagicPluginAPI-Plugin-Start 'DesktopMagicPluginAPI.Plugin.Start')
|
||||||
- [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider')
|
- [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider')
|
||||||
@@ -325,14 +329,14 @@ Gets the font of the main application.
|
|||||||
|
|
||||||
##### Summary
|
##### Summary
|
||||||
|
|
||||||
Gets the window position of the main application.
|
Gets the window position of the plugin window.
|
||||||
|
|
||||||
<a name='P-DesktopMagicPluginAPI-IPluginData-WindowSize'></a>
|
<a name='P-DesktopMagicPluginAPI-IPluginData-WindowSize'></a>
|
||||||
### WindowSize `property`
|
### WindowSize `property`
|
||||||
|
|
||||||
##### Summary
|
##### Summary
|
||||||
|
|
||||||
Gets the window size of the main application.
|
Gets the window size of the plugin window.
|
||||||
|
|
||||||
<a name='M-DesktopMagicPluginAPI-IPluginData-UpdateWindow'></a>
|
<a name='M-DesktopMagicPluginAPI-IPluginData-UpdateWindow'></a>
|
||||||
### UpdateWindow() `method`
|
### UpdateWindow() `method`
|
||||||
@@ -437,6 +441,38 @@ Gets or set a value indicating whether the content of the [Label](#T-DesktopMagi
|
|||||||
|
|
||||||
Gets or sets the text associated with this [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label').
|
Gets or sets the text associated with this [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label').
|
||||||
|
|
||||||
|
<a name='T-DesktopMagicPluginAPI-Inputs-MouseButton'></a>
|
||||||
|
## MouseButton `type`
|
||||||
|
|
||||||
|
##### Namespace
|
||||||
|
|
||||||
|
DesktopMagicPluginAPI.Inputs
|
||||||
|
|
||||||
|
##### Summary
|
||||||
|
|
||||||
|
Mouse Buttons
|
||||||
|
|
||||||
|
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Left'></a>
|
||||||
|
### Left `constants`
|
||||||
|
|
||||||
|
##### Summary
|
||||||
|
|
||||||
|
The left mouse button.
|
||||||
|
|
||||||
|
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Middle'></a>
|
||||||
|
### Middle `constants`
|
||||||
|
|
||||||
|
##### Summary
|
||||||
|
|
||||||
|
The middle mouse button.
|
||||||
|
|
||||||
|
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Right'></a>
|
||||||
|
### Right `constants`
|
||||||
|
|
||||||
|
##### Summary
|
||||||
|
|
||||||
|
The right mouse button.
|
||||||
|
|
||||||
<a name='T-DesktopMagicPluginAPI-Plugin'></a>
|
<a name='T-DesktopMagicPluginAPI-Plugin'></a>
|
||||||
## Plugin `type`
|
## Plugin `type`
|
||||||
|
|
||||||
@@ -477,8 +513,8 @@ Occurs when the [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval
|
|||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point-'></a>
|
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point,DesktopMagicPluginAPI-Inputs-MouseButton-'></a>
|
||||||
### OnMouseClick(position) `method`
|
### OnMouseClick(position,mouseButton) `method`
|
||||||
|
|
||||||
##### Summary
|
##### Summary
|
||||||
|
|
||||||
@@ -488,7 +524,8 @@ Occurs when the window is clicked by the mouse.
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| ---- | ---- | ----------- |
|
||||||
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | |
|
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
|
||||||
|
| mouseButton | [DesktopMagicPluginAPI.Inputs.MouseButton](#T-DesktopMagicPluginAPI-Inputs-MouseButton 'DesktopMagicPluginAPI.Inputs.MouseButton') | Gets the button associated with the event. |
|
||||||
|
|
||||||
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point-'></a>
|
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point-'></a>
|
||||||
### OnMouseMove(position) `method`
|
### OnMouseMove(position) `method`
|
||||||
@@ -501,7 +538,7 @@ Occurs when the mouse pointer is moved over the control.
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| ---- | ---- | ----------- |
|
||||||
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | |
|
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
|
||||||
|
|
||||||
<a name='M-DesktopMagicPluginAPI-Plugin-Start'></a>
|
<a name='M-DesktopMagicPluginAPI-Plugin-Start'></a>
|
||||||
### Start() `method`
|
### Start() `method`
|
||||||
|
|||||||
@@ -192,6 +192,26 @@
|
|||||||
<param name="value">The text associated with this <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/></param>
|
<param name="value">The text associated with this <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/></param>
|
||||||
<param name="bold">A value indicating whether the content of the <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/> is bold or not.</param>
|
<param name="bold">A value indicating whether the content of the <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/> is bold or not.</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:DesktopMagicPluginAPI.Inputs.MouseButton">
|
||||||
|
<summary>
|
||||||
|
Mouse Buttons
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Left">
|
||||||
|
<summary>
|
||||||
|
The left mouse button.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Middle">
|
||||||
|
<summary>
|
||||||
|
The middle mouse button.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Right">
|
||||||
|
<summary>
|
||||||
|
The right mouse button.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:DesktopMagicPluginAPI.Inputs.Slider">
|
<member name="T:DesktopMagicPluginAPI.Inputs.Slider">
|
||||||
<summary>
|
<summary>
|
||||||
Represents a slider control.
|
Represents a slider control.
|
||||||
@@ -253,12 +273,12 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowSize">
|
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowSize">
|
||||||
<summary>
|
<summary>
|
||||||
Gets the window size of the main application.
|
Gets the window size of the plugin window.
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowPosition">
|
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowPosition">
|
||||||
<summary>
|
<summary>
|
||||||
Gets the window position of the main application.
|
Gets the window position of the plugin window.
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DesktopMagicPluginAPI.IPluginData.UpdateWindow">
|
<member name="M:DesktopMagicPluginAPI.IPluginData.UpdateWindow">
|
||||||
@@ -292,17 +312,18 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point)">
|
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point,DesktopMagicPluginAPI.Inputs.MouseButton)">
|
||||||
<summary>
|
<summary>
|
||||||
Occurs when the window is clicked by the mouse.
|
Occurs when the window is clicked by the mouse.
|
||||||
</summary>
|
</summary>
|
||||||
<param name="position"></param>
|
<param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
|
||||||
|
<param name="mouseButton">Gets the button associated with the event.</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)">
|
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)">
|
||||||
<summary>
|
<summary>
|
||||||
Occurs when the mouse pointer is moved over the control.
|
Occurs when the mouse pointer is moved over the control.
|
||||||
</summary>
|
</summary>
|
||||||
<param name="position"></param>
|
<param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ namespace DesktopMagicPluginAPI
|
|||||||
Color Color { get; }
|
Color Color { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the window size of the main application.
|
/// Gets the window size of the plugin window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Point WindowSize { get; }
|
Point WindowSize { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the window position of the main application.
|
/// Gets the window position of the plugin window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Point WindowPosition { get; }
|
Point WindowPosition { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DesktopMagicPluginAPI.Inputs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Mouse Buttons
|
||||||
|
/// </summary>
|
||||||
|
public enum MouseButton
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The left mouse button.
|
||||||
|
/// </summary>
|
||||||
|
Left,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The middle mouse button.
|
||||||
|
/// </summary>
|
||||||
|
Middle,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The right mouse button.
|
||||||
|
/// </summary>
|
||||||
|
Right,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using DesktopMagicPluginAPI.Inputs;
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace DesktopMagicPluginAPI
|
namespace DesktopMagicPluginAPI
|
||||||
@@ -50,15 +51,16 @@ namespace DesktopMagicPluginAPI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the window is clicked by the mouse.
|
/// Occurs when the window is clicked by the mouse.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="position"></param>
|
/// <param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
|
||||||
public virtual void OnMouseClick(Point position)
|
/// <param name="mouseButton">Gets the button associated with the event.</param>
|
||||||
|
public virtual void OnMouseClick(Point position, MouseButton mouseButton)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the mouse pointer is moved over the control.
|
/// Occurs when the mouse pointer is moved over the control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="position"></param>
|
/// <param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
|
||||||
public virtual void OnMouseMove(Point position)
|
public virtual void OnMouseMove(Point position)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user