Merge branch 'switch-to-mvp' into develop
This commit is contained in:
69
Eve-O-Preview/ApplicationBase/ApplicationController.cs
Normal file
69
Eve-O-Preview/ApplicationBase/ApplicationController.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public class ApplicationController : IApplicationController
|
||||
{
|
||||
private readonly IIocContainer _container;
|
||||
|
||||
public ApplicationController(IIocContainer container)
|
||||
{
|
||||
this._container = container;
|
||||
this._container.RegisterInstance<IApplicationController>(this);
|
||||
}
|
||||
|
||||
public IApplicationController RegisterView<TView, TImplementation>()
|
||||
where TView : IView
|
||||
where TImplementation : class, TView
|
||||
{
|
||||
this._container.Register<TView, TImplementation>();
|
||||
return this;
|
||||
}
|
||||
|
||||
public IApplicationController RegisterInstance<TArgument>(TArgument instance)
|
||||
{
|
||||
this._container.RegisterInstance(instance);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IApplicationController RegisterService<TService, TImplementation>()
|
||||
where TImplementation : class, TService
|
||||
{
|
||||
this._container.Register<TService, TImplementation>();
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Run<TPresenter>()
|
||||
where TPresenter : class, IPresenter
|
||||
{
|
||||
if (!this._container.IsRegistered<TPresenter>())
|
||||
{
|
||||
this._container.Register<TPresenter>();
|
||||
}
|
||||
|
||||
TPresenter presenter = this._container.Resolve<TPresenter>();
|
||||
presenter.Run();
|
||||
}
|
||||
|
||||
public void Run<TPresenter, TParameter>(TParameter args)
|
||||
where TPresenter : class, IPresenter<TParameter>
|
||||
{
|
||||
if (!this._container.IsRegistered<TPresenter>())
|
||||
{
|
||||
this._container.Register<TPresenter>();
|
||||
}
|
||||
|
||||
TPresenter presenter = this._container.Resolve<TPresenter>();
|
||||
presenter.Run(args);
|
||||
}
|
||||
|
||||
public TService Create<TService>()
|
||||
where TService : class
|
||||
{
|
||||
if (!this._container.IsRegistered<TService>())
|
||||
{
|
||||
this._container.Register<TService>();
|
||||
}
|
||||
|
||||
return this._container.Resolve<TService>();
|
||||
}
|
||||
}
|
||||
}
|
26
Eve-O-Preview/ApplicationBase/IApplicationController.cs
Normal file
26
Eve-O-Preview/ApplicationBase/IApplicationController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
/// <summary>
|
||||
/// Application controller
|
||||
/// </summary>
|
||||
public interface IApplicationController
|
||||
{
|
||||
IApplicationController RegisterView<TView, TPresenter>()
|
||||
where TPresenter : class, TView
|
||||
where TView : IView;
|
||||
|
||||
IApplicationController RegisterInstance<T>(T instance);
|
||||
|
||||
IApplicationController RegisterService<TService, TImplementation>()
|
||||
where TImplementation : class, TService;
|
||||
|
||||
void Run<TPresenter>()
|
||||
where TPresenter : class, IPresenter;
|
||||
|
||||
void Run<TPresenter, TArgument>(TArgument args)
|
||||
where TPresenter : class, IPresenter<TArgument>;
|
||||
|
||||
TService Create<TService>()
|
||||
where TService : class;
|
||||
}
|
||||
}
|
18
Eve-O-Preview/ApplicationBase/IIocContainer.cs
Normal file
18
Eve-O-Preview/ApplicationBase/IIocContainer.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic interface for an Inversion Of Control container
|
||||
/// </summary>
|
||||
public interface IIocContainer
|
||||
{
|
||||
void Register<TService, TImplementation>() where TImplementation : TService;
|
||||
void Register<TService>();
|
||||
void RegisterInstance<T>(T instance);
|
||||
TService Resolve<TService>();
|
||||
bool IsRegistered<TService>();
|
||||
void Register<TService, TArgument>(Expression<Func<TArgument, TService>> factory);
|
||||
}
|
||||
}
|
7
Eve-O-Preview/ApplicationBase/IPresenter.cs
Normal file
7
Eve-O-Preview/ApplicationBase/IPresenter.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public interface IPresenter
|
||||
{
|
||||
void Run();
|
||||
}
|
||||
}
|
7
Eve-O-Preview/ApplicationBase/IPresenterGeneric.cs
Normal file
7
Eve-O-Preview/ApplicationBase/IPresenterGeneric.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public interface IPresenter<in TArgument>
|
||||
{
|
||||
void Run(TArgument args);
|
||||
}
|
||||
}
|
12
Eve-O-Preview/ApplicationBase/IView.cs
Normal file
12
Eve-O-Preview/ApplicationBase/IView.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties and methods that are common for all views
|
||||
/// </summary>
|
||||
public interface IView
|
||||
{
|
||||
void Show();
|
||||
void Hide();
|
||||
void Close();
|
||||
}
|
||||
}
|
48
Eve-O-Preview/ApplicationBase/LightInjectContainer.cs
Normal file
48
Eve-O-Preview/ApplicationBase/LightInjectContainer.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using LightInject;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
// Adapts LighInject to the generic IoC interface
|
||||
sealed class LightInjectContainer : IIocContainer
|
||||
{
|
||||
private readonly ServiceContainer _container;
|
||||
|
||||
public LightInjectContainer()
|
||||
{
|
||||
this._container = new ServiceContainer(ContainerOptions.Default);
|
||||
}
|
||||
|
||||
public bool IsRegistered<TService>()
|
||||
{
|
||||
return this._container.CanGetInstance(typeof(TService), "");
|
||||
}
|
||||
|
||||
public void Register<TService>()
|
||||
{
|
||||
this._container.Register<TService>();
|
||||
}
|
||||
|
||||
public void Register<TService, TImplementation>()
|
||||
where TImplementation : TService
|
||||
{
|
||||
this._container.Register<TService, TImplementation>();
|
||||
}
|
||||
|
||||
public void Register<TService, TArgument>(Expression<Func<TArgument, TService>> factory)
|
||||
{
|
||||
this._container.Register(f => factory);
|
||||
}
|
||||
|
||||
public void RegisterInstance<T>(T instance)
|
||||
{
|
||||
this._container.RegisterInstance(instance);
|
||||
}
|
||||
|
||||
public TService Resolve<TService>()
|
||||
{
|
||||
return this._container.GetInstance<TService>();
|
||||
}
|
||||
}
|
||||
}
|
22
Eve-O-Preview/ApplicationBase/Presenter.cs
Normal file
22
Eve-O-Preview/ApplicationBase/Presenter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public abstract class Presenter<TView> : IPresenter
|
||||
where TView : IView
|
||||
{
|
||||
// Properties are used instead of fields so the code remains CLS compliant
|
||||
// 'protected readonly' fields would result in non-CLS compliant code
|
||||
protected TView View { get; private set; }
|
||||
protected IApplicationController Controller { get; private set; }
|
||||
|
||||
protected Presenter(IApplicationController controller, TView view)
|
||||
{
|
||||
this.Controller = controller;
|
||||
this.View = view;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
this.View.Show();
|
||||
}
|
||||
}
|
||||
}
|
19
Eve-O-Preview/ApplicationBase/PresenterGeneric.cs
Normal file
19
Eve-O-Preview/ApplicationBase/PresenterGeneric.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public abstract class Presenter<TView, TArgument> : IPresenter<TArgument>
|
||||
where TView : IView
|
||||
{
|
||||
// Properties are used instead of fields so the code remains CLS compliant
|
||||
// 'protected readonly' fields would result in non-CLS compliant code
|
||||
protected TView View { get; private set; }
|
||||
protected IApplicationController Controller { get; private set; }
|
||||
|
||||
protected Presenter(IApplicationController controller, TView view)
|
||||
{
|
||||
this.Controller = controller;
|
||||
this.View = view;
|
||||
}
|
||||
|
||||
public abstract void Run(TArgument args);
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
namespace EveOPreview
|
||||
namespace EveOPreview.Configuration
|
||||
{
|
||||
public class Configuration
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace EveOPreview.Managers
|
||||
namespace EveOPreview.Configuration
|
||||
{
|
||||
public class ConfigurationStorage
|
||||
{
|
||||
|
11
Eve-O-Preview/Configuration/WindowProperties.cs
Normal file
11
Eve-O-Preview/Configuration/WindowProperties.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public class WindowProperties
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
}
|
||||
}
|
@@ -90,10 +90,11 @@
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="LightInject, Version=4.0.9.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LightInject.4.0.9\lib\net45\LightInject.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@@ -103,39 +104,57 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ApplicationBase\ApplicationController.cs" />
|
||||
<Compile Include="ApplicationBase\IApplicationController.cs" />
|
||||
<Compile Include="ApplicationBase\IIocContainer.cs" />
|
||||
<Compile Include="ApplicationBase\IPresenterGeneric.cs" />
|
||||
<Compile Include="ApplicationBase\LightInjectContainer.cs" />
|
||||
<Compile Include="ApplicationBase\Presenter.cs" />
|
||||
<Compile Include="ApplicationBase\PresenterGeneric.cs" />
|
||||
<Compile Include="DwmAPI\DWM_BLURBEHIND.cs" />
|
||||
<Compile Include="DwmAPI\DWM_THUMBNAIL_PROPERTIES.cs" />
|
||||
<Compile Include="DwmAPI\DWM_TNP_CONSTANTS.cs" />
|
||||
<Compile Include="DwmAPI\MARGINS.cs" />
|
||||
<Compile Include="DwmAPI\RECT.cs" />
|
||||
<Compile Include="GUI\ClientLocation.cs" />
|
||||
<Compile Include="GUI\ZoomAnchor.cs" />
|
||||
<Compile Include="Configuration\WindowProperties.cs" />
|
||||
<Compile Include="ApplicationBase\IPresenter.cs" />
|
||||
<Compile Include="Presentation\MainPresenter.cs" />
|
||||
<Compile Include="Presentation\ViewCloseRequest.cs" />
|
||||
<Compile Include="UI\Interface\IThumbnailViewFactory.cs" />
|
||||
<Compile Include="Presentation\IThumbnailManager.cs" />
|
||||
<Compile Include="UI\Implementation\ThumbnailDescriptionView.cs" />
|
||||
<Compile Include="UI\Factory\ThumbnailDescriptionViewFactory.cs" />
|
||||
<Compile Include="UI\Interface\IMainView.cs" />
|
||||
<Compile Include="ApplicationBase\IView.cs" />
|
||||
<Compile Include="UI\Interface\IThumbnailDescriptionView.cs" />
|
||||
<Compile Include="UI\Interface\IThumbnailDescriptionViewFactory.cs" />
|
||||
<Compile Include="UI\Interface\ZoomAnchor.cs" />
|
||||
<Compile Include="Configuration\Configuration.cs" />
|
||||
<Compile Include="Hotkeys\Hotkey.cs" />
|
||||
<Compile Include="Hotkeys\HotkeyNativeMethods.cs" />
|
||||
<Compile Include="GUI\MainForm.cs">
|
||||
<None Include="Hotkeys\Hotkey.cs" />
|
||||
<None Include="Hotkeys\HotkeyNativeMethods.cs" />
|
||||
<Compile Include="UI\Implementation\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GUI\MainForm.Designer.cs">
|
||||
<Compile Include="UI\Implementation\MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Configuration\ConfigurationStorage.cs" />
|
||||
<Compile Include="Thumbnail\IThumbnail.cs" />
|
||||
<Compile Include="Thumbnail\ThumbnailFactory.cs" />
|
||||
<Compile Include="Thumbnail\ThumbnailManager.cs" />
|
||||
<Compile Include="Thumbnail\ThumbnailOverlay.cs">
|
||||
<Compile Include="UI\Interface\IThumbnailView.cs" />
|
||||
<Compile Include="UI\Factory\ThumbnailViewFactory.cs" />
|
||||
<Compile Include="Presentation\ThumbnailManager.cs" />
|
||||
<Compile Include="UI\Implementation\ThumbnailOverlay.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Thumbnail\ThumbnailOverlay.Designer.cs">
|
||||
<Compile Include="UI\Implementation\ThumbnailOverlay.Designer.cs">
|
||||
<DependentUpon>ThumbnailOverlay.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="GUI\MainForm.resx">
|
||||
<EmbeddedResource Include="UI\Implementation\MainForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Thumbnail\ThumbnailOverlay.resx">
|
||||
<EmbeddedResource Include="UI\Implementation\ThumbnailOverlay.resx">
|
||||
<DependentUpon>ThumbnailOverlay.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
@@ -143,9 +162,9 @@
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Thumbnail\ThumbnailWindow.resx">
|
||||
<EmbeddedResource Include="UI\Implementation\ThumbnailView.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ThumbnailWindow.cs</DependentUpon>
|
||||
<DependentUpon>ThumbnailView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -155,6 +174,7 @@
|
||||
<None Include="app.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -164,11 +184,11 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Thumbnail\ThumbnailWindow.cs">
|
||||
<Compile Include="UI\Implementation\ThumbnailView.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Thumbnail\ThumbnailWindow.Designer.cs">
|
||||
<DependentUpon>ThumbnailWindow.cs</DependentUpon>
|
||||
<Compile Include="UI\Implementation\ThumbnailView.Designer.cs">
|
||||
<DependentUpon>ThumbnailView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DwmAPI\DwmApiNativeMethods.cs" />
|
||||
</ItemGroup>
|
||||
@@ -200,6 +220,9 @@
|
||||
<ItemGroup>
|
||||
<Content Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="GUI\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
12
Eve-O-Preview/Eve-O-Preview.csproj.DotSettings
Normal file
12
Eve-O-Preview/Eve-O-Preview.csproj.DotSettings
Normal file
@@ -0,0 +1,12 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=gui/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=gui_005Cpresenter_005Cinterface/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=gui_005Cview/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=presentation/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=presentation_005Cinterface/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=thumbnail/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=thumbnail_005Cimplementation/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=thumbnail_005Cinterface/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ui/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ui_005Cimplementation/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ui_005Cinterface/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
@@ -1,10 +0,0 @@
|
||||
namespace EveOPreview
|
||||
{
|
||||
public struct ClientLocation
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
public int Width;
|
||||
public int Height;
|
||||
}
|
||||
}
|
642
Eve-O-Preview/GUI/MainForm.Designer.cs
generated
642
Eve-O-Preview/GUI/MainForm.Designer.cs
generated
@@ -1,642 +0,0 @@
|
||||
using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.ComponentModel;
|
||||
//using System.Drawing;
|
||||
//using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>s
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.option_hide_active = new System.Windows.Forms.CheckBox();
|
||||
this.option_hide_all_if_not_right_type = new System.Windows.Forms.CheckBox();
|
||||
this.option_unique_layout = new System.Windows.Forms.CheckBox();
|
||||
this.option_sync_size = new System.Windows.Forms.CheckBox();
|
||||
this.option_always_on_top = new System.Windows.Forms.CheckBox();
|
||||
this.option_show_thumbnail_frames = new System.Windows.Forms.CheckBox();
|
||||
this.forum_url = new System.Windows.Forms.LinkLabel();
|
||||
this.option_sync_size_x = new System.Windows.Forms.TextBox();
|
||||
this.option_sync_size_y = new System.Windows.Forms.TextBox();
|
||||
this.option_zoom_on_hover = new System.Windows.Forms.CheckBox();
|
||||
this.option_show_overlay = new System.Windows.Forms.CheckBox();
|
||||
this.option_zoom_anchor_NW = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_N = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_NE = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_W = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_C = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_E = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_SW = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_S = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_anchor_SE = new System.Windows.Forms.RadioButton();
|
||||
this.option_zoom_factor = new System.Windows.Forms.TextBox();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.option_minToTray = new System.Windows.Forms.CheckBox();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
this.opacity_bar = new System.Windows.Forms.HScrollBar();
|
||||
this.opacity_label = new System.Windows.Forms.Label();
|
||||
this.option_track_client_windows = new System.Windows.Forms.CheckBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.zoom_anchor_lable = new System.Windows.Forms.Label();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.previews_check_listbox = new System.Windows.Forms.CheckedListBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.aero_status_label = new System.Windows.Forms.Label();
|
||||
this.previewToyMainBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.restoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.panel6.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel5.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.previewToyMainBindingSource)).BeginInit();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// option_hide_active
|
||||
//
|
||||
this.option_hide_active.AutoSize = true;
|
||||
this.option_hide_active.Checked = true;
|
||||
this.option_hide_active.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_hide_active.Location = new System.Drawing.Point(3, 81);
|
||||
this.option_hide_active.Name = "option_hide_active";
|
||||
this.option_hide_active.Size = new System.Drawing.Size(184, 17);
|
||||
this.option_hide_active.TabIndex = 1;
|
||||
this.option_hide_active.Text = "Hide preview of active EVE client";
|
||||
this.option_hide_active.UseVisualStyleBackColor = true;
|
||||
this.option_hide_active.CheckedChanged += new System.EventHandler(this.option_hide_active_CheckedChanged);
|
||||
//
|
||||
// option_hide_all_if_not_right_type
|
||||
//
|
||||
this.option_hide_all_if_not_right_type.AutoSize = true;
|
||||
this.option_hide_all_if_not_right_type.Checked = true;
|
||||
this.option_hide_all_if_not_right_type.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_hide_all_if_not_right_type.Location = new System.Drawing.Point(3, 127);
|
||||
this.option_hide_all_if_not_right_type.Name = "option_hide_all_if_not_right_type";
|
||||
this.option_hide_all_if_not_right_type.Size = new System.Drawing.Size(242, 17);
|
||||
this.option_hide_all_if_not_right_type.TabIndex = 2;
|
||||
this.option_hide_all_if_not_right_type.Text = "Hide previews if active window not EVE client";
|
||||
this.option_hide_all_if_not_right_type.UseVisualStyleBackColor = true;
|
||||
this.option_hide_all_if_not_right_type.CheckedChanged += new System.EventHandler(this.option_hide_all_if_noneve_CheckedChanged);
|
||||
//
|
||||
// option_unique_layout
|
||||
//
|
||||
this.option_unique_layout.AutoSize = true;
|
||||
this.option_unique_layout.Checked = true;
|
||||
this.option_unique_layout.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_unique_layout.Location = new System.Drawing.Point(3, 150);
|
||||
this.option_unique_layout.Name = "option_unique_layout";
|
||||
this.option_unique_layout.Size = new System.Drawing.Size(185, 17);
|
||||
this.option_unique_layout.TabIndex = 3;
|
||||
this.option_unique_layout.Text = "Unique layout for each EVE client";
|
||||
this.option_unique_layout.UseVisualStyleBackColor = true;
|
||||
this.option_unique_layout.CheckedChanged += new System.EventHandler(this.option_unique_layout_CheckedChanged);
|
||||
//
|
||||
// option_sync_size
|
||||
//
|
||||
this.option_sync_size.AutoSize = true;
|
||||
this.option_sync_size.Checked = true;
|
||||
this.option_sync_size.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_sync_size.Location = new System.Drawing.Point(1, 3);
|
||||
this.option_sync_size.Name = "option_sync_size";
|
||||
this.option_sync_size.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.option_sync_size.Size = new System.Drawing.Size(108, 17);
|
||||
this.option_sync_size.TabIndex = 4;
|
||||
this.option_sync_size.Text = "Syncronize resize";
|
||||
this.option_sync_size.UseVisualStyleBackColor = true;
|
||||
this.option_sync_size.CheckedChanged += new System.EventHandler(this.option_sync_size_CheckedChanged);
|
||||
//
|
||||
// option_always_on_top
|
||||
//
|
||||
this.option_always_on_top.AutoSize = true;
|
||||
this.option_always_on_top.Checked = true;
|
||||
this.option_always_on_top.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_always_on_top.Location = new System.Drawing.Point(3, 104);
|
||||
this.option_always_on_top.Name = "option_always_on_top";
|
||||
this.option_always_on_top.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.option_always_on_top.Size = new System.Drawing.Size(137, 17);
|
||||
this.option_always_on_top.TabIndex = 8;
|
||||
this.option_always_on_top.Text = "Previews always on top";
|
||||
this.option_always_on_top.UseVisualStyleBackColor = true;
|
||||
this.option_always_on_top.CheckedChanged += new System.EventHandler(this.option_always_on_top_CheckedChanged);
|
||||
//
|
||||
// option_show_thumbnail_frames
|
||||
//
|
||||
this.option_show_thumbnail_frames.AutoSize = true;
|
||||
this.option_show_thumbnail_frames.Checked = true;
|
||||
this.option_show_thumbnail_frames.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_show_thumbnail_frames.Location = new System.Drawing.Point(99, 277);
|
||||
this.option_show_thumbnail_frames.Name = "option_show_thumbnail_frames";
|
||||
this.option_show_thumbnail_frames.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.option_show_thumbnail_frames.Size = new System.Drawing.Size(127, 17);
|
||||
this.option_show_thumbnail_frames.TabIndex = 9;
|
||||
this.option_show_thumbnail_frames.Text = "Show preview frames";
|
||||
this.option_show_thumbnail_frames.UseVisualStyleBackColor = true;
|
||||
this.option_show_thumbnail_frames.CheckedChanged += new System.EventHandler(this.option_show_thumbnail_frames_CheckedChanged);
|
||||
//
|
||||
// forum_url
|
||||
//
|
||||
this.forum_url.AutoSize = true;
|
||||
this.forum_url.Location = new System.Drawing.Point(3, 430);
|
||||
this.forum_url.Name = "forum_url";
|
||||
this.forum_url.Size = new System.Drawing.Size(216, 13);
|
||||
this.forum_url.TabIndex = 10;
|
||||
this.forum_url.TabStop = true;
|
||||
this.forum_url.Text = "https://bitbucket.org/ulph/eve-o-preview-git";
|
||||
this.forum_url.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// option_sync_size_x
|
||||
//
|
||||
this.option_sync_size_x.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.option_sync_size_x.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.option_sync_size_x.Location = new System.Drawing.Point(137, 3);
|
||||
this.option_sync_size_x.Name = "option_sync_size_x";
|
||||
this.option_sync_size_x.Size = new System.Drawing.Size(42, 20);
|
||||
this.option_sync_size_x.TabIndex = 11;
|
||||
this.option_sync_size_x.TextChanged += new System.EventHandler(this.option_sync_size_x_TextChanged);
|
||||
//
|
||||
// option_sync_size_y
|
||||
//
|
||||
this.option_sync_size_y.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.option_sync_size_y.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.option_sync_size_y.Location = new System.Drawing.Point(196, 3);
|
||||
this.option_sync_size_y.Name = "option_sync_size_y";
|
||||
this.option_sync_size_y.Size = new System.Drawing.Size(42, 20);
|
||||
this.option_sync_size_y.TabIndex = 12;
|
||||
this.option_sync_size_y.TextChanged += new System.EventHandler(this.option_sync_size_y_TextChanged);
|
||||
//
|
||||
// option_zoom_on_hover
|
||||
//
|
||||
this.option_zoom_on_hover.AutoSize = true;
|
||||
this.option_zoom_on_hover.Checked = true;
|
||||
this.option_zoom_on_hover.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_zoom_on_hover.Location = new System.Drawing.Point(1, 5);
|
||||
this.option_zoom_on_hover.Name = "option_zoom_on_hover";
|
||||
this.option_zoom_on_hover.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.option_zoom_on_hover.Size = new System.Drawing.Size(98, 17);
|
||||
this.option_zoom_on_hover.TabIndex = 13;
|
||||
this.option_zoom_on_hover.Text = "Zoom on hover";
|
||||
this.option_zoom_on_hover.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_on_hover.CheckedChanged += new System.EventHandler(this.option_zoom_on_hover_CheckedChanged);
|
||||
//
|
||||
// option_show_overlay
|
||||
//
|
||||
this.option_show_overlay.AutoSize = true;
|
||||
this.option_show_overlay.Checked = true;
|
||||
this.option_show_overlay.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.option_show_overlay.Location = new System.Drawing.Point(3, 277);
|
||||
this.option_show_overlay.Name = "option_show_overlay";
|
||||
this.option_show_overlay.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.option_show_overlay.Size = new System.Drawing.Size(90, 17);
|
||||
this.option_show_overlay.TabIndex = 14;
|
||||
this.option_show_overlay.Text = "Show overlay";
|
||||
this.option_show_overlay.UseVisualStyleBackColor = true;
|
||||
this.option_show_overlay.CheckedChanged += new System.EventHandler(this.option_show_overlay_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_NW
|
||||
//
|
||||
this.option_zoom_anchor_NW.AutoSize = true;
|
||||
this.option_zoom_anchor_NW.Location = new System.Drawing.Point(3, 3);
|
||||
this.option_zoom_anchor_NW.Name = "option_zoom_anchor_NW";
|
||||
this.option_zoom_anchor_NW.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_NW.TabIndex = 15;
|
||||
this.option_zoom_anchor_NW.TabStop = true;
|
||||
this.option_zoom_anchor_NW.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_NW.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_N
|
||||
//
|
||||
this.option_zoom_anchor_N.AutoSize = true;
|
||||
this.option_zoom_anchor_N.Location = new System.Drawing.Point(23, 3);
|
||||
this.option_zoom_anchor_N.Name = "option_zoom_anchor_N";
|
||||
this.option_zoom_anchor_N.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_N.TabIndex = 16;
|
||||
this.option_zoom_anchor_N.TabStop = true;
|
||||
this.option_zoom_anchor_N.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_N.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_NE
|
||||
//
|
||||
this.option_zoom_anchor_NE.AutoSize = true;
|
||||
this.option_zoom_anchor_NE.Location = new System.Drawing.Point(43, 3);
|
||||
this.option_zoom_anchor_NE.Name = "option_zoom_anchor_NE";
|
||||
this.option_zoom_anchor_NE.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_NE.TabIndex = 17;
|
||||
this.option_zoom_anchor_NE.TabStop = true;
|
||||
this.option_zoom_anchor_NE.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_NE.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_W
|
||||
//
|
||||
this.option_zoom_anchor_W.AutoSize = true;
|
||||
this.option_zoom_anchor_W.Location = new System.Drawing.Point(3, 22);
|
||||
this.option_zoom_anchor_W.Name = "option_zoom_anchor_W";
|
||||
this.option_zoom_anchor_W.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_W.TabIndex = 18;
|
||||
this.option_zoom_anchor_W.TabStop = true;
|
||||
this.option_zoom_anchor_W.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_W.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_C
|
||||
//
|
||||
this.option_zoom_anchor_C.AutoSize = true;
|
||||
this.option_zoom_anchor_C.Location = new System.Drawing.Point(23, 22);
|
||||
this.option_zoom_anchor_C.Name = "option_zoom_anchor_C";
|
||||
this.option_zoom_anchor_C.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_C.TabIndex = 19;
|
||||
this.option_zoom_anchor_C.TabStop = true;
|
||||
this.option_zoom_anchor_C.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_C.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_E
|
||||
//
|
||||
this.option_zoom_anchor_E.AutoSize = true;
|
||||
this.option_zoom_anchor_E.Location = new System.Drawing.Point(43, 22);
|
||||
this.option_zoom_anchor_E.Name = "option_zoom_anchor_E";
|
||||
this.option_zoom_anchor_E.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_E.TabIndex = 20;
|
||||
this.option_zoom_anchor_E.TabStop = true;
|
||||
this.option_zoom_anchor_E.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_E.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_SW
|
||||
//
|
||||
this.option_zoom_anchor_SW.AutoSize = true;
|
||||
this.option_zoom_anchor_SW.Location = new System.Drawing.Point(3, 41);
|
||||
this.option_zoom_anchor_SW.Name = "option_zoom_anchor_SW";
|
||||
this.option_zoom_anchor_SW.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_SW.TabIndex = 21;
|
||||
this.option_zoom_anchor_SW.TabStop = true;
|
||||
this.option_zoom_anchor_SW.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_SW.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_S
|
||||
//
|
||||
this.option_zoom_anchor_S.AutoSize = true;
|
||||
this.option_zoom_anchor_S.Location = new System.Drawing.Point(23, 41);
|
||||
this.option_zoom_anchor_S.Name = "option_zoom_anchor_S";
|
||||
this.option_zoom_anchor_S.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_S.TabIndex = 22;
|
||||
this.option_zoom_anchor_S.TabStop = true;
|
||||
this.option_zoom_anchor_S.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_S.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_anchor_SE
|
||||
//
|
||||
this.option_zoom_anchor_SE.AutoSize = true;
|
||||
this.option_zoom_anchor_SE.Location = new System.Drawing.Point(43, 41);
|
||||
this.option_zoom_anchor_SE.Name = "option_zoom_anchor_SE";
|
||||
this.option_zoom_anchor_SE.Size = new System.Drawing.Size(14, 13);
|
||||
this.option_zoom_anchor_SE.TabIndex = 23;
|
||||
this.option_zoom_anchor_SE.TabStop = true;
|
||||
this.option_zoom_anchor_SE.UseVisualStyleBackColor = true;
|
||||
this.option_zoom_anchor_SE.CheckedChanged += new System.EventHandler(this.option_zoom_anchor_X_CheckedChanged);
|
||||
//
|
||||
// option_zoom_factor
|
||||
//
|
||||
this.option_zoom_factor.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.option_zoom_factor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.option_zoom_factor.Location = new System.Drawing.Point(9, 28);
|
||||
this.option_zoom_factor.Name = "option_zoom_factor";
|
||||
this.option_zoom_factor.Size = new System.Drawing.Size(28, 20);
|
||||
this.option_zoom_factor.TabIndex = 24;
|
||||
this.option_zoom_factor.TextChanged += new System.EventHandler(this.option_zoom_factor_TextChanged);
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_minToTray);
|
||||
this.flowLayoutPanel1.Controls.Add(this.panel6);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_track_client_windows);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_hide_active);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_always_on_top);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_hide_all_if_not_right_type);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_unique_layout);
|
||||
this.flowLayoutPanel1.Controls.Add(this.panel1);
|
||||
this.flowLayoutPanel1.Controls.Add(this.panel2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_show_overlay);
|
||||
this.flowLayoutPanel1.Controls.Add(this.option_show_thumbnail_frames);
|
||||
this.flowLayoutPanel1.Controls.Add(this.panel5);
|
||||
this.flowLayoutPanel1.Controls.Add(this.panel4);
|
||||
this.flowLayoutPanel1.Controls.Add(this.forum_url);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(252, 448);
|
||||
this.flowLayoutPanel1.TabIndex = 25;
|
||||
this.flowLayoutPanel1.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel1_Paint);
|
||||
//
|
||||
// option_minToTray
|
||||
//
|
||||
this.option_minToTray.AutoSize = true;
|
||||
this.option_minToTray.Location = new System.Drawing.Point(3, 3);
|
||||
this.option_minToTray.Name = "option_minToTray";
|
||||
this.option_minToTray.Size = new System.Drawing.Size(139, 17);
|
||||
this.option_minToTray.TabIndex = 34;
|
||||
this.option_minToTray.Text = "Minimize to System Tray";
|
||||
this.option_minToTray.UseVisualStyleBackColor = true;
|
||||
this.option_minToTray.CheckedChanged += new System.EventHandler(this.option_minToTray_CheckedChanged);
|
||||
//
|
||||
// panel6
|
||||
//
|
||||
this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel6.Controls.Add(this.opacity_bar);
|
||||
this.panel6.Controls.Add(this.opacity_label);
|
||||
this.panel6.Location = new System.Drawing.Point(3, 26);
|
||||
this.panel6.Name = "panel6";
|
||||
this.panel6.Size = new System.Drawing.Size(246, 26);
|
||||
this.panel6.TabIndex = 33;
|
||||
//
|
||||
// opacity_bar
|
||||
//
|
||||
this.opacity_bar.Location = new System.Drawing.Point(48, 1);
|
||||
this.opacity_bar.Maximum = 120;
|
||||
this.opacity_bar.Name = "opacity_bar";
|
||||
this.opacity_bar.Size = new System.Drawing.Size(195, 23);
|
||||
this.opacity_bar.TabIndex = 1;
|
||||
this.opacity_bar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.opacity_bar_Scroll);
|
||||
//
|
||||
// opacity_label
|
||||
//
|
||||
this.opacity_label.AutoSize = true;
|
||||
this.opacity_label.Location = new System.Drawing.Point(2, 5);
|
||||
this.opacity_label.Name = "opacity_label";
|
||||
this.opacity_label.Size = new System.Drawing.Size(43, 13);
|
||||
this.opacity_label.TabIndex = 0;
|
||||
this.opacity_label.Text = "Opacity";
|
||||
//
|
||||
// option_track_client_windows
|
||||
//
|
||||
this.option_track_client_windows.AutoSize = true;
|
||||
this.option_track_client_windows.Location = new System.Drawing.Point(3, 58);
|
||||
this.option_track_client_windows.Name = "option_track_client_windows";
|
||||
this.option_track_client_windows.Size = new System.Drawing.Size(127, 17);
|
||||
this.option_track_client_windows.TabIndex = 32;
|
||||
this.option_track_client_windows.Text = "Track client locations";
|
||||
this.option_track_client_windows.UseVisualStyleBackColor = true;
|
||||
this.option_track_client_windows.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.option_sync_size);
|
||||
this.panel1.Controls.Add(this.option_sync_size_x);
|
||||
this.panel1.Controls.Add(this.option_sync_size_y);
|
||||
this.panel1.Location = new System.Drawing.Point(3, 173);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(246, 30);
|
||||
this.panel1.TabIndex = 26;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel2.Controls.Add(this.label2);
|
||||
this.panel2.Controls.Add(this.panel3);
|
||||
this.panel2.Controls.Add(this.zoom_anchor_lable);
|
||||
this.panel2.Controls.Add(this.option_zoom_on_hover);
|
||||
this.panel2.Controls.Add(this.option_zoom_factor);
|
||||
this.panel2.Location = new System.Drawing.Point(3, 209);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(246, 62);
|
||||
this.panel2.TabIndex = 27;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(43, 31);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(37, 13);
|
||||
this.label2.TabIndex = 29;
|
||||
this.label2.Text = "Factor";
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_NW);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_N);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_NE);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_W);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_SE);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_C);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_S);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_E);
|
||||
this.panel3.Controls.Add(this.option_zoom_anchor_SW);
|
||||
this.panel3.Location = new System.Drawing.Point(182, 3);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(60, 57);
|
||||
this.panel3.TabIndex = 28;
|
||||
//
|
||||
// zoom_anchor_lable
|
||||
//
|
||||
this.zoom_anchor_lable.AutoSize = true;
|
||||
this.zoom_anchor_lable.Location = new System.Drawing.Point(134, 31);
|
||||
this.zoom_anchor_lable.Name = "zoom_anchor_lable";
|
||||
this.zoom_anchor_lable.Size = new System.Drawing.Size(41, 13);
|
||||
this.zoom_anchor_lable.TabIndex = 30;
|
||||
this.zoom_anchor_lable.Text = "Anchor";
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel5.Controls.Add(this.previews_check_listbox);
|
||||
this.panel5.Controls.Add(this.label1);
|
||||
this.panel5.Location = new System.Drawing.Point(3, 300);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(246, 100);
|
||||
this.panel5.TabIndex = 31;
|
||||
//
|
||||
// previews_check_listbox
|
||||
//
|
||||
this.previews_check_listbox.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.previews_check_listbox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.previews_check_listbox.FormattingEnabled = true;
|
||||
this.previews_check_listbox.Location = new System.Drawing.Point(3, 18);
|
||||
this.previews_check_listbox.Name = "previews_check_listbox";
|
||||
this.previews_check_listbox.Size = new System.Drawing.Size(240, 75);
|
||||
this.previews_check_listbox.TabIndex = 28;
|
||||
this.previews_check_listbox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox1_SelectedIndexChanged2);
|
||||
this.previews_check_listbox.SelectedIndexChanged += new System.EventHandler(this.checkedListBox1_SelectedIndexChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(151, 13);
|
||||
this.label1.TabIndex = 29;
|
||||
this.label1.Text = "Previews (check to force hide)";
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Controls.Add(this.aero_status_label);
|
||||
this.panel4.Location = new System.Drawing.Point(3, 406);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(246, 21);
|
||||
this.panel4.TabIndex = 30;
|
||||
//
|
||||
// aero_status_label
|
||||
//
|
||||
this.aero_status_label.AutoSize = true;
|
||||
this.aero_status_label.Location = new System.Drawing.Point(3, 4);
|
||||
this.aero_status_label.Name = "aero_status_label";
|
||||
this.aero_status_label.Size = new System.Drawing.Size(35, 13);
|
||||
this.aero_status_label.TabIndex = 0;
|
||||
this.aero_status_label.Text = "label4";
|
||||
//
|
||||
// previewToyMainBindingSource
|
||||
//
|
||||
this.previewToyMainBindingSource.CurrentChanged += new System.EventHandler(this.previewToyMainBindingSource_CurrentChanged);
|
||||
//
|
||||
// notifyIcon1
|
||||
//
|
||||
this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
|
||||
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
|
||||
this.notifyIcon1.Text = "EVE-O Preview";
|
||||
this.notifyIcon1.Visible = true;
|
||||
this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.restoreToolStripMenuItem,
|
||||
this.exitToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(114, 48);
|
||||
//
|
||||
// restoreToolStripMenuItem
|
||||
//
|
||||
this.restoreToolStripMenuItem.Name = "restoreToolStripMenuItem";
|
||||
this.restoreToolStripMenuItem.Size = new System.Drawing.Size(113, 22);
|
||||
this.restoreToolStripMenuItem.Text = "Restore";
|
||||
this.restoreToolStripMenuItem.Click += new System.EventHandler(this.restoreToolStripMenuItem_Click);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(113, 22);
|
||||
this.exitToolStripMenuItem.Text = "Exit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// PreviewToyHandler
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.ClientSize = new System.Drawing.Size(252, 448);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MainForm";
|
||||
this.Text = "EVE Online previewer";
|
||||
this.TopMost = true;
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
|
||||
this.Load += new System.EventHandler(this.GlassForm_Load);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.panel6.ResumeLayout(false);
|
||||
this.panel6.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel3.PerformLayout();
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.panel5.PerformLayout();
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.previewToyMainBindingSource)).EndInit();
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CheckBox option_hide_active;
|
||||
private CheckBox option_hide_all_if_not_right_type;
|
||||
private CheckBox option_unique_layout;
|
||||
private CheckBox option_sync_size;
|
||||
private BindingSource previewToyMainBindingSource;
|
||||
private CheckBox option_always_on_top;
|
||||
private CheckBox option_show_thumbnail_frames;
|
||||
private LinkLabel forum_url;
|
||||
private TextBox option_sync_size_x;
|
||||
private TextBox option_sync_size_y;
|
||||
private CheckBox option_zoom_on_hover;
|
||||
private CheckBox option_show_overlay;
|
||||
private RadioButton option_zoom_anchor_NW;
|
||||
private RadioButton option_zoom_anchor_N;
|
||||
private RadioButton option_zoom_anchor_NE;
|
||||
private RadioButton option_zoom_anchor_W;
|
||||
private RadioButton option_zoom_anchor_C;
|
||||
private RadioButton option_zoom_anchor_E;
|
||||
private RadioButton option_zoom_anchor_SW;
|
||||
private RadioButton option_zoom_anchor_S;
|
||||
private RadioButton option_zoom_anchor_SE;
|
||||
private TextBox option_zoom_factor;
|
||||
private FlowLayoutPanel flowLayoutPanel1;
|
||||
private Panel panel1;
|
||||
private Panel panel2;
|
||||
private Label label2;
|
||||
private Panel panel3;
|
||||
private Label zoom_anchor_lable;
|
||||
private CheckedListBox previews_check_listbox;
|
||||
private Label label1;
|
||||
private Panel panel4;
|
||||
private Label aero_status_label;
|
||||
private Panel panel5;
|
||||
private CheckBox option_track_client_windows;
|
||||
private Panel panel6;
|
||||
private Label opacity_label;
|
||||
private HScrollBar opacity_bar;
|
||||
private CheckBox option_minToTray;
|
||||
private NotifyIcon notifyIcon1;
|
||||
private ContextMenuStrip contextMenuStrip1;
|
||||
private ToolStripMenuItem restoreToolStripMenuItem;
|
||||
private ToolStripMenuItem exitToolStripMenuItem;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,482 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Windows.Threading;
|
||||
using System.Xml.Linq;
|
||||
using System.IO;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public event EventHandler Minimized;
|
||||
public event EventHandler Maximized;
|
||||
public event EventHandler Restored;
|
||||
|
||||
private readonly bool _isInitialized;
|
||||
private readonly ThumbnailManager _manager;
|
||||
|
||||
|
||||
private Dictionary<ZoomAnchor, RadioButton> _zoomAnchorButtonMap;
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
_isInitialized = false;
|
||||
|
||||
InitializeComponent();
|
||||
init_options();
|
||||
|
||||
// TODO Fix this
|
||||
previews_check_listbox.DisplayMember = "Text";
|
||||
|
||||
this._manager = new ThumbnailManager(add_thumbnail,remove_thumbnail, set_aero_status, set_size);
|
||||
|
||||
_isInitialized = true;
|
||||
|
||||
this._manager.Activate();
|
||||
}
|
||||
|
||||
private void add_thumbnail(IList<string> thumbnails)
|
||||
{
|
||||
this.previews_check_listbox.BeginUpdate();
|
||||
foreach (string th in thumbnails)
|
||||
{
|
||||
previews_check_listbox.Items.Add(th);
|
||||
}
|
||||
this.previews_check_listbox.EndUpdate();
|
||||
}
|
||||
|
||||
private void remove_thumbnail(IList<string> thumbnails)
|
||||
{
|
||||
this.previews_check_listbox.BeginUpdate();
|
||||
foreach (string th in thumbnails)
|
||||
{
|
||||
previews_check_listbox.Items.Remove(th);
|
||||
}
|
||||
this.previews_check_listbox.EndUpdate();
|
||||
}
|
||||
|
||||
private void set_aero_status(bool value)
|
||||
{
|
||||
|
||||
if (value)
|
||||
{
|
||||
aero_status_label.Text = "AERO is ON";
|
||||
aero_status_label.ForeColor = Color.Black;
|
||||
}
|
||||
else
|
||||
{
|
||||
aero_status_label.Text = "AERO is OFF";
|
||||
aero_status_label.ForeColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
private void set_size(int x, int y)
|
||||
{
|
||||
option_sync_size_x.Text = x.ToString();
|
||||
option_sync_size_y.Text = y.ToString();
|
||||
}
|
||||
|
||||
private void GlassForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
private void init_options()
|
||||
{
|
||||
this.Minimized += MainForm_Minimized;
|
||||
|
||||
option_zoom_on_hover.Checked = Properties.Settings.Default.zoom_on_hover;
|
||||
_zoomAnchorButtonMap = new Dictionary<ZoomAnchor, RadioButton>();
|
||||
_zoomAnchorButtonMap[ZoomAnchor.NW] = option_zoom_anchor_NW;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.N] = option_zoom_anchor_N;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.NE] = option_zoom_anchor_NE;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.W] = option_zoom_anchor_W;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.C] = option_zoom_anchor_C;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.E] = option_zoom_anchor_E;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.SW] = option_zoom_anchor_SW;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.S] = option_zoom_anchor_S;
|
||||
_zoomAnchorButtonMap[ZoomAnchor.SE] = option_zoom_anchor_SE;
|
||||
_zoomAnchorButtonMap[(ZoomAnchor)Properties.Settings.Default.zoom_anchor].Checked = true;
|
||||
option_zoom_factor.Text = Properties.Settings.Default.zoom_amount.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
option_always_on_top.Checked = Properties.Settings.Default.always_on_top;
|
||||
option_hide_active.Checked = Properties.Settings.Default.hide_active;
|
||||
option_hide_all_if_not_right_type.Checked = Properties.Settings.Default.hide_all;
|
||||
|
||||
option_unique_layout.Checked = Properties.Settings.Default.unique_layout;
|
||||
|
||||
option_sync_size.Checked = Properties.Settings.Default.sync_resize;
|
||||
option_sync_size_x.Text = Properties.Settings.Default.sync_resize_x.ToString();
|
||||
option_sync_size_y.Text = Properties.Settings.Default.sync_resize_y.ToString();
|
||||
|
||||
option_show_thumbnail_frames.Checked = Properties.Settings.Default.show_thumb_frames;
|
||||
|
||||
option_show_overlay.Checked = Properties.Settings.Default.show_overlay;
|
||||
|
||||
option_track_client_windows.Checked = Properties.Settings.Default.track_client_windows;
|
||||
|
||||
option_minToTray.Checked = Properties.Settings.Default.minimizeToTray;
|
||||
|
||||
// disable/enable zoom suboptions
|
||||
option_zoom_factor.Enabled = Properties.Settings.Default.zoom_on_hover;
|
||||
foreach (var kv in _zoomAnchorButtonMap)
|
||||
{
|
||||
kv.Value.Enabled = Properties.Settings.Default.zoom_on_hover;
|
||||
}
|
||||
|
||||
opacity_bar.Value = Math.Min(100, (int)(100.0 * Properties.Settings.Default.opacity));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void option_hide_all_if_noneve_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.hide_all = option_hide_all_if_not_right_type.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void option_unique_layout_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.unique_layout = option_unique_layout.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void option_hide_active_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.hide_active = option_hide_active.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void option_sync_size_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.sync_resize = option_sync_size.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void parse_size_entry()
|
||||
{
|
||||
UInt32 x = 0, y = 0;
|
||||
|
||||
try
|
||||
{
|
||||
y = Convert.ToUInt32(option_sync_size_y.Text);
|
||||
x = Convert.ToUInt32(option_sync_size_x.Text);
|
||||
}
|
||||
catch (System.FormatException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (x < 64 || y < 64)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.sync_resize_y = y;
|
||||
Properties.Settings.Default.sync_resize_x = x;
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
// resize
|
||||
this._manager.SyncPreviewSize(new Size((int)Properties.Settings.Default.sync_resize_x,
|
||||
(int)Properties.Settings.Default.sync_resize_y));
|
||||
}
|
||||
|
||||
|
||||
private void option_sync_size_x_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
parse_size_entry();
|
||||
}
|
||||
|
||||
|
||||
private void option_sync_size_y_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
parse_size_entry();
|
||||
}
|
||||
|
||||
|
||||
private void option_always_on_top_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.always_on_top = option_always_on_top.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void option_show_thumbnail_frames_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.show_thumb_frames = option_show_thumbnail_frames.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
this._manager.set_frames();
|
||||
}
|
||||
|
||||
private void list_running_clients_SelectedIndexChanged(object sender, EventArgs e) { }
|
||||
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
string url = "https://bitbucket.org/ulph/eve-o-preview-git";
|
||||
ProcessStartInfo sInfo = new ProcessStartInfo(new Uri(url).AbsoluteUri);
|
||||
Process.Start(sInfo);
|
||||
}
|
||||
|
||||
|
||||
private void previewToyMainBindingSource_CurrentChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void option_zoom_on_hover_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized) return;
|
||||
|
||||
Properties.Settings.Default.zoom_on_hover = option_zoom_on_hover.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
option_zoom_factor.Enabled = Properties.Settings.Default.zoom_on_hover;
|
||||
|
||||
foreach (var kv in _zoomAnchorButtonMap)
|
||||
{
|
||||
kv.Value.Enabled = Properties.Settings.Default.zoom_on_hover;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void option_show_overlay_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.show_overlay = option_show_overlay.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void handle_zoom_anchor_setting()
|
||||
{
|
||||
foreach (var kv in _zoomAnchorButtonMap)
|
||||
{
|
||||
if (kv.Value.Checked == true)
|
||||
Properties.Settings.Default.zoom_anchor = (byte)kv.Key;
|
||||
}
|
||||
}
|
||||
|
||||
private void option_zoom_anchor_X_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
handle_zoom_anchor_setting();
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void option_zoom_factor_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
float tmp = (float)Convert.ToDouble(option_zoom_factor.Text);
|
||||
if (tmp < 1)
|
||||
{
|
||||
tmp = 1;
|
||||
}
|
||||
else if (tmp > 10)
|
||||
{
|
||||
tmp = 10;
|
||||
}
|
||||
Properties.Settings.Default.zoom_amount = tmp;
|
||||
option_zoom_factor.Text = tmp.ToString();
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do naught
|
||||
}
|
||||
}
|
||||
|
||||
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
private void checkedListBox1_SelectedIndexChanged2(object sender, EventArgs e)
|
||||
{
|
||||
System.Windows.Forms.ItemCheckEventArgs arg = (System.Windows.Forms.ItemCheckEventArgs)e;
|
||||
((ThumbnailWindow)this.previews_check_listbox.Items[arg.Index]).IsPreviewEnabled = (arg.NewValue != System.Windows.Forms.CheckState.Checked);
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Properties.Settings.Default.track_client_windows = option_track_client_windows.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void opacity_bar_Scroll(object sender, ScrollEventArgs e)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// fire off opacity change
|
||||
Properties.Settings.Default.opacity = Math.Min((float)e.NewValue / 100.0f, 1.0f);
|
||||
Properties.Settings.Default.Save();
|
||||
this._manager.refresh_thumbnails();
|
||||
}
|
||||
|
||||
|
||||
private void OnMinimized(EventArgs e)
|
||||
{
|
||||
if (Minimized != null && Properties.Settings.Default.minimizeToTray)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
else if (Minimized != null && !Properties.Settings.Default.minimizeToTray)
|
||||
{
|
||||
Minimized(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMaximized(EventArgs e)
|
||||
{
|
||||
if (Maximized != null)
|
||||
{
|
||||
Maximized(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRestored(EventArgs e)
|
||||
{
|
||||
Restored?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
switch (m.Msg)
|
||||
{
|
||||
case DwmApiNativeMethods.WM_SIZE:
|
||||
switch (m.WParam.ToInt32())
|
||||
{
|
||||
case DwmApiNativeMethods.SIZE_RESTORED:
|
||||
OnRestored(EventArgs.Empty);
|
||||
break;
|
||||
case DwmApiNativeMethods.SIZE_MINIMIZED:
|
||||
OnMinimized(EventArgs.Empty);
|
||||
break;
|
||||
case DwmApiNativeMethods.SIZE_MAXIMIZED:
|
||||
OnMaximized(EventArgs.Empty);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
void MainForm_Minimized(object sender, EventArgs e)
|
||||
{
|
||||
// TODO: do something here
|
||||
}
|
||||
|
||||
private void option_minToTray_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.minimizeToTray = option_minToTray.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void restoreToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!this.Visible)
|
||||
{
|
||||
this.Show();
|
||||
}
|
||||
else if (Restored != null)
|
||||
{
|
||||
Restored(this, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!this.Visible)
|
||||
{
|
||||
this.Show();
|
||||
}
|
||||
else if (Restored != null)
|
||||
{
|
||||
Restored(this, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
21
Eve-O-Preview/Presentation/IThumbnailManager.cs
Normal file
21
Eve-O-Preview/Presentation/IThumbnailManager.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public interface IThumbnailManager
|
||||
{
|
||||
void Activate();
|
||||
|
||||
void SetThumbnailState(IntPtr thumbnailId, bool hideAlways);
|
||||
void SetThumbnailsSize(Size size);
|
||||
void RefreshThumbnails();
|
||||
void SetupThumbnailFrames();
|
||||
|
||||
event Action<IList<IThumbnailView>> ThumbnailsAdded;
|
||||
event Action<IList<IThumbnailView>> ThumbnailsUpdated;
|
||||
event Action<IList<IThumbnailView>> ThumbnailsRemoved;
|
||||
event Action<Size> ThumbnailSizeChanged;
|
||||
}
|
||||
}
|
209
Eve-O-Preview/Presentation/MainPresenter.cs
Normal file
209
Eve-O-Preview/Presentation/MainPresenter.cs
Normal file
@@ -0,0 +1,209 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class MainPresenter : Presenter<IMainView>
|
||||
{
|
||||
private const string ForumUrl = @"https://forums.eveonline.com/default.aspx?g=posts&t=389086";
|
||||
|
||||
private readonly IThumbnailDescriptionViewFactory _thumbnailDescriptionViewFactory;
|
||||
private readonly IThumbnailManager _manager;
|
||||
private readonly IDictionary<IntPtr, IThumbnailDescriptionView> _thumbnailViews;
|
||||
|
||||
private bool _exitApplication;
|
||||
|
||||
public MainPresenter(IApplicationController controller, IMainView view, IThumbnailDescriptionViewFactory thumbnailDescriptionViewFactory, IThumbnailManager manager)
|
||||
: base(controller, view)
|
||||
{
|
||||
this._thumbnailDescriptionViewFactory = thumbnailDescriptionViewFactory;
|
||||
this._manager = manager;
|
||||
|
||||
this._thumbnailViews = new Dictionary<IntPtr, IThumbnailDescriptionView>();
|
||||
this._exitApplication = false;
|
||||
|
||||
this.View.ApplicationExitRequested += ExitApplication;
|
||||
this.View.FormActivated += Activate;
|
||||
this.View.FormMinimized += Minimize;
|
||||
this.View.FormCloseRequested += Close;
|
||||
this.View.ApplicationSettingsChanged += SaveApplicationSettings;
|
||||
this.View.ThumbnailsSizeChanged += UpdateThumbnailsSize;
|
||||
this.View.ThumbnailStateChanged += UpdateThumbnailState;
|
||||
this.View.ForumUrlLinkActivated += OpenForumUrlLink;
|
||||
|
||||
this._manager.ThumbnailsAdded += ThumbnailsAdded;
|
||||
this._manager.ThumbnailsUpdated += ThumbnailsUpdated;
|
||||
this._manager.ThumbnailsRemoved += ThumbnailsRemoved;
|
||||
this._manager.ThumbnailSizeChanged += ThumbnailSizeChanged;
|
||||
}
|
||||
|
||||
private void ExitApplication()
|
||||
{
|
||||
this._exitApplication = true;
|
||||
this.View.Close();
|
||||
}
|
||||
|
||||
private void Activate()
|
||||
{
|
||||
this.LoadApplicationSettings();
|
||||
this.View.SetForumUrl(MainPresenter.ForumUrl);
|
||||
|
||||
this._manager.Activate();
|
||||
}
|
||||
|
||||
private void Minimize()
|
||||
{
|
||||
if (!this.View.MinimizeToTray)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.View.Hide();
|
||||
}
|
||||
|
||||
private void Close(ViewCloseRequest request)
|
||||
{
|
||||
if (this._exitApplication || !this.View.MinimizeToTray)
|
||||
{
|
||||
request.Allow = true;
|
||||
return;
|
||||
}
|
||||
|
||||
request.Allow = false;
|
||||
this.View.Minimize();
|
||||
}
|
||||
|
||||
private void UpdateThumbnailsSize()
|
||||
{
|
||||
this._manager.SetThumbnailsSize(new Size(this.View.ThumbnailsWidth, this.View.ThumbnailsHeight));
|
||||
this.SaveApplicationSettings();
|
||||
}
|
||||
|
||||
private void LoadApplicationSettings()
|
||||
{
|
||||
this.View.MinimizeToTray = Properties.Settings.Default.minimizeToTray;
|
||||
this.View.ThumbnailsOpacity = Properties.Settings.Default.opacity;
|
||||
this.View.TrackClientLocations = Properties.Settings.Default.track_client_windows;
|
||||
this.View.HideActiveClientThumbnail = Properties.Settings.Default.hide_active;
|
||||
this.View.ShowThumbnailsAlwaysOnTop = Properties.Settings.Default.always_on_top;
|
||||
this.View.HideAllThumbnailsIfClientIsNotActive = Properties.Settings.Default.hide_all;
|
||||
this.View.EnableUniqueThumbnailsLayouts = Properties.Settings.Default.unique_layout;
|
||||
|
||||
this.View.SyncThumbnailsSize = Properties.Settings.Default.sync_resize;
|
||||
this.View.ThumbnailsWidth = (int)Properties.Settings.Default.sync_resize_x;
|
||||
this.View.ThumbnailsHeight = (int)Properties.Settings.Default.sync_resize_y;
|
||||
|
||||
this.View.EnableZoomOnHover = Properties.Settings.Default.zoom_on_hover;
|
||||
this.View.ZoomFactor = (int)Properties.Settings.Default.zoom_amount;
|
||||
this.View.ZoomAnchor = (ZoomAnchor)Properties.Settings.Default.zoom_anchor;
|
||||
|
||||
this.View.ShowThumbnailFrames = Properties.Settings.Default.show_thumb_frames;
|
||||
this.View.ShowThumbnailOverlays = Properties.Settings.Default.show_overlay;
|
||||
}
|
||||
|
||||
private void SaveApplicationSettings()
|
||||
{
|
||||
Properties.Settings.Default.minimizeToTray = this.View.MinimizeToTray;
|
||||
|
||||
Properties.Settings.Default.opacity = (float)this.View.ThumbnailsOpacity;
|
||||
Properties.Settings.Default.track_client_windows = this.View.TrackClientLocations;
|
||||
Properties.Settings.Default.hide_active = this.View.HideActiveClientThumbnail;
|
||||
Properties.Settings.Default.always_on_top = this.View.ShowThumbnailsAlwaysOnTop;
|
||||
Properties.Settings.Default.hide_all = this.View.HideAllThumbnailsIfClientIsNotActive;
|
||||
Properties.Settings.Default.unique_layout = this.View.EnableUniqueThumbnailsLayouts;
|
||||
|
||||
Properties.Settings.Default.sync_resize = this.View.SyncThumbnailsSize;
|
||||
Properties.Settings.Default.sync_resize_x = (uint)this.View.ThumbnailsWidth;
|
||||
Properties.Settings.Default.sync_resize_y = (uint)this.View.ThumbnailsHeight;
|
||||
|
||||
Properties.Settings.Default.zoom_on_hover = this.View.EnableZoomOnHover;
|
||||
Properties.Settings.Default.zoom_amount = this.View.ZoomFactor;
|
||||
Properties.Settings.Default.zoom_anchor = (byte)this.View.ZoomAnchor;
|
||||
|
||||
Properties.Settings.Default.show_overlay = this.View.ShowThumbnailOverlays;
|
||||
Properties.Settings.Default.show_thumb_frames = this.View.ShowThumbnailFrames;
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
this.View.UpdateZoomSettingsView();
|
||||
|
||||
this._manager.SetupThumbnailFrames();
|
||||
this._manager.RefreshThumbnails();
|
||||
}
|
||||
|
||||
private void ThumbnailsAdded(IList<IThumbnailView> thumbnails)
|
||||
{
|
||||
this.View.AddThumbnails(this.GetThumbnailViews(thumbnails, false));
|
||||
}
|
||||
|
||||
private void ThumbnailsUpdated(IList<IThumbnailView> thumbnails)
|
||||
{
|
||||
this.View.UpdateThumbnails(this.GetThumbnailViews(thumbnails, false));
|
||||
}
|
||||
|
||||
private void ThumbnailsRemoved(IList<IThumbnailView> thumbnails)
|
||||
{
|
||||
this.View.RemoveThumbnails(this.GetThumbnailViews(thumbnails, true));
|
||||
}
|
||||
|
||||
private IList<IThumbnailDescriptionView> GetThumbnailViews(IList<IThumbnailView> thumbnails, bool removeFromCache)
|
||||
{
|
||||
IList<IThumbnailDescriptionView> thumbnailViews = new List<IThumbnailDescriptionView>(thumbnails.Count);
|
||||
|
||||
// Time for some thread safety
|
||||
lock (this._thumbnailViews)
|
||||
{
|
||||
foreach (IThumbnailView thumbnail in thumbnails)
|
||||
{
|
||||
IThumbnailDescriptionView thumbnailView;
|
||||
bool foundInCache = this._thumbnailViews.TryGetValue(thumbnail.Id, out thumbnailView);
|
||||
|
||||
if (!foundInCache)
|
||||
{
|
||||
if (removeFromCache)
|
||||
{
|
||||
// This item was not even cached
|
||||
continue;
|
||||
}
|
||||
|
||||
thumbnailView = this._thumbnailDescriptionViewFactory.Create(thumbnail.Id, thumbnail.Title, !thumbnail.IsEnabled);
|
||||
this._thumbnailViews.Add(thumbnail.Id, thumbnailView);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (removeFromCache)
|
||||
{
|
||||
this._thumbnailViews.Remove(thumbnail.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbnailView.Title = thumbnail.Title;
|
||||
}
|
||||
}
|
||||
|
||||
thumbnailViews.Add(thumbnailView);
|
||||
}
|
||||
}
|
||||
|
||||
return thumbnailViews;
|
||||
}
|
||||
|
||||
private void ThumbnailSizeChanged(Size size)
|
||||
{
|
||||
this.View.UpdateThumbnailsSizeView(size);
|
||||
}
|
||||
|
||||
private void UpdateThumbnailState(IntPtr thumbnailId)
|
||||
{
|
||||
this._manager.SetThumbnailState(thumbnailId, this._thumbnailViews[thumbnailId].IsDisabled);
|
||||
}
|
||||
|
||||
private void OpenForumUrlLink()
|
||||
{
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo(new Uri(MainPresenter.ForumUrl).AbsoluteUri);
|
||||
Process.Start(processStartInfo);
|
||||
}
|
||||
}
|
||||
}
|
746
Eve-O-Preview/Presentation/ThumbnailManager.cs
Normal file
746
Eve-O-Preview/Presentation/ThumbnailManager.cs
Normal file
@@ -0,0 +1,746 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Threading;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class ThumbnailManager : IThumbnailManager
|
||||
{
|
||||
private const string ClientProcessName = "ExeFile";
|
||||
private const string DefaultThumbnailTitle = "...";
|
||||
|
||||
private readonly DispatcherTimer _thumbnailUpdateTimer;
|
||||
private readonly IThumbnailViewFactory _thumbnailViewFactory;
|
||||
private readonly Dictionary<IntPtr, IThumbnailView> _thumbnailViews;
|
||||
|
||||
private IntPtr _activeClientHandle;
|
||||
private string _activeClientTitle;
|
||||
|
||||
private bool _ignoreViewEvents;
|
||||
private bool _isHoverEffectActive;
|
||||
private Size _thumbnailBaseSize;
|
||||
private Point _thumbnailBaseLocation;
|
||||
|
||||
// TODO To be moved into a separate class
|
||||
private readonly Dictionary<string, Dictionary<string, Point>> _uniqueLayouts;
|
||||
private readonly Dictionary<string, Point> _flatLayout;
|
||||
private readonly Dictionary<string, string> _flatLayoutShortcuts;
|
||||
private readonly Dictionary<string, WindowProperties> _clientLayout;
|
||||
|
||||
// TODO To be removed
|
||||
private readonly Dictionary<string, string> _xmlBadToOkChars;
|
||||
|
||||
// TODO Drop dependency on the configuration object
|
||||
public ThumbnailManager(IThumbnailViewFactory factory)
|
||||
{
|
||||
this._thumbnailViewFactory = factory;
|
||||
|
||||
this._activeClientHandle = (IntPtr)0;
|
||||
this._activeClientTitle = "";
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
this._isHoverEffectActive = false;
|
||||
|
||||
this._thumbnailViews = new Dictionary<IntPtr, IThumbnailView>();
|
||||
|
||||
// DispatcherTimer setup
|
||||
this._thumbnailUpdateTimer = new DispatcherTimer();
|
||||
this._thumbnailUpdateTimer.Tick += ThumbnailUpdateTimerTick;
|
||||
this._thumbnailUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 500); // TODO Make it configurable
|
||||
|
||||
// TODO Move mayouts stuff out
|
||||
_uniqueLayouts = new Dictionary<string, Dictionary<string, Point>>();
|
||||
_flatLayout = new Dictionary<string, Point>();
|
||||
_flatLayoutShortcuts = new Dictionary<string, string>();
|
||||
_clientLayout = new Dictionary<string, WindowProperties>();
|
||||
|
||||
// TODO To be removed
|
||||
_xmlBadToOkChars = new Dictionary<string, string>();
|
||||
_xmlBadToOkChars["<"] = "---lt---";
|
||||
_xmlBadToOkChars["&"] = "---amp---";
|
||||
_xmlBadToOkChars[">"] = "---gt---";
|
||||
_xmlBadToOkChars["\""] = "---quot---";
|
||||
_xmlBadToOkChars["\'"] = "---apos---";
|
||||
_xmlBadToOkChars[","] = "---comma---";
|
||||
_xmlBadToOkChars["."] = "---dot---";
|
||||
}
|
||||
|
||||
public event Action<IList<IThumbnailView>> ThumbnailsAdded;
|
||||
public event Action<IList<IThumbnailView>> ThumbnailsUpdated;
|
||||
public event Action<IList<IThumbnailView>> ThumbnailsRemoved;
|
||||
public event Action<Size> ThumbnailSizeChanged;
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
this.LoadLayout();
|
||||
|
||||
this._thumbnailUpdateTimer.Start();
|
||||
|
||||
this.RefreshThumbnails();
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
this._thumbnailUpdateTimer.Stop();
|
||||
}
|
||||
|
||||
public void SetThumbnailState(IntPtr thumbnailId, bool hideAlways)
|
||||
{
|
||||
IThumbnailView thumbnail;
|
||||
if (!this._thumbnailViews.TryGetValue(thumbnailId, out thumbnail))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
thumbnail.IsEnabled = !hideAlways;
|
||||
}
|
||||
|
||||
public void SetThumbnailsSize(Size size)
|
||||
{
|
||||
this._ignoreViewEvents = true;
|
||||
|
||||
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in this._thumbnailViews)
|
||||
{
|
||||
entry.Value.Size = size;
|
||||
entry.Value.Refresh();
|
||||
}
|
||||
|
||||
this.ThumbnailSizeChanged?.Invoke(size);
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
}
|
||||
|
||||
// TODO Drop dependency on the configuration object
|
||||
public void RefreshThumbnails()
|
||||
{
|
||||
IntPtr foregroundWindowHandle = DwmApiNativeMethods.GetForegroundWindow();
|
||||
Boolean hideAllThumbnails = (Properties.Settings.Default.hide_all && !this.IsClientWindowActive(foregroundWindowHandle)) || !DwmApiNativeMethods.DwmIsCompositionEnabled();
|
||||
|
||||
this._ignoreViewEvents = true;
|
||||
|
||||
// Hide, show, resize and move
|
||||
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in this._thumbnailViews)
|
||||
{
|
||||
IThumbnailView view = entry.Value;
|
||||
|
||||
if (hideAllThumbnails || !view.IsEnabled)
|
||||
{
|
||||
if (view.IsActive)
|
||||
{
|
||||
view.Hide();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (view.Id == this._activeClientHandle && Properties.Settings.Default.hide_active)
|
||||
{
|
||||
if (view.IsActive)
|
||||
{
|
||||
view.Hide();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Properties.Settings.Default.unique_layout)
|
||||
{
|
||||
this.ApplyPerClientLayout(view, this._activeClientTitle);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ApplyFlatLayout(view);
|
||||
}
|
||||
|
||||
view.IsOverlayEnabled = Properties.Settings.Default.show_overlay;
|
||||
if (!this._isHoverEffectActive)
|
||||
{
|
||||
view.SetOpacity(Properties.Settings.Default.opacity);
|
||||
}
|
||||
|
||||
if (!view.IsActive)
|
||||
{
|
||||
view.Show();
|
||||
}
|
||||
}
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
}
|
||||
|
||||
public void SetupThumbnailFrames()
|
||||
{
|
||||
// TODO Drop config dependency
|
||||
this._ignoreViewEvents = true;
|
||||
|
||||
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in this._thumbnailViews)
|
||||
{
|
||||
entry.Value.SetWindowFrames(Properties.Settings.Default.show_thumb_frames);
|
||||
}
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
}
|
||||
|
||||
private void ThumbnailUpdateTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
this.UpdateThumbnailsList();
|
||||
this.RefreshThumbnails();
|
||||
}
|
||||
|
||||
private Process[] GetClientProcesses()
|
||||
{
|
||||
return Process.GetProcessesByName(ThumbnailManager.ClientProcessName);
|
||||
}
|
||||
|
||||
private void UpdateThumbnailsList()
|
||||
{
|
||||
Process[] clientProcesses = this.GetClientProcesses();
|
||||
List<IntPtr> processHandles = new List<IntPtr>(clientProcesses.Length);
|
||||
|
||||
IntPtr foregroundWindowHandle = DwmApiNativeMethods.GetForegroundWindow();
|
||||
|
||||
List<IThumbnailView> viewsAdded = new List<IThumbnailView>();
|
||||
List<IThumbnailView> viewsUpdated = new List<IThumbnailView>();
|
||||
List<IThumbnailView> viewsRemoved = new List<IThumbnailView>();
|
||||
|
||||
foreach (Process process in clientProcesses)
|
||||
{
|
||||
IntPtr processHandle = process.MainWindowHandle;
|
||||
string processTitle = process.MainWindowTitle;
|
||||
processHandles.Add(processHandle);
|
||||
|
||||
IThumbnailView view;
|
||||
this._thumbnailViews.TryGetValue(processHandle, out view);
|
||||
|
||||
if ((view == null) && (processTitle != ""))
|
||||
{
|
||||
Size thumbnailSize = new Size();
|
||||
thumbnailSize.Width = (int)Properties.Settings.Default.sync_resize_x;
|
||||
thumbnailSize.Height = (int)Properties.Settings.Default.sync_resize_y;
|
||||
|
||||
view = this._thumbnailViewFactory.Create(processHandle, ThumbnailManager.DefaultThumbnailTitle, thumbnailSize);
|
||||
view.IsEnabled = true;
|
||||
view.IsOverlayEnabled = Properties.Settings.Default.show_overlay;
|
||||
view.SetTopMost(Properties.Settings.Default.always_on_top);
|
||||
view.SetWindowFrames(Properties.Settings.Default.show_thumb_frames);
|
||||
|
||||
view.ThumbnailResized += ThumbnailViewResized;
|
||||
view.ThumbnailMoved += ThumbnailViewMoved;
|
||||
view.ThumbnailFocused += ThumbnailViewFocused;
|
||||
view.ThumbnailLostFocus += ThumbnailViewLostFocus;
|
||||
view.ThumbnailActivated += ThumbnailActivated;
|
||||
|
||||
this._thumbnailViews.Add(processHandle, view);
|
||||
|
||||
this.SetupClientWindow(processHandle, processTitle);
|
||||
|
||||
viewsAdded.Add(view);
|
||||
}
|
||||
else if ((view != null) && (processTitle != view.Title)) // update thumbnail title
|
||||
{
|
||||
view.Title = processTitle;
|
||||
|
||||
// TODO Shortcuts should be handled at manager level
|
||||
//string value;
|
||||
//if (_flatLayoutShortcuts.TryGetValue(processTitle, out value))
|
||||
//{
|
||||
// view.RegisterShortcut(value);
|
||||
//}
|
||||
|
||||
this.SetupClientWindow(processHandle, processTitle);
|
||||
|
||||
viewsUpdated.Add(view);
|
||||
}
|
||||
|
||||
if (process.MainWindowHandle == foregroundWindowHandle)
|
||||
{
|
||||
this._activeClientHandle = process.MainWindowHandle;
|
||||
this._activeClientTitle = process.MainWindowTitle;
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
IList<IntPtr> obsoleteThumbnails = new List<IntPtr>();
|
||||
|
||||
foreach (IntPtr processHandle in _thumbnailViews.Keys)
|
||||
{
|
||||
if (!processHandles.Contains(processHandle))
|
||||
{
|
||||
obsoleteThumbnails.Add(processHandle);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (IntPtr processHandle in obsoleteThumbnails)
|
||||
{
|
||||
IThumbnailView view = this._thumbnailViews[processHandle];
|
||||
|
||||
_thumbnailViews.Remove(processHandle);
|
||||
|
||||
// TODO Remove hotkey here
|
||||
view.ThumbnailResized -= ThumbnailViewResized;
|
||||
view.ThumbnailMoved -= ThumbnailViewMoved;
|
||||
view.ThumbnailFocused -= ThumbnailViewFocused;
|
||||
view.ThumbnailLostFocus -= ThumbnailViewLostFocus;
|
||||
view.ThumbnailActivated -= ThumbnailActivated;
|
||||
|
||||
view.Close();
|
||||
|
||||
viewsRemoved.Add(view);
|
||||
}
|
||||
|
||||
this.ThumbnailsAdded?.Invoke(viewsAdded);
|
||||
this.ThumbnailsUpdated?.Invoke(viewsUpdated);
|
||||
this.ThumbnailsRemoved?.Invoke(viewsRemoved);
|
||||
}
|
||||
|
||||
private void ThumbnailViewFocused(IntPtr id)
|
||||
{
|
||||
if (this._isHoverEffectActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this._isHoverEffectActive = true;
|
||||
|
||||
IThumbnailView view = this._thumbnailViews[id];
|
||||
|
||||
this.ThumbnailZoomIn(view);
|
||||
view.SetTopMost(true);
|
||||
|
||||
view.SetOpacity(1.0);
|
||||
}
|
||||
|
||||
private void ThumbnailViewLostFocus(IntPtr id)
|
||||
{
|
||||
if (!this._isHoverEffectActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IThumbnailView view = this._thumbnailViews[id];
|
||||
|
||||
this.ThumbnailZoomOut(view);
|
||||
|
||||
view.SetOpacity(Properties.Settings.Default.opacity);
|
||||
|
||||
this._isHoverEffectActive = false;
|
||||
}
|
||||
|
||||
private void ThumbnailActivated(IntPtr id)
|
||||
{
|
||||
DwmApiNativeMethods.SetForegroundWindow(id);
|
||||
|
||||
int style = DwmApiNativeMethods.GetWindowLong(id, DwmApiNativeMethods.GWL_STYLE);
|
||||
if ((style & DwmApiNativeMethods.WS_MINIMIZE) == DwmApiNativeMethods.WS_MINIMIZE)
|
||||
{
|
||||
DwmApiNativeMethods.ShowWindowAsync(id, DwmApiNativeMethods.SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
this.UpdateClientLocation();
|
||||
|
||||
this.SaveLayout(); // Stores info about client window locations
|
||||
|
||||
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in this._thumbnailViews)
|
||||
{
|
||||
IThumbnailView view = entry.Value;
|
||||
view.SetTopMost(Properties.Settings.Default.always_on_top);
|
||||
}
|
||||
}
|
||||
|
||||
private void ThumbnailViewResized(IntPtr id)
|
||||
{
|
||||
if (this._ignoreViewEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IThumbnailView view = this._thumbnailViews[id];
|
||||
|
||||
this.SetThumbnailsSize(view.Size);
|
||||
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
private void ThumbnailViewMoved(IntPtr id)
|
||||
{
|
||||
if (this._ignoreViewEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IThumbnailView view = this._thumbnailViews[id];
|
||||
|
||||
this.UpdateThumbnailPosition(view.Title, view.Location);
|
||||
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
private void SetupClientWindow(IntPtr clientHandle, string clientTitle)
|
||||
{
|
||||
if (!Properties.Settings.Default.track_client_windows)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WindowProperties windowProperties;
|
||||
if (!this._clientLayout.TryGetValue(clientTitle, out windowProperties))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DwmApiNativeMethods.MoveWindow(clientHandle, windowProperties.X, windowProperties.Y, windowProperties.Width, windowProperties.Height, true);
|
||||
}
|
||||
|
||||
private bool IsClientWindowActive(IntPtr windowHandle)
|
||||
{
|
||||
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in _thumbnailViews)
|
||||
{
|
||||
if (entry.Value.IsKnownHandle(windowHandle))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void UpdateThumbnailPosition(string title, Point position)
|
||||
{
|
||||
if (Properties.Settings.Default.unique_layout)
|
||||
{
|
||||
Dictionary<string, Point> layout;
|
||||
if (_uniqueLayouts.TryGetValue(_activeClientTitle, out layout))
|
||||
{
|
||||
layout[title] = position;
|
||||
}
|
||||
else if (_activeClientTitle == "")
|
||||
{
|
||||
_uniqueLayouts[_activeClientTitle] = new Dictionary<string, Point>();
|
||||
_uniqueLayouts[_activeClientTitle][title] = position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_flatLayout[title] = position;
|
||||
}
|
||||
}
|
||||
|
||||
private void ThumbnailZoomIn(IThumbnailView view)
|
||||
{
|
||||
// TODO Use global settings object
|
||||
float zoomFactor = Properties.Settings.Default.zoom_amount;
|
||||
|
||||
this._thumbnailBaseSize = view.Size;
|
||||
this._thumbnailBaseLocation = view.Location;
|
||||
|
||||
this._ignoreViewEvents = true;
|
||||
view.Size = new Size((int)(zoomFactor * view.Size.Width), (int)(zoomFactor * view.Size.Height));
|
||||
|
||||
int locationX = view.Location.X;
|
||||
int locationY = view.Location.Y;
|
||||
|
||||
int newWidth = view.Size.Width;
|
||||
int newHeight = view.Size.Height;
|
||||
|
||||
int oldWidth = this._thumbnailBaseSize.Width;
|
||||
int oldHeight = this._thumbnailBaseSize.Height;
|
||||
|
||||
// TODO Use global settings object
|
||||
switch ((ZoomAnchor)Properties.Settings.Default.zoom_anchor)
|
||||
{
|
||||
case ZoomAnchor.NW:
|
||||
break;
|
||||
case ZoomAnchor.N:
|
||||
view.Location = new Point(locationX - newWidth / 2 + oldWidth / 2, locationY);
|
||||
break;
|
||||
case ZoomAnchor.NE:
|
||||
view.Location = new Point(locationX - newWidth + oldWidth, locationY);
|
||||
break;
|
||||
|
||||
case ZoomAnchor.W:
|
||||
view.Location = new Point(locationX, locationY - newHeight / 2 + oldHeight / 2);
|
||||
break;
|
||||
case ZoomAnchor.C:
|
||||
view.Location = new Point(locationX - newWidth / 2 + oldWidth / 2, locationY - newHeight / 2 + oldHeight / 2);
|
||||
break;
|
||||
case ZoomAnchor.E:
|
||||
view.Location = new Point(locationX - newWidth + oldWidth, locationY - newHeight / 2 + oldHeight / 2);
|
||||
break;
|
||||
|
||||
case ZoomAnchor.SW:
|
||||
view.Location = new Point(locationX, locationY - newHeight + this._thumbnailBaseSize.Height);
|
||||
break;
|
||||
case ZoomAnchor.S:
|
||||
view.Location = new Point(locationX - newWidth / 2 + oldWidth / 2, locationY - newHeight + oldHeight);
|
||||
break;
|
||||
case ZoomAnchor.SE:
|
||||
view.Location = new Point(locationX - newWidth + oldWidth, locationY - newHeight + oldHeight);
|
||||
break;
|
||||
}
|
||||
|
||||
view.Refresh();
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
}
|
||||
|
||||
private void ThumbnailZoomOut(IThumbnailView view)
|
||||
{
|
||||
this._ignoreViewEvents = true;
|
||||
|
||||
view.Size = this._thumbnailBaseSize;
|
||||
view.Location = this._thumbnailBaseLocation;
|
||||
|
||||
view.Refresh();
|
||||
|
||||
this._ignoreViewEvents = false;
|
||||
}
|
||||
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO Reenable this method
|
||||
private void UpdateClientLocation()
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("ExeFile");
|
||||
List<IntPtr> processHandles = new List<IntPtr>();
|
||||
|
||||
foreach (Process process in processes)
|
||||
{
|
||||
RECT rect = new RECT();
|
||||
DwmApiNativeMethods.GetWindowRect(process.MainWindowHandle, out rect);
|
||||
|
||||
int left = Math.Abs(rect.Left);
|
||||
int right = Math.Abs(rect.Right);
|
||||
int client_width = Math.Abs(left - right);
|
||||
|
||||
int top = Math.Abs(rect.Top);
|
||||
int bottom = Math.Abs(rect.Bottom);
|
||||
int client_height = Math.Abs(top - bottom);
|
||||
|
||||
WindowProperties location = new WindowProperties();
|
||||
location.X = rect.Left;
|
||||
location.Y = rect.Top;
|
||||
location.Width = client_width;
|
||||
location.Height = client_height;
|
||||
|
||||
|
||||
_clientLayout[process.MainWindowTitle] = location;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Layouting and stuff should be renewed later
|
||||
private string remove_nonconform_xml_characters(string entry)
|
||||
{
|
||||
foreach (var kv in _xmlBadToOkChars)
|
||||
{
|
||||
entry = entry.Replace(kv.Key, kv.Value);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private string restore_nonconform_xml_characters(string entry)
|
||||
{
|
||||
foreach (var kv in _xmlBadToOkChars)
|
||||
{
|
||||
entry = entry.Replace(kv.Value, kv.Key);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private XElement MakeXElement(string input)
|
||||
{
|
||||
string clean = remove_nonconform_xml_characters(input).Replace(" ", "_");
|
||||
return new XElement(clean);
|
||||
}
|
||||
|
||||
private string ParseXElement(XElement input)
|
||||
{
|
||||
return restore_nonconform_xml_characters(input.Name.ToString()).Replace("_", " ");
|
||||
}
|
||||
|
||||
private void LoadLayout()
|
||||
{
|
||||
if (File.Exists("layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
Dictionary<string, Point> inner = new Dictionary<string, Point>();
|
||||
foreach (var inner_el in el.Elements())
|
||||
{
|
||||
inner[ParseXElement(inner_el)] = new Point(Convert.ToInt32(inner_el.Element("x")?.Value), Convert.ToInt32(inner_el.Element("y")?.Value));
|
||||
}
|
||||
_uniqueLayouts[ParseXElement(el)] = inner;
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("flat_layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("flat_layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
_flatLayout[ParseXElement(el)] = new Point(Convert.ToInt32(el.Element("x").Value), Convert.ToInt32(el.Element("y").Value));
|
||||
_flatLayoutShortcuts[ParseXElement(el)] = "";
|
||||
|
||||
if (el.Element("shortcut") != null)
|
||||
{
|
||||
_flatLayoutShortcuts[ParseXElement(el)] = el.Element("shortcut").Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("client_layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("client_layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
WindowProperties location = new WindowProperties();
|
||||
location.X = Convert.ToInt32(el.Element("x").Value);
|
||||
location.Y = Convert.ToInt32(el.Element("y").Value);
|
||||
location.Width = Convert.ToInt32(el.Element("width").Value);
|
||||
location.Height = Convert.ToInt32(el.Element("height").Value);
|
||||
|
||||
_clientLayout[ParseXElement(el)] = location;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveLayout()
|
||||
{
|
||||
XElement el = new XElement("layouts");
|
||||
foreach (var client in _uniqueLayouts.Keys)
|
||||
{
|
||||
if (client == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(client);
|
||||
foreach (var thumbnail_ in _uniqueLayouts[client])
|
||||
{
|
||||
string thumbnail = thumbnail_.Key;
|
||||
if (thumbnail == "" || thumbnail == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement position = MakeXElement(thumbnail);
|
||||
position.Add(new XElement("x", thumbnail_.Value.X));
|
||||
position.Add(new XElement("y", thumbnail_.Value.Y));
|
||||
layout.Add(position);
|
||||
}
|
||||
el.Add(layout);
|
||||
}
|
||||
|
||||
el.Save("layout.xml");
|
||||
|
||||
XElement el2 = new XElement("flat_layout");
|
||||
foreach (var clientKV in _flatLayout)
|
||||
{
|
||||
if (clientKV.Key == "" || clientKV.Key == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(clientKV.Key);
|
||||
layout.Add(new XElement("x", clientKV.Value.X));
|
||||
layout.Add(new XElement("y", clientKV.Value.Y));
|
||||
|
||||
string shortcut;
|
||||
if (_flatLayoutShortcuts.TryGetValue(clientKV.Key, out shortcut))
|
||||
{
|
||||
layout.Add(new XElement("shortcut", shortcut));
|
||||
}
|
||||
el2.Add(layout);
|
||||
}
|
||||
|
||||
el2.Save("flat_layout.xml");
|
||||
|
||||
XElement el3 = new XElement("client_layout");
|
||||
foreach (var clientKV in _clientLayout)
|
||||
{
|
||||
if (clientKV.Key == "" || clientKV.Key == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(clientKV.Key);
|
||||
layout.Add(new XElement("x", clientKV.Value.X));
|
||||
layout.Add(new XElement("y", clientKV.Value.Y));
|
||||
layout.Add(new XElement("width", clientKV.Value.Width));
|
||||
layout.Add(new XElement("height", clientKV.Value.Height));
|
||||
el3.Add(layout);
|
||||
}
|
||||
|
||||
el3.Save("client_layout.xml");
|
||||
}
|
||||
|
||||
private void ApplyPerClientLayout(IThumbnailView thumbnailWindow, string last_known_active_window)
|
||||
{
|
||||
Dictionary<string, Point> layout;
|
||||
if (_uniqueLayouts.TryGetValue(last_known_active_window, out layout))
|
||||
{
|
||||
Point new_loc;
|
||||
if (Properties.Settings.Default.unique_layout && layout.TryGetValue(thumbnailWindow.Title, out new_loc))
|
||||
{
|
||||
thumbnailWindow.Location = new_loc;
|
||||
}
|
||||
else
|
||||
{
|
||||
// create inner dict
|
||||
layout[thumbnailWindow.Title] = thumbnailWindow.Location;
|
||||
}
|
||||
}
|
||||
else if (last_known_active_window != "")
|
||||
{
|
||||
// create outer dict
|
||||
_uniqueLayouts[last_known_active_window] = new Dictionary<string, Point>();
|
||||
_uniqueLayouts[last_known_active_window][thumbnailWindow.Title] = thumbnailWindow.Location;
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyFlatLayout(IThumbnailView thumbnailWindow)
|
||||
{
|
||||
Point layout;
|
||||
if (_flatLayout.TryGetValue(thumbnailWindow.Title, out layout))
|
||||
{
|
||||
thumbnailWindow.Location = layout;
|
||||
}
|
||||
else if (thumbnailWindow.Title != "")
|
||||
{
|
||||
_flatLayout[thumbnailWindow.Title] = thumbnailWindow.Location;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
12
Eve-O-Preview/Presentation/ViewCloseRequest.cs
Normal file
12
Eve-O-Preview/Presentation/ViewCloseRequest.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class ViewCloseRequest
|
||||
{
|
||||
public ViewCloseRequest()
|
||||
{
|
||||
this.Allow = true;
|
||||
}
|
||||
|
||||
public bool Allow { get; set; }
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using EveOPreview.UI;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
@@ -11,7 +12,23 @@ namespace EveOPreview
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(true);
|
||||
Application.Run(new MainForm());
|
||||
|
||||
// TODO Switch to another container that provides signed assemblies
|
||||
IIocContainer container = new LightInjectContainer();
|
||||
|
||||
// UI classes
|
||||
IApplicationController controller = new ApplicationController(container)
|
||||
.RegisterView<IMainView, MainForm>()
|
||||
.RegisterView<IThumbnailView, ThumbnailView>()
|
||||
.RegisterView<IThumbnailDescriptionView, ThumbnailDescriptionView>()
|
||||
.RegisterInstance(new ApplicationContext());
|
||||
|
||||
// Application services
|
||||
controller.RegisterService<IThumbnailManager, ThumbnailManager>()
|
||||
.RegisterService<IThumbnailViewFactory, ThumbnailViewFactory>()
|
||||
.RegisterService<IThumbnailDescriptionViewFactory, ThumbnailDescriptionViewFactory>();
|
||||
|
||||
controller.Run<EveOPreview.UI.MainPresenter>();
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,10 +12,11 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")]
|
||||
[assembly: AssemblyVersion("1.18.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.18.0.0")]
|
||||
[assembly: AssemblyVersion("2.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.0.0")]
|
||||
|
||||
// Provide your own key name to build the app locally
|
||||
[assembly: AssemblyKeyName("Phrynohyas")]
|
||||
// TODO Reenable signing
|
||||
//[assembly: AssemblyKeyName("Phrynohyas")]
|
||||
|
||||
[assembly: CLSCompliant(true)]
|
||||
[assembly: CLSCompliant(true)]
|
@@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
public interface IThumbnail
|
||||
{
|
||||
bool IsZoomEnabled { get; set; }
|
||||
bool IsPreviewEnabled { get; set; }
|
||||
bool IsOverlayEnabled { get; set; }
|
||||
|
||||
bool IsPreviewHandle(IntPtr handle);
|
||||
|
||||
void ShowThumbnail();
|
||||
void HideThumbnail();
|
||||
void CloseThumbnail();
|
||||
|
||||
void RegisterShortcut(string shortcut);
|
||||
|
||||
void SetLabel(string label);
|
||||
string GetLabel();
|
||||
|
||||
void SetLocation(Point location);
|
||||
Point GetLocation();
|
||||
|
||||
void SetOpacity(double opacity);
|
||||
void SetTopMost(bool topmost);
|
||||
void SetWindowFrames(bool enable);
|
||||
void SetSize(Size size);
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
public class ThumbnailFactory
|
||||
{
|
||||
public IThumbnail Create(ThumbnailManager manager, IntPtr sourceWindow, string title, Size size)
|
||||
{
|
||||
return new ThumbnailWindow(manager, sourceWindow, title, size);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,507 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Threading;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
public class ThumbnailManager
|
||||
{
|
||||
private readonly Stopwatch _ignoringSizeSync;
|
||||
private DispatcherTimer _dispatcherTimer;
|
||||
private readonly ThumbnailFactory _thumbnailFactory;
|
||||
private readonly Dictionary<IntPtr, IThumbnail> _previews;
|
||||
|
||||
private IntPtr _activeClientHandle;
|
||||
private string _activeClientTitle;
|
||||
|
||||
private readonly Dictionary<string, Dictionary<string, Point>> _uniqueLayouts;
|
||||
private readonly Dictionary<string, Point> _flatLayout;
|
||||
private readonly Dictionary<string, string> _flatLayoutShortcuts;
|
||||
private readonly Dictionary<string, ClientLocation> _clientLayout;
|
||||
|
||||
private readonly Dictionary<string, string> _xmlBadToOkChars;
|
||||
|
||||
private readonly Action<IList<string>> _addThumbnail;
|
||||
private readonly Action<IList<string>> _removeThumbnail;
|
||||
private readonly Action<bool> _setAeroStatus;
|
||||
private readonly Action<int,int> _sizeChange;
|
||||
|
||||
public ThumbnailManager(Action<IList<string>> addThumbnail, Action<IList<string>> removeThumbnail, Action<bool> setAeroStatus, Action<int,int> sizeChange)
|
||||
{
|
||||
_addThumbnail = addThumbnail;
|
||||
_removeThumbnail = removeThumbnail;
|
||||
_setAeroStatus = setAeroStatus;
|
||||
_sizeChange = sizeChange;
|
||||
|
||||
_ignoringSizeSync = new Stopwatch();
|
||||
_ignoringSizeSync.Start();
|
||||
|
||||
this._activeClientHandle = (IntPtr)0;
|
||||
this._activeClientTitle = "";
|
||||
|
||||
_xmlBadToOkChars = new Dictionary<string, string>();
|
||||
_xmlBadToOkChars["<"] = "---lt---";
|
||||
_xmlBadToOkChars["&"] = "---amp---";
|
||||
_xmlBadToOkChars[">"] = "---gt---";
|
||||
_xmlBadToOkChars["\""] = "---quot---";
|
||||
_xmlBadToOkChars["\'"] = "---apos---";
|
||||
_xmlBadToOkChars[","] = "---comma---";
|
||||
_xmlBadToOkChars["."] = "---dot---";
|
||||
|
||||
_uniqueLayouts = new Dictionary<string, Dictionary<string, Point>>();
|
||||
_flatLayout = new Dictionary<string, Point>();
|
||||
_flatLayoutShortcuts = new Dictionary<string, string>();
|
||||
_clientLayout = new Dictionary<string, ClientLocation>();
|
||||
|
||||
this._previews = new Dictionary<IntPtr, IThumbnail>();
|
||||
|
||||
// DispatcherTimer setup
|
||||
_dispatcherTimer = new DispatcherTimer();
|
||||
_dispatcherTimer.Tick += dispatcherTimer_Tick;
|
||||
_dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
|
||||
|
||||
this._thumbnailFactory = new ThumbnailFactory();
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
this.load_layout();
|
||||
this._dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
this._dispatcherTimer.Stop();
|
||||
}
|
||||
|
||||
private void spawn_and_kill_previews()
|
||||
{
|
||||
// TODO Extract this!
|
||||
Process[] processes = Process.GetProcessesByName("ExeFile");
|
||||
List<IntPtr> processHandles = new List<IntPtr>();
|
||||
List<string> addedList=new List<string>();
|
||||
List<string> removedList = new List<string>();
|
||||
// pop new previews
|
||||
|
||||
foreach (Process process in processes)
|
||||
{
|
||||
processHandles.Add(process.MainWindowHandle);
|
||||
|
||||
Size sync_size = new Size();
|
||||
sync_size.Width = (int)Properties.Settings.Default.sync_resize_x;
|
||||
sync_size.Height = (int)Properties.Settings.Default.sync_resize_y;
|
||||
|
||||
if (!_previews.ContainsKey(process.MainWindowHandle) && process.MainWindowTitle != "")
|
||||
{
|
||||
_previews[process.MainWindowHandle] = this._thumbnailFactory.Create(this, process.MainWindowHandle, "...", sync_size);
|
||||
|
||||
// apply more thumbnail specific options
|
||||
_previews[process.MainWindowHandle].SetTopMost(Properties.Settings.Default.always_on_top);
|
||||
_previews[process.MainWindowHandle].SetWindowFrames(Properties.Settings.Default.show_thumb_frames);
|
||||
|
||||
// add a preview also
|
||||
addedList.Add(_previews[process.MainWindowHandle].GetLabel());
|
||||
|
||||
refresh_client_window_locations(process);
|
||||
}
|
||||
|
||||
else if (_previews.ContainsKey(process.MainWindowHandle) && process.MainWindowTitle != _previews[process.MainWindowHandle].GetLabel()) //or update the preview titles
|
||||
{
|
||||
_previews[process.MainWindowHandle].SetLabel(process.MainWindowTitle);
|
||||
string key = _previews[process.MainWindowHandle].GetLabel();
|
||||
string value;
|
||||
if (_flatLayoutShortcuts.TryGetValue(key, out value))
|
||||
{
|
||||
_previews[process.MainWindowHandle].RegisterShortcut(value);
|
||||
}
|
||||
refresh_client_window_locations(process);
|
||||
}
|
||||
|
||||
if (process.MainWindowHandle == DwmApiNativeMethods.GetForegroundWindow())
|
||||
{
|
||||
_activeClientHandle = process.MainWindowHandle;
|
||||
_activeClientTitle = process.MainWindowTitle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO Check for empty list
|
||||
_addThumbnail(addedList);
|
||||
|
||||
// clean up old previews
|
||||
List<IntPtr> to_be_pruned = new List<IntPtr>();
|
||||
foreach (IntPtr processHandle in _previews.Keys)
|
||||
{
|
||||
if (!(processHandles.Contains(processHandle)))
|
||||
{
|
||||
to_be_pruned.Add(processHandle);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (IntPtr processHandle in to_be_pruned)
|
||||
{
|
||||
removedList.Add(_previews[processHandle].GetLabel());
|
||||
|
||||
_previews[processHandle].CloseThumbnail();
|
||||
_previews.Remove(processHandle);
|
||||
}
|
||||
|
||||
_removeThumbnail(removedList);
|
||||
}
|
||||
|
||||
private void refresh_client_window_locations(Process process)
|
||||
{
|
||||
if (Properties.Settings.Default.track_client_windows && _clientLayout.ContainsKey(process.MainWindowTitle))
|
||||
{
|
||||
DwmApiNativeMethods.MoveWindow(process.MainWindowHandle, _clientLayout[process.MainWindowTitle].X,
|
||||
_clientLayout[process.MainWindowTitle].Y, _clientLayout[process.MainWindowTitle].Width,
|
||||
_clientLayout[process.MainWindowTitle].Height, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
spawn_and_kill_previews();
|
||||
refresh_thumbnails();
|
||||
if (_ignoringSizeSync.ElapsedMilliseconds > 500) { _ignoringSizeSync.Stop(); };
|
||||
|
||||
// TODO Do this once in 10 seconds
|
||||
_setAeroStatus(DwmApiNativeMethods.DwmIsCompositionEnabled());
|
||||
}
|
||||
|
||||
public void NotifyPreviewSwitch()
|
||||
{
|
||||
update_client_locations();
|
||||
store_layout(); //todo: check if it actually changed ...
|
||||
foreach (KeyValuePair<IntPtr, IThumbnail> entry in _previews)
|
||||
{
|
||||
entry.Value.SetTopMost(Properties.Settings.Default.always_on_top);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SyncPreviewSize(Size sync_size)
|
||||
{
|
||||
if (Properties.Settings.Default.sync_resize &&
|
||||
Properties.Settings.Default.show_thumb_frames &&
|
||||
_ignoringSizeSync.ElapsedMilliseconds > 500)
|
||||
{
|
||||
_ignoringSizeSync.Stop();
|
||||
|
||||
_sizeChange(sync_size.Width, sync_size.Height);
|
||||
|
||||
foreach (KeyValuePair<IntPtr, IThumbnail> entry in _previews)
|
||||
{
|
||||
if (entry.Value.IsPreviewHandle(DwmApiNativeMethods.GetForegroundWindow()))
|
||||
{
|
||||
entry.Value.SetSize(sync_size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void UpdatePreviewPosition(string preview_title, Point position)
|
||||
{
|
||||
|
||||
if (Properties.Settings.Default.unique_layout)
|
||||
{
|
||||
Dictionary<string, Point> layout;
|
||||
if (_uniqueLayouts.TryGetValue(_activeClientTitle, out layout))
|
||||
{
|
||||
layout[preview_title] = position;
|
||||
}
|
||||
else if (_activeClientTitle == "")
|
||||
{
|
||||
_uniqueLayouts[_activeClientTitle] = new Dictionary<string, Point>();
|
||||
_uniqueLayouts[_activeClientTitle][preview_title] = position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_flatLayout[preview_title] = position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private string remove_nonconform_xml_characters(string entry)
|
||||
{
|
||||
foreach (var kv in _xmlBadToOkChars)
|
||||
{
|
||||
entry = entry.Replace(kv.Key, kv.Value);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private string restore_nonconform_xml_characters(string entry)
|
||||
{
|
||||
foreach (var kv in _xmlBadToOkChars)
|
||||
{
|
||||
entry = entry.Replace(kv.Value, kv.Key);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private XElement MakeXElement(string input)
|
||||
{
|
||||
string clean = remove_nonconform_xml_characters(input).Replace(" ", "_");
|
||||
return new XElement(clean);
|
||||
}
|
||||
|
||||
private string ParseXElement(XElement input)
|
||||
{
|
||||
return restore_nonconform_xml_characters(input.Name.ToString()).Replace("_", " ");
|
||||
}
|
||||
|
||||
private void load_layout()
|
||||
{
|
||||
if (File.Exists("layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
Dictionary<string, Point> inner = new Dictionary<string, Point>();
|
||||
foreach (var inner_el in el.Elements())
|
||||
{
|
||||
inner[ParseXElement(inner_el)] = new Point(Convert.ToInt32(inner_el.Element("x")?.Value), Convert.ToInt32(inner_el.Element("y")?.Value));
|
||||
}
|
||||
_uniqueLayouts[ParseXElement(el)] = inner;
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("flat_layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("flat_layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
_flatLayout[ParseXElement(el)] = new Point(Convert.ToInt32(el.Element("x").Value), Convert.ToInt32(el.Element("y").Value));
|
||||
_flatLayoutShortcuts[ParseXElement(el)] = "";
|
||||
|
||||
if (el.Element("shortcut") != null)
|
||||
{
|
||||
_flatLayoutShortcuts[ParseXElement(el)] = el.Element("shortcut").Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("client_layout.xml"))
|
||||
{
|
||||
XElement rootElement = XElement.Load("client_layout.xml");
|
||||
foreach (var el in rootElement.Elements())
|
||||
{
|
||||
ClientLocation clientLocation = new ClientLocation();
|
||||
clientLocation.X = Convert.ToInt32(el.Element("x").Value);
|
||||
clientLocation.Y = Convert.ToInt32(el.Element("y").Value);
|
||||
clientLocation.Width = Convert.ToInt32(el.Element("width").Value);
|
||||
clientLocation.Height = Convert.ToInt32(el.Element("height").Value);
|
||||
|
||||
_clientLayout[ParseXElement(el)] = clientLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void store_layout()
|
||||
{
|
||||
XElement el = new XElement("layouts");
|
||||
foreach (var client in _uniqueLayouts.Keys)
|
||||
{
|
||||
if (client == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(client);
|
||||
foreach (var thumbnail_ in _uniqueLayouts[client])
|
||||
{
|
||||
string thumbnail = thumbnail_.Key;
|
||||
if (thumbnail == "" || thumbnail == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement position = MakeXElement(thumbnail);
|
||||
position.Add(new XElement("x", thumbnail_.Value.X));
|
||||
position.Add(new XElement("y", thumbnail_.Value.Y));
|
||||
layout.Add(position);
|
||||
}
|
||||
el.Add(layout);
|
||||
}
|
||||
|
||||
el.Save("layout.xml");
|
||||
|
||||
XElement el2 = new XElement("flat_layout");
|
||||
foreach (var clientKV in _flatLayout)
|
||||
{
|
||||
if (clientKV.Key == "" || clientKV.Key == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(clientKV.Key);
|
||||
layout.Add(new XElement("x", clientKV.Value.X));
|
||||
layout.Add(new XElement("y", clientKV.Value.Y));
|
||||
|
||||
string shortcut;
|
||||
if (_flatLayoutShortcuts.TryGetValue(clientKV.Key, out shortcut))
|
||||
{
|
||||
layout.Add(new XElement("shortcut", shortcut));
|
||||
}
|
||||
el2.Add(layout);
|
||||
}
|
||||
|
||||
el2.Save("flat_layout.xml");
|
||||
|
||||
XElement el3 = new XElement("client_layout");
|
||||
foreach (var clientKV in _clientLayout)
|
||||
{
|
||||
if (clientKV.Key == "" || clientKV.Key == "...")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XElement layout = MakeXElement(clientKV.Key);
|
||||
layout.Add(new XElement("x", clientKV.Value.X));
|
||||
layout.Add(new XElement("y", clientKV.Value.Y));
|
||||
layout.Add(new XElement("width", clientKV.Value.Width));
|
||||
layout.Add(new XElement("height", clientKV.Value.Height));
|
||||
el3.Add(layout);
|
||||
}
|
||||
|
||||
el3.Save("client_layout.xml");
|
||||
}
|
||||
|
||||
private void handle_unique_layout(IThumbnail thumbnailWindow, string last_known_active_window)
|
||||
{
|
||||
Dictionary<string, Point> layout;
|
||||
if (_uniqueLayouts.TryGetValue(last_known_active_window, out layout))
|
||||
{
|
||||
Point new_loc;
|
||||
if (Properties.Settings.Default.unique_layout && layout.TryGetValue(thumbnailWindow.GetLabel(), out new_loc))
|
||||
{
|
||||
thumbnailWindow.SetLocation(new_loc);
|
||||
}
|
||||
else
|
||||
{
|
||||
// create inner dict
|
||||
layout[thumbnailWindow.GetLabel()] = thumbnailWindow.GetLocation();
|
||||
}
|
||||
}
|
||||
else if (last_known_active_window != "")
|
||||
{
|
||||
// create outer dict
|
||||
_uniqueLayouts[last_known_active_window] = new Dictionary<string, Point>();
|
||||
_uniqueLayouts[last_known_active_window][thumbnailWindow.GetLabel()] = thumbnailWindow.GetLocation();
|
||||
}
|
||||
}
|
||||
|
||||
private void update_client_locations()
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("ExeFile");
|
||||
List<IntPtr> processHandles = new List<IntPtr>();
|
||||
|
||||
foreach (Process process in processes)
|
||||
{
|
||||
RECT rect = new RECT();
|
||||
DwmApiNativeMethods.GetWindowRect(process.MainWindowHandle, out rect);
|
||||
|
||||
int left = Math.Abs(rect.Left);
|
||||
int right = Math.Abs(rect.Right);
|
||||
int client_width = Math.Abs(left - right);
|
||||
|
||||
int top = Math.Abs(rect.Top);
|
||||
int bottom = Math.Abs(rect.Bottom);
|
||||
int client_height = Math.Abs(top - bottom);
|
||||
|
||||
ClientLocation clientLocation = new ClientLocation();
|
||||
clientLocation.X = rect.Left;
|
||||
clientLocation.Y = rect.Top;
|
||||
clientLocation.Width = client_width;
|
||||
clientLocation.Height = client_height;
|
||||
|
||||
|
||||
_clientLayout[process.MainWindowTitle] = clientLocation;
|
||||
}
|
||||
}
|
||||
|
||||
private void handle_flat_layout(IThumbnail thumbnailWindow)
|
||||
{
|
||||
Point layout;
|
||||
if (_flatLayout.TryGetValue(thumbnailWindow.GetLabel(), out layout))
|
||||
{
|
||||
thumbnailWindow.SetLocation(layout);
|
||||
}
|
||||
else if (thumbnailWindow.GetLabel() != "")
|
||||
{
|
||||
_flatLayout[thumbnailWindow.GetLabel()] = thumbnailWindow.GetLocation();
|
||||
}
|
||||
}
|
||||
|
||||
private bool window_is_preview_or_client(IntPtr window)
|
||||
{
|
||||
bool active_window_is_right_type = false;
|
||||
foreach (KeyValuePair<IntPtr, IThumbnail> entry in _previews)
|
||||
{
|
||||
if (entry.Key == window || entry.Value.IsPreviewHandle(window))
|
||||
{
|
||||
active_window_is_right_type = true;
|
||||
}
|
||||
}
|
||||
return active_window_is_right_type;
|
||||
}
|
||||
|
||||
public void refresh_thumbnails()
|
||||
{
|
||||
|
||||
IntPtr active_window = DwmApiNativeMethods.GetForegroundWindow();
|
||||
|
||||
// hide, show, resize and move
|
||||
foreach (KeyValuePair<IntPtr, IThumbnail> entry in _previews)
|
||||
{
|
||||
if (!window_is_preview_or_client(active_window) && Properties.Settings.Default.hide_all)
|
||||
{
|
||||
entry.Value.HideThumbnail();
|
||||
}
|
||||
else if (entry.Key == _activeClientHandle && Properties.Settings.Default.hide_active)
|
||||
{
|
||||
entry.Value.HideThumbnail();
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.Value.ShowThumbnail();
|
||||
if (Properties.Settings.Default.unique_layout)
|
||||
{
|
||||
handle_unique_layout(entry.Value, _activeClientTitle);
|
||||
}
|
||||
else
|
||||
{
|
||||
handle_flat_layout(entry.Value);
|
||||
}
|
||||
}
|
||||
entry.Value.IsZoomEnabled = Properties.Settings.Default.zoom_on_hover;
|
||||
entry.Value.IsOverlayEnabled = Properties.Settings.Default.show_overlay;
|
||||
entry.Value.SetOpacity(Properties.Settings.Default.opacity);
|
||||
}
|
||||
|
||||
DwmApiNativeMethods.DwmIsCompositionEnabled();
|
||||
}
|
||||
|
||||
public void set_frames()
|
||||
{
|
||||
if (Properties.Settings.Default.show_thumb_frames)
|
||||
{
|
||||
_ignoringSizeSync.Stop();
|
||||
_ignoringSizeSync.Reset();
|
||||
_ignoringSizeSync.Start();
|
||||
}
|
||||
|
||||
foreach (var thumbnail in _previews)
|
||||
{
|
||||
thumbnail.Value.SetWindowFrames(Properties.Settings.Default.show_thumb_frames);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,437 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview
|
||||
{
|
||||
public partial class ThumbnailWindow : Form, IThumbnail
|
||||
{
|
||||
#region Private fields
|
||||
private readonly bool _isInitializing;
|
||||
private readonly IntPtr _sourceWindow;
|
||||
private readonly ThumbnailManager _manager;
|
||||
private readonly ThumbnailOverlay _overlay;
|
||||
private Hotkey _hotkey; // This field stores the hotkey reference
|
||||
|
||||
private Size _baseSize;
|
||||
private Point _basePosition;
|
||||
|
||||
private bool _isThumbnailSetUp;
|
||||
private DWM_THUMBNAIL_PROPERTIES _Thumbnail;
|
||||
private IntPtr _ThumbnailHandle;
|
||||
|
||||
private bool _ignoreMouseOverEvent;
|
||||
private bool _isHoverEffectActive;
|
||||
private bool _isZoomActive;
|
||||
#endregion
|
||||
|
||||
// This constructor should never be used directly
|
||||
public ThumbnailWindow(ThumbnailManager manager, IntPtr sourceWindow, string title, Size size)
|
||||
{
|
||||
this._isInitializing = true;
|
||||
|
||||
this.IsPreviewEnabled = true;
|
||||
this.IsOverlayEnabled = true;
|
||||
|
||||
this._sourceWindow = sourceWindow;
|
||||
this._manager = manager;
|
||||
|
||||
this._isThumbnailSetUp = false;
|
||||
this._ignoreMouseOverEvent = false;
|
||||
this._isHoverEffectActive = false;
|
||||
this._isZoomActive = false;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this.Text = title;
|
||||
|
||||
this._overlay = new ThumbnailOverlay(this.Preview_Click);
|
||||
|
||||
this._isInitializing = false;
|
||||
|
||||
this.SetSize(size);
|
||||
}
|
||||
|
||||
public bool IsZoomEnabled { get; set; }
|
||||
|
||||
public bool IsPreviewEnabled { get; set; }
|
||||
|
||||
public bool IsOverlayEnabled { get; set; }
|
||||
|
||||
public bool IsPreviewHandle(IntPtr handle)
|
||||
{
|
||||
return (this.Handle == handle) || (this._overlay.Handle == handle);
|
||||
}
|
||||
|
||||
public void ShowThumbnail()
|
||||
{
|
||||
if (this.IsPreviewEnabled)
|
||||
{
|
||||
this.Show();
|
||||
if (this.IsOverlayEnabled)
|
||||
{
|
||||
this._overlay.Show();
|
||||
this.MakeOverlayTopMost();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._overlay.Hide();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.HideThumbnail();
|
||||
}
|
||||
}
|
||||
|
||||
public void HideThumbnail()
|
||||
{
|
||||
this.Hide();
|
||||
this._overlay.Hide();
|
||||
}
|
||||
|
||||
public void CloseThumbnail()
|
||||
{
|
||||
this._overlay.Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
public void SetLabel(string label)
|
||||
{
|
||||
this.Text = label;
|
||||
this._overlay.SetOverlayLabel(label);
|
||||
}
|
||||
|
||||
public string GetLabel()
|
||||
{
|
||||
return this.Text;
|
||||
}
|
||||
|
||||
public void SetSize(Size size)
|
||||
{
|
||||
this.Size = size;
|
||||
this._baseSize = this.Size;
|
||||
this._basePosition = this.Location;
|
||||
}
|
||||
|
||||
public void SetLocation(Point location)
|
||||
{
|
||||
if (!(this._isInitializing || this._ignoreMouseOverEvent))
|
||||
{
|
||||
this.Location = location;
|
||||
}
|
||||
|
||||
this.RefreshPreview();
|
||||
}
|
||||
|
||||
public Point GetLocation()
|
||||
{
|
||||
return this.Location;
|
||||
}
|
||||
|
||||
public void SetOpacity(double opacity)
|
||||
{
|
||||
if (this._isHoverEffectActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.Opacity = opacity;
|
||||
}
|
||||
|
||||
public void RegisterShortcut(string shortcut)
|
||||
{
|
||||
if (String.IsNullOrEmpty(shortcut))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
KeysConverter converter = new KeysConverter();
|
||||
object keysObject = converter.ConvertFrom(shortcut);
|
||||
if (keysObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Keys key = (Keys)keysObject;
|
||||
|
||||
Hotkey hotkey = new Hotkey();
|
||||
|
||||
if ((key & Keys.Shift) == Keys.Shift)
|
||||
{
|
||||
hotkey.Shift = true;
|
||||
}
|
||||
|
||||
if ((key & Keys.Alt) == Keys.Alt)
|
||||
{
|
||||
hotkey.Alt = true;
|
||||
}
|
||||
|
||||
if ((key & Keys.Control) == Keys.Control)
|
||||
{
|
||||
hotkey.Control = true;
|
||||
}
|
||||
|
||||
key = key & ~Keys.Shift & ~Keys.Alt & ~Keys.Control;
|
||||
hotkey.KeyCode = key;
|
||||
hotkey.Pressed += Hotkey_Pressed;
|
||||
hotkey.Register(this);
|
||||
|
||||
this._hotkey = hotkey;
|
||||
}
|
||||
|
||||
public void SetTopMost(bool topmost)
|
||||
{
|
||||
if (!this.IsPreviewEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.TopMost = topmost;
|
||||
this.MakeOverlayTopMost();
|
||||
}
|
||||
|
||||
public void SetWindowFrames(bool enable)
|
||||
{
|
||||
this.FormBorderStyle = enable ? FormBorderStyle.SizableToolWindow : FormBorderStyle.None;
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var Params = base.CreateParams;
|
||||
Params.ExStyle |= (int)DwmApiNativeMethods.WS_EX_TOOLWINDOW;
|
||||
return Params;
|
||||
}
|
||||
}
|
||||
|
||||
private void Preview_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
if (!this._ignoreMouseOverEvent)
|
||||
{
|
||||
this._ignoreMouseOverEvent = true;
|
||||
if (this.IsZoomEnabled)
|
||||
{
|
||||
this.ZoomIn();
|
||||
}
|
||||
|
||||
this.SetTopMost(true);
|
||||
}
|
||||
|
||||
this.Opacity = 1.0f;
|
||||
this._isHoverEffectActive = true;
|
||||
|
||||
this.RefreshPreview();
|
||||
}
|
||||
|
||||
private void Preview_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
if (this._ignoreMouseOverEvent)
|
||||
{
|
||||
if (this.IsZoomEnabled)
|
||||
{
|
||||
this.ZoomOut();
|
||||
}
|
||||
|
||||
this._ignoreMouseOverEvent = false;
|
||||
}
|
||||
|
||||
this._isHoverEffectActive = false;
|
||||
this.Opacity = Properties.Settings.Default.opacity; // TODO Use local object
|
||||
|
||||
this.RefreshPreview();
|
||||
}
|
||||
|
||||
private void Preview_Click(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
this.ActivateClient();
|
||||
this._manager.NotifyPreviewSwitch();
|
||||
}
|
||||
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
// do smth cool?
|
||||
}
|
||||
|
||||
if (e.Button == MouseButtons.Middle)
|
||||
{
|
||||
// do smth cool?
|
||||
}
|
||||
}
|
||||
|
||||
private void Hotkey_Pressed(Object sender, EventArgs e)
|
||||
{
|
||||
this.ActivateClient();
|
||||
this._manager.NotifyPreviewSwitch();
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
this.RefreshPreview();
|
||||
|
||||
base.OnResize(e);
|
||||
|
||||
if (!(this._isInitializing || this._ignoreMouseOverEvent))
|
||||
{
|
||||
this._manager.SyncPreviewSize(this.Size);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMove(EventArgs e)
|
||||
{
|
||||
base.OnMove(e);
|
||||
|
||||
if (!(this._isInitializing || this._ignoreMouseOverEvent))
|
||||
{
|
||||
this._manager.UpdatePreviewPosition(this.Text, this.Location);
|
||||
}
|
||||
|
||||
this.RefreshPreview();
|
||||
}
|
||||
|
||||
private void MakeOverlayTopMost()
|
||||
{
|
||||
this._overlay.TopMost = true;
|
||||
}
|
||||
|
||||
private void RefreshPreview()
|
||||
{
|
||||
if (this._isInitializing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (DwmApiNativeMethods.DwmIsCompositionEnabled())
|
||||
{
|
||||
if (this._isThumbnailSetUp == false)
|
||||
{
|
||||
this.SetUpThumbnail();
|
||||
}
|
||||
|
||||
this._Thumbnail.rcDestination = new RECT(0, 0, this.ClientRectangle.Right, this.ClientRectangle.Bottom);
|
||||
DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._ThumbnailHandle, this._Thumbnail);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._isThumbnailSetUp = false;
|
||||
}
|
||||
|
||||
Size overlaySize = this.RenderAreaPictureBox.Size;
|
||||
overlaySize.Width -= 2 * 5;
|
||||
overlaySize.Height -= 2 * 5;
|
||||
|
||||
Point overlayLocation = this.Location;
|
||||
overlayLocation.X += 5 + (this.Size.Width - this.RenderAreaPictureBox.Size.Width) / 2;
|
||||
overlayLocation.Y += 5 + (this.Size.Height - this.RenderAreaPictureBox.Size.Height) - (this.Size.Width - this.RenderAreaPictureBox.Size.Width) / 2;
|
||||
|
||||
this._overlay.Size = overlaySize;
|
||||
this._overlay.Location = overlayLocation;
|
||||
}
|
||||
|
||||
private void SetUpThumbnail()
|
||||
{
|
||||
if (this._isThumbnailSetUp || !DwmApiNativeMethods.DwmIsCompositionEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this._ThumbnailHandle = DwmApiNativeMethods.DwmRegisterThumbnail(this.Handle, this._sourceWindow);
|
||||
|
||||
this._Thumbnail = new DWM_THUMBNAIL_PROPERTIES();
|
||||
this._Thumbnail.dwFlags = DWM_TNP_CONSTANTS.DWM_TNP_VISIBLE
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_OPACITY
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_RECTDESTINATION
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_SOURCECLIENTAREAONLY;
|
||||
this._Thumbnail.opacity = 255;
|
||||
this._Thumbnail.fVisible = true;
|
||||
this._Thumbnail.fSourceClientAreaOnly = true;
|
||||
this._Thumbnail.rcDestination = new RECT(0, 0, this.ClientRectangle.Right, this.ClientRectangle.Bottom);
|
||||
|
||||
DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._ThumbnailHandle, this._Thumbnail);
|
||||
|
||||
this._isThumbnailSetUp = true;
|
||||
}
|
||||
|
||||
private void ZoomIn()
|
||||
{
|
||||
if (this._isZoomActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this._isZoomActive = true;
|
||||
|
||||
// TODO Use global settings object
|
||||
float zoomFactor = Properties.Settings.Default.zoom_amount;
|
||||
|
||||
this._baseSize = this.Size;
|
||||
this._basePosition = this.Location;
|
||||
|
||||
this.Size = new Size((int)(zoomFactor * this.Size.Width), (int)(zoomFactor * this.Size.Height));
|
||||
|
||||
// TODO Use global settings object
|
||||
switch ((ZoomAnchor)Properties.Settings.Default.zoom_anchor)
|
||||
{
|
||||
case ZoomAnchor.NW:
|
||||
break;
|
||||
case ZoomAnchor.N:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width / 2 + this._baseSize.Width / 2, this.Location.Y);
|
||||
break;
|
||||
case ZoomAnchor.NE:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width + this._baseSize.Width, this.Location.Y);
|
||||
break;
|
||||
|
||||
case ZoomAnchor.W:
|
||||
this.Location = new Point(this.Location.X, this.Location.Y - this.Size.Height / 2 + this._baseSize.Height / 2);
|
||||
break;
|
||||
case ZoomAnchor.C:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width / 2 + this._baseSize.Width / 2, this.Location.Y - this.Size.Height / 2 + this._baseSize.Height / 2);
|
||||
break;
|
||||
case ZoomAnchor.E:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width + this._baseSize.Width, this.Location.Y - this.Size.Height / 2 + this._baseSize.Height / 2);
|
||||
break;
|
||||
|
||||
case ZoomAnchor.SW:
|
||||
this.Location = new Point(this.Location.X, this.Location.Y - this.Size.Height + this._baseSize.Height);
|
||||
break;
|
||||
case ZoomAnchor.S:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width / 2 + this._baseSize.Width / 2, this.Location.Y - this.Size.Height + this._baseSize.Height);
|
||||
break;
|
||||
case ZoomAnchor.SE:
|
||||
this.Location = new Point(this.Location.X - this.Size.Width + this._baseSize.Width, this.Location.Y - this.Size.Height + this._baseSize.Height);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ZoomOut()
|
||||
{
|
||||
if (!this._isZoomActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.Size = this._baseSize;
|
||||
this.Location = this._basePosition;
|
||||
|
||||
this._isZoomActive = false;
|
||||
}
|
||||
|
||||
private void ActivateClient()
|
||||
{
|
||||
DwmApiNativeMethods.SetForegroundWindow(this._sourceWindow);
|
||||
|
||||
int style = DwmApiNativeMethods.GetWindowLong(this._sourceWindow, DwmApiNativeMethods.GWL_STYLE);
|
||||
if ((style & DwmApiNativeMethods.WS_MAXIMIZE) == DwmApiNativeMethods.WS_MAXIMIZE)
|
||||
{
|
||||
// Client is already maximized, no action is required
|
||||
}
|
||||
else if ((style & DwmApiNativeMethods.WS_MINIMIZE) == DwmApiNativeMethods.WS_MINIMIZE)
|
||||
{
|
||||
DwmApiNativeMethods.ShowWindowAsync(this._sourceWindow, DwmApiNativeMethods.SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
Eve-O-Preview/UI/Factory/ThumbnailDescriptionViewFactory.cs
Normal file
25
Eve-O-Preview/UI/Factory/ThumbnailDescriptionViewFactory.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class ThumbnailDescriptionViewFactory : IThumbnailDescriptionViewFactory
|
||||
{
|
||||
private readonly IApplicationController _controller;
|
||||
|
||||
public ThumbnailDescriptionViewFactory(IApplicationController controller)
|
||||
{
|
||||
this._controller = controller;
|
||||
}
|
||||
|
||||
public IThumbnailDescriptionView Create(IntPtr id, string title, bool isDisabled)
|
||||
{
|
||||
IThumbnailDescriptionView view = this._controller.Create<IThumbnailDescriptionView>();
|
||||
|
||||
view.Id = id;
|
||||
view.Title = title;
|
||||
view.IsDisabled = isDisabled;
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
26
Eve-O-Preview/UI/Factory/ThumbnailViewFactory.cs
Normal file
26
Eve-O-Preview/UI/Factory/ThumbnailViewFactory.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class ThumbnailViewFactory : IThumbnailViewFactory
|
||||
{
|
||||
private readonly IApplicationController _controller;
|
||||
|
||||
public ThumbnailViewFactory(IApplicationController controller)
|
||||
{
|
||||
this._controller = controller;
|
||||
}
|
||||
|
||||
public IThumbnailView Create(IntPtr id, string title, Size size)
|
||||
{
|
||||
IThumbnailView view = this._controller.Create<IThumbnailView>();
|
||||
|
||||
view.Id = id;
|
||||
view.Title = title;
|
||||
view.Size = size;
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
664
Eve-O-Preview/UI/Implementation/MainForm.Designer.cs
generated
Normal file
664
Eve-O-Preview/UI/Implementation/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,664 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>s
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.Label OpacityLabel;
|
||||
System.Windows.Forms.ToolStripMenuItem RestoreWindowMenuItem;
|
||||
System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
|
||||
System.Windows.Forms.FlowLayoutPanel ContentFlowLayoutPanel;
|
||||
System.Windows.Forms.Panel OpacityPanel;
|
||||
System.Windows.Forms.Label ZoomFactorLabel;
|
||||
System.Windows.Forms.Label ZoomAnchorLabel;
|
||||
System.Windows.Forms.Label PreviewsListLabel;
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.MinimizeToTrayCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ThumbnailsOpacityScrollBar = new System.Windows.Forms.HScrollBar();
|
||||
this.TrackClientLocationsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.HideActiveClientThumbnailCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.SyncThumbnailsSizeCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ThumbnailsWidthNumericEdit = new System.Windows.Forms.NumericUpDown();
|
||||
this.ThumbnailsHeightNumericEdit = new System.Windows.Forms.NumericUpDown();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.ZoomAnchorPanel = new System.Windows.Forms.Panel();
|
||||
this.ZoomAanchorNWRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorNRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorNERadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorWRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorSERadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorCRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorSRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorERadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.ZoomAanchorSWRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.EnableZoomOnHoverCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ZoomFactorNumericEdit = new System.Windows.Forms.NumericUpDown();
|
||||
this.ShowThumbnailOverlaysCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ShowThumbnailFramesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.ThumbnailsList = new System.Windows.Forms.CheckedListBox();
|
||||
this.ForumLinkLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.TrayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
OpacityLabel = new System.Windows.Forms.Label();
|
||||
RestoreWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
ContentFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
OpacityPanel = new System.Windows.Forms.Panel();
|
||||
ZoomFactorLabel = new System.Windows.Forms.Label();
|
||||
ZoomAnchorLabel = new System.Windows.Forms.Label();
|
||||
PreviewsListLabel = new System.Windows.Forms.Label();
|
||||
ContentFlowLayoutPanel.SuspendLayout();
|
||||
OpacityPanel.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ThumbnailsWidthNumericEdit)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ThumbnailsHeightNumericEdit)).BeginInit();
|
||||
this.panel2.SuspendLayout();
|
||||
this.ZoomAnchorPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ZoomFactorNumericEdit)).BeginInit();
|
||||
this.panel5.SuspendLayout();
|
||||
this.TrayMenu.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// OpacityLabel
|
||||
//
|
||||
OpacityLabel.AutoSize = true;
|
||||
OpacityLabel.Location = new System.Drawing.Point(2, 5);
|
||||
OpacityLabel.Name = "OpacityLabel";
|
||||
OpacityLabel.Size = new System.Drawing.Size(43, 13);
|
||||
OpacityLabel.TabIndex = 0;
|
||||
OpacityLabel.Text = "Opacity";
|
||||
//
|
||||
// RestoreWindowMenuItem
|
||||
//
|
||||
RestoreWindowMenuItem.Name = "RestoreWindowMenuItem";
|
||||
RestoreWindowMenuItem.Size = new System.Drawing.Size(113, 22);
|
||||
RestoreWindowMenuItem.Text = "Restore";
|
||||
RestoreWindowMenuItem.Click += new System.EventHandler(this.RestoreMainForm_Handler);
|
||||
//
|
||||
// ExitMenuItem
|
||||
//
|
||||
ExitMenuItem.Name = "ExitMenuItem";
|
||||
ExitMenuItem.Size = new System.Drawing.Size(113, 22);
|
||||
ExitMenuItem.Text = "Exit";
|
||||
ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItemClick_Handler);
|
||||
//
|
||||
// ContentFlowLayoutPanel
|
||||
//
|
||||
ContentFlowLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
|
||||
ContentFlowLayoutPanel.Controls.Add(this.MinimizeToTrayCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(OpacityPanel);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.TrackClientLocationsCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.HideActiveClientThumbnailCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailsAlwaysOnTopCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.HideAllThumbnailsIfClientIsNotActiveCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.EnableUniqueThumbnailsLayoutsCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.panel1);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.panel2);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailOverlaysCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailFramesCheckBox);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.panel5);
|
||||
ContentFlowLayoutPanel.Controls.Add(this.ForumLinkLabel);
|
||||
ContentFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
ContentFlowLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
ContentFlowLayoutPanel.Name = "ContentFlowLayoutPanel";
|
||||
ContentFlowLayoutPanel.Size = new System.Drawing.Size(252, 467);
|
||||
ContentFlowLayoutPanel.TabIndex = 25;
|
||||
//
|
||||
// MinimizeToTrayCheckBox
|
||||
//
|
||||
this.MinimizeToTrayCheckBox.AutoSize = true;
|
||||
this.MinimizeToTrayCheckBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.MinimizeToTrayCheckBox.Name = "MinimizeToTrayCheckBox";
|
||||
this.MinimizeToTrayCheckBox.Size = new System.Drawing.Size(139, 17);
|
||||
this.MinimizeToTrayCheckBox.TabIndex = 34;
|
||||
this.MinimizeToTrayCheckBox.Text = "Minimize to System Tray";
|
||||
this.MinimizeToTrayCheckBox.UseVisualStyleBackColor = true;
|
||||
this.MinimizeToTrayCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// OpacityPanel
|
||||
//
|
||||
OpacityPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
OpacityPanel.Controls.Add(this.ThumbnailsOpacityScrollBar);
|
||||
OpacityPanel.Controls.Add(OpacityLabel);
|
||||
OpacityPanel.Location = new System.Drawing.Point(3, 26);
|
||||
OpacityPanel.Name = "OpacityPanel";
|
||||
OpacityPanel.Size = new System.Drawing.Size(246, 26);
|
||||
OpacityPanel.TabIndex = 33;
|
||||
//
|
||||
// ThumbnailsOpacityScrollBar
|
||||
//
|
||||
this.ThumbnailsOpacityScrollBar.Location = new System.Drawing.Point(48, 1);
|
||||
this.ThumbnailsOpacityScrollBar.Maximum = 120;
|
||||
this.ThumbnailsOpacityScrollBar.Name = "ThumbnailsOpacityScrollBar";
|
||||
this.ThumbnailsOpacityScrollBar.Size = new System.Drawing.Size(195, 23);
|
||||
this.ThumbnailsOpacityScrollBar.TabIndex = 1;
|
||||
this.ThumbnailsOpacityScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// TrackClientLocationsCheckBox
|
||||
//
|
||||
this.TrackClientLocationsCheckBox.AutoSize = true;
|
||||
this.TrackClientLocationsCheckBox.Location = new System.Drawing.Point(3, 58);
|
||||
this.TrackClientLocationsCheckBox.Name = "TrackClientLocationsCheckBox";
|
||||
this.TrackClientLocationsCheckBox.Size = new System.Drawing.Size(127, 17);
|
||||
this.TrackClientLocationsCheckBox.TabIndex = 32;
|
||||
this.TrackClientLocationsCheckBox.Text = "Track client locations";
|
||||
this.TrackClientLocationsCheckBox.UseVisualStyleBackColor = true;
|
||||
this.TrackClientLocationsCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// HideActiveClientThumbnailCheckBox
|
||||
//
|
||||
this.HideActiveClientThumbnailCheckBox.AutoSize = true;
|
||||
this.HideActiveClientThumbnailCheckBox.Checked = true;
|
||||
this.HideActiveClientThumbnailCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.HideActiveClientThumbnailCheckBox.Location = new System.Drawing.Point(3, 81);
|
||||
this.HideActiveClientThumbnailCheckBox.Name = "HideActiveClientThumbnailCheckBox";
|
||||
this.HideActiveClientThumbnailCheckBox.Size = new System.Drawing.Size(184, 17);
|
||||
this.HideActiveClientThumbnailCheckBox.TabIndex = 1;
|
||||
this.HideActiveClientThumbnailCheckBox.Text = "Hide preview of active EVE client";
|
||||
this.HideActiveClientThumbnailCheckBox.UseVisualStyleBackColor = true;
|
||||
this.HideActiveClientThumbnailCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ShowThumbnailsAlwaysOnTopCheckBox
|
||||
//
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.AutoSize = true;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Checked = true;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Location = new System.Drawing.Point(3, 104);
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Name = "ShowThumbnailsAlwaysOnTopCheckBox";
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Size = new System.Drawing.Size(137, 17);
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.TabIndex = 8;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Text = "Previews always on top";
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.UseVisualStyleBackColor = true;
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// HideAllThumbnailsIfClientIsNotActiveCheckBox
|
||||
//
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.AutoSize = true;
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Checked = true;
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Location = new System.Drawing.Point(3, 127);
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Name = "HideAllThumbnailsIfClientIsNotActiveCheckBox";
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Size = new System.Drawing.Size(242, 17);
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.TabIndex = 2;
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Text = "Hide previews if active window not EVE client";
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.UseVisualStyleBackColor = true;
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// EnableUniqueThumbnailsLayoutsCheckBox
|
||||
//
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.AutoSize = true;
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Checked = true;
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Location = new System.Drawing.Point(3, 150);
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Name = "EnableUniqueThumbnailsLayoutsCheckBox";
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Size = new System.Drawing.Size(185, 17);
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.TabIndex = 3;
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Text = "Unique layout for each EVE client";
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.UseVisualStyleBackColor = true;
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.SyncThumbnailsSizeCheckBox);
|
||||
this.panel1.Controls.Add(this.ThumbnailsWidthNumericEdit);
|
||||
this.panel1.Controls.Add(this.ThumbnailsHeightNumericEdit);
|
||||
this.panel1.Location = new System.Drawing.Point(3, 173);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(246, 30);
|
||||
this.panel1.TabIndex = 26;
|
||||
//
|
||||
// SyncThumbnailsSizeCheckBox
|
||||
//
|
||||
this.SyncThumbnailsSizeCheckBox.AutoSize = true;
|
||||
this.SyncThumbnailsSizeCheckBox.Checked = true;
|
||||
this.SyncThumbnailsSizeCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.SyncThumbnailsSizeCheckBox.Location = new System.Drawing.Point(1, 3);
|
||||
this.SyncThumbnailsSizeCheckBox.Name = "SyncThumbnailsSizeCheckBox";
|
||||
this.SyncThumbnailsSizeCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.SyncThumbnailsSizeCheckBox.Size = new System.Drawing.Size(108, 17);
|
||||
this.SyncThumbnailsSizeCheckBox.TabIndex = 4;
|
||||
this.SyncThumbnailsSizeCheckBox.Text = "Syncronize resize";
|
||||
this.SyncThumbnailsSizeCheckBox.UseVisualStyleBackColor = true;
|
||||
this.SyncThumbnailsSizeCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ThumbnailsWidthNumericEdit
|
||||
//
|
||||
this.ThumbnailsWidthNumericEdit.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ThumbnailsWidthNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.ThumbnailsWidthNumericEdit.Increment = new decimal(new int[] {
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsWidthNumericEdit.Location = new System.Drawing.Point(137, 3);
|
||||
this.ThumbnailsWidthNumericEdit.Maximum = new decimal(new int[] {
|
||||
640,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsWidthNumericEdit.Minimum = new decimal(new int[] {
|
||||
80,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsWidthNumericEdit.Name = "ThumbnailsWidthNumericEdit";
|
||||
this.ThumbnailsWidthNumericEdit.Size = new System.Drawing.Size(48, 20);
|
||||
this.ThumbnailsWidthNumericEdit.TabIndex = 11;
|
||||
this.ThumbnailsWidthNumericEdit.Value = new decimal(new int[] {
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsWidthNumericEdit.TextChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler);
|
||||
this.ThumbnailsWidthNumericEdit.ValueChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler);
|
||||
//
|
||||
// ThumbnailsHeightNumericEdit
|
||||
//
|
||||
this.ThumbnailsHeightNumericEdit.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ThumbnailsHeightNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.ThumbnailsHeightNumericEdit.Increment = new decimal(new int[] {
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsHeightNumericEdit.Location = new System.Drawing.Point(196, 3);
|
||||
this.ThumbnailsHeightNumericEdit.Maximum = new decimal(new int[] {
|
||||
480,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsHeightNumericEdit.Minimum = new decimal(new int[] {
|
||||
60,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsHeightNumericEdit.Name = "ThumbnailsHeightNumericEdit";
|
||||
this.ThumbnailsHeightNumericEdit.Size = new System.Drawing.Size(42, 20);
|
||||
this.ThumbnailsHeightNumericEdit.TabIndex = 12;
|
||||
this.ThumbnailsHeightNumericEdit.Value = new decimal(new int[] {
|
||||
70,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ThumbnailsHeightNumericEdit.TextChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler);
|
||||
this.ThumbnailsHeightNumericEdit.ValueChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel2.Controls.Add(ZoomFactorLabel);
|
||||
this.panel2.Controls.Add(this.ZoomAnchorPanel);
|
||||
this.panel2.Controls.Add(ZoomAnchorLabel);
|
||||
this.panel2.Controls.Add(this.EnableZoomOnHoverCheckBox);
|
||||
this.panel2.Controls.Add(this.ZoomFactorNumericEdit);
|
||||
this.panel2.Location = new System.Drawing.Point(3, 209);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(246, 62);
|
||||
this.panel2.TabIndex = 27;
|
||||
//
|
||||
// ZoomFactorLabel
|
||||
//
|
||||
ZoomFactorLabel.AutoSize = true;
|
||||
ZoomFactorLabel.Location = new System.Drawing.Point(49, 31);
|
||||
ZoomFactorLabel.Name = "ZoomFactorLabel";
|
||||
ZoomFactorLabel.Size = new System.Drawing.Size(37, 13);
|
||||
ZoomFactorLabel.TabIndex = 29;
|
||||
ZoomFactorLabel.Text = "Factor";
|
||||
//
|
||||
// ZoomAnchorPanel
|
||||
//
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorNWRadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorNRadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorNERadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorWRadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorSERadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorCRadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorSRadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorERadioButton);
|
||||
this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorSWRadioButton);
|
||||
this.ZoomAnchorPanel.Location = new System.Drawing.Point(182, 3);
|
||||
this.ZoomAnchorPanel.Name = "ZoomAnchorPanel";
|
||||
this.ZoomAnchorPanel.Size = new System.Drawing.Size(60, 57);
|
||||
this.ZoomAnchorPanel.TabIndex = 28;
|
||||
//
|
||||
// ZoomAanchorNWRadioButton
|
||||
//
|
||||
this.ZoomAanchorNWRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorNWRadioButton.Location = new System.Drawing.Point(3, 3);
|
||||
this.ZoomAanchorNWRadioButton.Name = "ZoomAanchorNWRadioButton";
|
||||
this.ZoomAanchorNWRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorNWRadioButton.TabIndex = 15;
|
||||
this.ZoomAanchorNWRadioButton.TabStop = true;
|
||||
this.ZoomAanchorNWRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorNWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorNRadioButton
|
||||
//
|
||||
this.ZoomAanchorNRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorNRadioButton.Location = new System.Drawing.Point(23, 3);
|
||||
this.ZoomAanchorNRadioButton.Name = "ZoomAanchorNRadioButton";
|
||||
this.ZoomAanchorNRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorNRadioButton.TabIndex = 16;
|
||||
this.ZoomAanchorNRadioButton.TabStop = true;
|
||||
this.ZoomAanchorNRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorNRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorNERadioButton
|
||||
//
|
||||
this.ZoomAanchorNERadioButton.AutoSize = true;
|
||||
this.ZoomAanchorNERadioButton.Location = new System.Drawing.Point(43, 3);
|
||||
this.ZoomAanchorNERadioButton.Name = "ZoomAanchorNERadioButton";
|
||||
this.ZoomAanchorNERadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorNERadioButton.TabIndex = 17;
|
||||
this.ZoomAanchorNERadioButton.TabStop = true;
|
||||
this.ZoomAanchorNERadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorNERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorWRadioButton
|
||||
//
|
||||
this.ZoomAanchorWRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorWRadioButton.Location = new System.Drawing.Point(3, 22);
|
||||
this.ZoomAanchorWRadioButton.Name = "ZoomAanchorWRadioButton";
|
||||
this.ZoomAanchorWRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorWRadioButton.TabIndex = 18;
|
||||
this.ZoomAanchorWRadioButton.TabStop = true;
|
||||
this.ZoomAanchorWRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorSERadioButton
|
||||
//
|
||||
this.ZoomAanchorSERadioButton.AutoSize = true;
|
||||
this.ZoomAanchorSERadioButton.Location = new System.Drawing.Point(43, 41);
|
||||
this.ZoomAanchorSERadioButton.Name = "ZoomAanchorSERadioButton";
|
||||
this.ZoomAanchorSERadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorSERadioButton.TabIndex = 23;
|
||||
this.ZoomAanchorSERadioButton.TabStop = true;
|
||||
this.ZoomAanchorSERadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorSERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorCRadioButton
|
||||
//
|
||||
this.ZoomAanchorCRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorCRadioButton.Location = new System.Drawing.Point(23, 22);
|
||||
this.ZoomAanchorCRadioButton.Name = "ZoomAanchorCRadioButton";
|
||||
this.ZoomAanchorCRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorCRadioButton.TabIndex = 19;
|
||||
this.ZoomAanchorCRadioButton.TabStop = true;
|
||||
this.ZoomAanchorCRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorCRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorSRadioButton
|
||||
//
|
||||
this.ZoomAanchorSRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorSRadioButton.Location = new System.Drawing.Point(23, 41);
|
||||
this.ZoomAanchorSRadioButton.Name = "ZoomAanchorSRadioButton";
|
||||
this.ZoomAanchorSRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorSRadioButton.TabIndex = 22;
|
||||
this.ZoomAanchorSRadioButton.TabStop = true;
|
||||
this.ZoomAanchorSRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorSRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorERadioButton
|
||||
//
|
||||
this.ZoomAanchorERadioButton.AutoSize = true;
|
||||
this.ZoomAanchorERadioButton.Location = new System.Drawing.Point(43, 22);
|
||||
this.ZoomAanchorERadioButton.Name = "ZoomAanchorERadioButton";
|
||||
this.ZoomAanchorERadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorERadioButton.TabIndex = 20;
|
||||
this.ZoomAanchorERadioButton.TabStop = true;
|
||||
this.ZoomAanchorERadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAanchorSWRadioButton
|
||||
//
|
||||
this.ZoomAanchorSWRadioButton.AutoSize = true;
|
||||
this.ZoomAanchorSWRadioButton.Location = new System.Drawing.Point(3, 41);
|
||||
this.ZoomAanchorSWRadioButton.Name = "ZoomAanchorSWRadioButton";
|
||||
this.ZoomAanchorSWRadioButton.Size = new System.Drawing.Size(14, 13);
|
||||
this.ZoomAanchorSWRadioButton.TabIndex = 21;
|
||||
this.ZoomAanchorSWRadioButton.TabStop = true;
|
||||
this.ZoomAanchorSWRadioButton.UseVisualStyleBackColor = true;
|
||||
this.ZoomAanchorSWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomAnchorLabel
|
||||
//
|
||||
ZoomAnchorLabel.AutoSize = true;
|
||||
ZoomAnchorLabel.Location = new System.Drawing.Point(138, 31);
|
||||
ZoomAnchorLabel.Name = "ZoomAnchorLabel";
|
||||
ZoomAnchorLabel.Size = new System.Drawing.Size(41, 13);
|
||||
ZoomAnchorLabel.TabIndex = 30;
|
||||
ZoomAnchorLabel.Text = "Anchor";
|
||||
//
|
||||
// EnableZoomOnHoverCheckBox
|
||||
//
|
||||
this.EnableZoomOnHoverCheckBox.AutoSize = true;
|
||||
this.EnableZoomOnHoverCheckBox.Checked = true;
|
||||
this.EnableZoomOnHoverCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.EnableZoomOnHoverCheckBox.Location = new System.Drawing.Point(1, 5);
|
||||
this.EnableZoomOnHoverCheckBox.Name = "EnableZoomOnHoverCheckBox";
|
||||
this.EnableZoomOnHoverCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.EnableZoomOnHoverCheckBox.Size = new System.Drawing.Size(98, 17);
|
||||
this.EnableZoomOnHoverCheckBox.TabIndex = 13;
|
||||
this.EnableZoomOnHoverCheckBox.Text = "Zoom on hover";
|
||||
this.EnableZoomOnHoverCheckBox.UseVisualStyleBackColor = true;
|
||||
this.EnableZoomOnHoverCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ZoomFactorNumericEdit
|
||||
//
|
||||
this.ZoomFactorNumericEdit.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ZoomFactorNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.ZoomFactorNumericEdit.Location = new System.Drawing.Point(9, 28);
|
||||
this.ZoomFactorNumericEdit.Maximum = new decimal(new int[] {
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ZoomFactorNumericEdit.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ZoomFactorNumericEdit.Name = "ZoomFactorNumericEdit";
|
||||
this.ZoomFactorNumericEdit.Size = new System.Drawing.Size(34, 20);
|
||||
this.ZoomFactorNumericEdit.TabIndex = 24;
|
||||
this.ZoomFactorNumericEdit.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.ZoomFactorNumericEdit.ValueChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ShowThumbnailOverlaysCheckBox
|
||||
//
|
||||
this.ShowThumbnailOverlaysCheckBox.AutoSize = true;
|
||||
this.ShowThumbnailOverlaysCheckBox.Checked = true;
|
||||
this.ShowThumbnailOverlaysCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.ShowThumbnailOverlaysCheckBox.Location = new System.Drawing.Point(3, 277);
|
||||
this.ShowThumbnailOverlaysCheckBox.Name = "ShowThumbnailOverlaysCheckBox";
|
||||
this.ShowThumbnailOverlaysCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.ShowThumbnailOverlaysCheckBox.Size = new System.Drawing.Size(90, 17);
|
||||
this.ShowThumbnailOverlaysCheckBox.TabIndex = 14;
|
||||
this.ShowThumbnailOverlaysCheckBox.Text = "Show overlay";
|
||||
this.ShowThumbnailOverlaysCheckBox.UseVisualStyleBackColor = true;
|
||||
this.ShowThumbnailOverlaysCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// ShowThumbnailFramesCheckBox
|
||||
//
|
||||
this.ShowThumbnailFramesCheckBox.AutoSize = true;
|
||||
this.ShowThumbnailFramesCheckBox.Checked = true;
|
||||
this.ShowThumbnailFramesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.ShowThumbnailFramesCheckBox.Location = new System.Drawing.Point(99, 277);
|
||||
this.ShowThumbnailFramesCheckBox.Name = "ShowThumbnailFramesCheckBox";
|
||||
this.ShowThumbnailFramesCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.ShowThumbnailFramesCheckBox.Size = new System.Drawing.Size(127, 17);
|
||||
this.ShowThumbnailFramesCheckBox.TabIndex = 9;
|
||||
this.ShowThumbnailFramesCheckBox.Text = "Show preview frames";
|
||||
this.ShowThumbnailFramesCheckBox.UseVisualStyleBackColor = true;
|
||||
this.ShowThumbnailFramesCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler);
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel5.Controls.Add(this.ThumbnailsList);
|
||||
this.panel5.Controls.Add(PreviewsListLabel);
|
||||
this.panel5.Location = new System.Drawing.Point(3, 300);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(246, 125);
|
||||
this.panel5.TabIndex = 31;
|
||||
//
|
||||
// ThumbnailsList
|
||||
//
|
||||
this.ThumbnailsList.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ThumbnailsList.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.ThumbnailsList.FormattingEnabled = true;
|
||||
this.ThumbnailsList.IntegralHeight = false;
|
||||
this.ThumbnailsList.Location = new System.Drawing.Point(3, 18);
|
||||
this.ThumbnailsList.Name = "ThumbnailsList";
|
||||
this.ThumbnailsList.Size = new System.Drawing.Size(240, 100);
|
||||
this.ThumbnailsList.TabIndex = 28;
|
||||
this.ThumbnailsList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.ThumbnailsList_ItemCheck_Handler);
|
||||
//
|
||||
// PreviewsListLabel
|
||||
//
|
||||
PreviewsListLabel.AutoSize = true;
|
||||
PreviewsListLabel.Location = new System.Drawing.Point(3, 0);
|
||||
PreviewsListLabel.Name = "PreviewsListLabel";
|
||||
PreviewsListLabel.Size = new System.Drawing.Size(151, 13);
|
||||
PreviewsListLabel.TabIndex = 29;
|
||||
PreviewsListLabel.Text = "Previews (check to force hide)";
|
||||
//
|
||||
// ForumLinkLabel
|
||||
//
|
||||
this.ForumLinkLabel.AutoSize = true;
|
||||
this.ForumLinkLabel.Location = new System.Drawing.Point(3, 428);
|
||||
this.ForumLinkLabel.Name = "ForumLinkLabel";
|
||||
this.ForumLinkLabel.Size = new System.Drawing.Size(241, 26);
|
||||
this.ForumLinkLabel.TabIndex = 10;
|
||||
this.ForumLinkLabel.TabStop = true;
|
||||
this.ForumLinkLabel.Text = "to be set from prresenter to be set from prresenter to be set from prresenter to " +
|
||||
"be set from prresenter";
|
||||
this.ForumLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ForumLinkLabelClicked_Handler);
|
||||
//
|
||||
// NotifyIcon
|
||||
//
|
||||
this.NotifyIcon.ContextMenuStrip = this.TrayMenu;
|
||||
this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon")));
|
||||
this.NotifyIcon.Text = "EVE-O Preview";
|
||||
this.NotifyIcon.Visible = true;
|
||||
this.NotifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.RestoreMainForm_Handler);
|
||||
//
|
||||
// TrayMenu
|
||||
//
|
||||
this.TrayMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
RestoreWindowMenuItem,
|
||||
ExitMenuItem});
|
||||
this.TrayMenu.Name = "contextMenuStrip1";
|
||||
this.TrayMenu.Size = new System.Drawing.Size(114, 48);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.ClientSize = new System.Drawing.Size(252, 467);
|
||||
this.Controls.Add(ContentFlowLayoutPanel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MainForm";
|
||||
this.Text = "EVE Online previewer";
|
||||
this.TopMost = true;
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormClosing_Handler);
|
||||
this.Resize += new System.EventHandler(this.MainFormResize_Handler);
|
||||
ContentFlowLayoutPanel.ResumeLayout(false);
|
||||
ContentFlowLayoutPanel.PerformLayout();
|
||||
OpacityPanel.ResumeLayout(false);
|
||||
OpacityPanel.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ThumbnailsWidthNumericEdit)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ThumbnailsHeightNumericEdit)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.ZoomAnchorPanel.ResumeLayout(false);
|
||||
this.ZoomAnchorPanel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ZoomFactorNumericEdit)).EndInit();
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.panel5.PerformLayout();
|
||||
this.TrayMenu.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CheckBox HideActiveClientThumbnailCheckBox;
|
||||
private CheckBox HideAllThumbnailsIfClientIsNotActiveCheckBox;
|
||||
private CheckBox EnableUniqueThumbnailsLayoutsCheckBox;
|
||||
private CheckBox SyncThumbnailsSizeCheckBox;
|
||||
private CheckBox ShowThumbnailsAlwaysOnTopCheckBox;
|
||||
private CheckBox ShowThumbnailFramesCheckBox;
|
||||
private LinkLabel ForumLinkLabel;
|
||||
private NumericUpDown ThumbnailsWidthNumericEdit;
|
||||
private NumericUpDown ThumbnailsHeightNumericEdit;
|
||||
private CheckBox EnableZoomOnHoverCheckBox;
|
||||
private CheckBox ShowThumbnailOverlaysCheckBox;
|
||||
private RadioButton ZoomAanchorNWRadioButton;
|
||||
private RadioButton ZoomAanchorNRadioButton;
|
||||
private RadioButton ZoomAanchorNERadioButton;
|
||||
private RadioButton ZoomAanchorWRadioButton;
|
||||
private RadioButton ZoomAanchorCRadioButton;
|
||||
private RadioButton ZoomAanchorERadioButton;
|
||||
private RadioButton ZoomAanchorSWRadioButton;
|
||||
private RadioButton ZoomAanchorSRadioButton;
|
||||
private RadioButton ZoomAanchorSERadioButton;
|
||||
private NumericUpDown ZoomFactorNumericEdit;
|
||||
private Panel panel1;
|
||||
private Panel panel2;
|
||||
private Panel ZoomAnchorPanel;
|
||||
private CheckedListBox ThumbnailsList;
|
||||
private Panel panel5;
|
||||
private CheckBox TrackClientLocationsCheckBox;
|
||||
private HScrollBar ThumbnailsOpacityScrollBar;
|
||||
private CheckBox MinimizeToTrayCheckBox;
|
||||
private NotifyIcon NotifyIcon;
|
||||
private ContextMenuStrip TrayMenu;
|
||||
}
|
||||
}
|
399
Eve-O-Preview/UI/Implementation/MainForm.cs
Normal file
399
Eve-O-Preview/UI/Implementation/MainForm.cs
Normal file
@@ -0,0 +1,399 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public partial class MainForm : Form, IMainView
|
||||
{
|
||||
private readonly ApplicationContext _context;
|
||||
private readonly Dictionary<ZoomAnchor, RadioButton> _zoomAnchorMap;
|
||||
private ZoomAnchor _cachedZoomAnchor;
|
||||
private bool _suppressEvents;
|
||||
|
||||
public MainForm(ApplicationContext context)
|
||||
{
|
||||
this._context = context;
|
||||
this._zoomAnchorMap = new Dictionary<ZoomAnchor, RadioButton>();
|
||||
this._cachedZoomAnchor = ZoomAnchor.NW;
|
||||
this._suppressEvents = false;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this.ThumbnailsList.DisplayMember = "Title";
|
||||
|
||||
this.InitZoomAnchorMap();
|
||||
}
|
||||
|
||||
public bool MinimizeToTray
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.MinimizeToTrayCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.MinimizeToTrayCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double ThumbnailsOpacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Min(this.ThumbnailsOpacityScrollBar.Value / 100.00, 1.00);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ThumbnailsOpacityScrollBar.Value = Math.Min(100, (int)(100.0 * value));
|
||||
}
|
||||
}
|
||||
|
||||
public bool TrackClientLocations
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TrackClientLocationsCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.TrackClientLocationsCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HideActiveClientThumbnail
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HideActiveClientThumbnailCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.HideActiveClientThumbnailCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowThumbnailsAlwaysOnTop
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ShowThumbnailsAlwaysOnTopCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ShowThumbnailsAlwaysOnTopCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HideAllThumbnailsIfClientIsNotActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.HideAllThumbnailsIfClientIsNotActiveCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableUniqueThumbnailsLayouts
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.EnableUniqueThumbnailsLayoutsCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EnableUniqueThumbnailsLayoutsCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SyncThumbnailsSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.SyncThumbnailsSizeCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SyncThumbnailsSizeCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ThumbnailsWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.ThumbnailsWidthNumericEdit.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ThumbnailsWidthNumericEdit.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ThumbnailsHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.ThumbnailsHeightNumericEdit.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ThumbnailsHeightNumericEdit.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableZoomOnHover
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.EnableZoomOnHoverCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EnableZoomOnHoverCheckBox.Checked = value;
|
||||
this.UpdateZoomSettingsView();
|
||||
}
|
||||
}
|
||||
|
||||
public int ZoomFactor
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.ZoomFactorNumericEdit.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ZoomFactorNumericEdit.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ZoomAnchor ZoomAnchor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._zoomAnchorMap[this._cachedZoomAnchor].Checked)
|
||||
{
|
||||
return this._cachedZoomAnchor;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<ZoomAnchor, RadioButton> valuePair in this._zoomAnchorMap)
|
||||
{
|
||||
if (!valuePair.Value.Checked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
this._cachedZoomAnchor = valuePair.Key;
|
||||
return this._cachedZoomAnchor;
|
||||
}
|
||||
|
||||
// Default value
|
||||
return ZoomAnchor.NW;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._cachedZoomAnchor = value;
|
||||
this._zoomAnchorMap[this._cachedZoomAnchor].Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowThumbnailOverlays
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ShowThumbnailOverlaysCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ShowThumbnailOverlaysCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowThumbnailFrames
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ShowThumbnailFramesCheckBox.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ShowThumbnailFramesCheckBox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new void Show()
|
||||
{
|
||||
// Registers the current instance as the application's Main Form
|
||||
this._context.MainForm = this;
|
||||
|
||||
this._suppressEvents = true;
|
||||
this.FormActivated?.Invoke();
|
||||
this._suppressEvents = false;
|
||||
|
||||
Application.Run(this._context);
|
||||
}
|
||||
|
||||
public void Minimize()
|
||||
{
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
public void SetForumUrl(string url)
|
||||
{
|
||||
this.ForumLinkLabel.Text = url;
|
||||
}
|
||||
|
||||
public void AddThumbnails(IList<IThumbnailDescriptionView> thumbnails)
|
||||
{
|
||||
if (thumbnails.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ThumbnailsList.BeginUpdate();
|
||||
|
||||
foreach (IThumbnailDescriptionView view in thumbnails)
|
||||
{
|
||||
this.ThumbnailsList.Items.Add(view);
|
||||
}
|
||||
|
||||
this.ThumbnailsList.EndUpdate();
|
||||
}
|
||||
|
||||
public void UpdateThumbnails(IList<IThumbnailDescriptionView> thumbnails)
|
||||
{
|
||||
// Just trigger redraw
|
||||
if (thumbnails.Count > 0)
|
||||
{
|
||||
this.ThumbnailsList.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveThumbnails(IList<IThumbnailDescriptionView> thumbnails)
|
||||
{
|
||||
if (thumbnails.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ThumbnailsList.BeginUpdate();
|
||||
|
||||
foreach (IThumbnailDescriptionView view in thumbnails)
|
||||
{
|
||||
this.ThumbnailsList.Items.Remove(view);
|
||||
}
|
||||
|
||||
this.ThumbnailsList.EndUpdate();
|
||||
}
|
||||
|
||||
public void UpdateThumbnailsSizeView(Size size)
|
||||
{
|
||||
this.ThumbnailsWidth = size.Width;
|
||||
this.ThumbnailsHeight = size.Height;
|
||||
}
|
||||
|
||||
public void UpdateZoomSettingsView()
|
||||
{
|
||||
bool enableControls = this.EnableZoomOnHover;
|
||||
this.ZoomFactorNumericEdit.Enabled = enableControls;
|
||||
this.ZoomAnchorPanel.Enabled = enableControls;
|
||||
}
|
||||
|
||||
public event Action ApplicationExitRequested;
|
||||
public event Action FormActivated;
|
||||
public event Action FormMinimized;
|
||||
public event Action<ViewCloseRequest> FormCloseRequested;
|
||||
public event Action ApplicationSettingsChanged;
|
||||
public event Action ThumbnailsSizeChanged;
|
||||
public event Action<IntPtr> ThumbnailStateChanged;
|
||||
public event Action ForumUrlLinkActivated;
|
||||
|
||||
#region UI events
|
||||
private void OptionChanged_Handler(object sender, EventArgs e)
|
||||
{
|
||||
if (this._suppressEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ApplicationSettingsChanged?.Invoke();
|
||||
}
|
||||
|
||||
private void ThumbnailSizeChanged_Handler(object sender, EventArgs e)
|
||||
{
|
||||
if (this._suppressEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ThumbnailsSizeChanged?.Invoke();
|
||||
}
|
||||
|
||||
private void ThumbnailsList_ItemCheck_Handler(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
IThumbnailDescriptionView selectedItem = this.ThumbnailsList.Items[e.Index] as IThumbnailDescriptionView;
|
||||
if (selectedItem == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
selectedItem.IsDisabled = (e.NewValue == CheckState.Checked);
|
||||
|
||||
this.ThumbnailStateChanged?.Invoke(selectedItem.Id);
|
||||
}
|
||||
|
||||
private void ForumLinkLabelClicked_Handler(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
this.ForumUrlLinkActivated?.Invoke();
|
||||
}
|
||||
|
||||
private void MainFormResize_Handler(object sender, EventArgs e)
|
||||
{
|
||||
if (this.WindowState != FormWindowState.Minimized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.FormMinimized?.Invoke();
|
||||
}
|
||||
|
||||
private void MainFormClosing_Handler(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
ViewCloseRequest request = new ViewCloseRequest();
|
||||
|
||||
this.FormCloseRequested?.Invoke(request);
|
||||
|
||||
e.Cancel = !request.Allow;
|
||||
}
|
||||
|
||||
private void RestoreMainForm_Handler(object sender, EventArgs e)
|
||||
{
|
||||
// This is form's GUI lifecycle event that is invariant to the Form data
|
||||
base.Show();
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
this.BringToFront();
|
||||
}
|
||||
|
||||
private void ExitMenuItemClick_Handler(object sender, EventArgs e)
|
||||
{
|
||||
this.ApplicationExitRequested?.Invoke();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void InitZoomAnchorMap()
|
||||
{
|
||||
this._zoomAnchorMap[ZoomAnchor.NW] = this.ZoomAanchorNWRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.N] = this.ZoomAanchorNRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.NE] = this.ZoomAanchorNERadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.W] = this.ZoomAanchorWRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.C] = this.ZoomAanchorCRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.E] = this.ZoomAanchorERadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.SW] = this.ZoomAanchorSWRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.S] = this.ZoomAanchorSRadioButton;
|
||||
this._zoomAnchorMap[ZoomAnchor.SE] = this.ZoomAanchorSERadioButton;
|
||||
}
|
||||
}
|
||||
}
|
@@ -117,17 +117,203 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="previewToyMainBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="OpacityLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="OpacityLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="RestoreWindowMenuItem.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ExitMenuItem.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ContentFlowLayoutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ContentFlowLayoutPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="MinimizeToTrayCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="OpacityPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="OpacityPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsOpacityScrollBar.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TrackClientLocationsCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HideActiveClientThumbnailCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailsAlwaysOnTopCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HideAllThumbnailsIfClientIsNotActiveCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableUniqueThumbnailsLayoutsCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SyncThumbnailsSizeCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsWidthNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsHeightNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="panel2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableZoomOnHoverCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailOverlaysCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailFramesCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="panel5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsList.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PreviewsListLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="PreviewsListLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ForumLinkLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsOpacityScrollBar.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SyncThumbnailsSizeCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsWidthNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsHeightNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorCRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorCRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableZoomOnHoverCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="NotifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>237, 17</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>350, 17</value>
|
||||
<metadata name="TrayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>123, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="notifyIcon1.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<data name="NotifyIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAUAEBAAAAAAIABoBAAAVgAAABgYAAAAACAAiAkAAL4EAAAgIAAAAAAgAKgQAABGDgAAMDAAAAAA
|
||||
IACoJQAA7h4AAEBAAAAAACAAKEIAAJZEAAAoAAAAEAAAACAAAAABACAAAAAAAAAIAAAAAAAAAAAAAAAA
|
||||
@@ -706,6 +892,9 @@
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>86</value>
|
||||
</metadata>
|
25
Eve-O-Preview/UI/Implementation/ThumbnailDescriptionView.cs
Normal file
25
Eve-O-Preview/UI/Implementation/ThumbnailDescriptionView.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public class ThumbnailDescriptionView : IThumbnailDescriptionView
|
||||
{
|
||||
public IntPtr Id { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public bool IsDisabled { get; set; }
|
||||
|
||||
public void Show()
|
||||
{
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,33 +1,33 @@
|
||||
namespace EveOPreview
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
partial class ThumbnailOverlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
partial class ThumbnailOverlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.PictureBox OverlayAreaPictureBox;
|
||||
this.OverlayLabel = new System.Windows.Forms.Label();
|
||||
OverlayAreaPictureBox = new System.Windows.Forms.PictureBox();
|
||||
@@ -81,7 +81,7 @@
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public partial class ThumbnailOverlay : Form
|
||||
{
|
@@ -1,6 +1,6 @@
|
||||
namespace EveOPreview
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
partial class ThumbnailWindow
|
||||
partial class ThumbnailView
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@@ -31,11 +31,11 @@ namespace EveOPreview
|
||||
this.RenderAreaPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.RenderAreaPictureBox.TabIndex = 0;
|
||||
this.RenderAreaPictureBox.TabStop = false;
|
||||
this.RenderAreaPictureBox.MouseLeave += new System.EventHandler(this.Preview_MouseLeave);
|
||||
this.RenderAreaPictureBox.MouseHover += new System.EventHandler(this.Preview_MouseHover);
|
||||
this.RenderAreaPictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Preview_Click);
|
||||
this.RenderAreaPictureBox.MouseLeave += new System.EventHandler(this.LostFocus_Handler);
|
||||
this.RenderAreaPictureBox.MouseHover += new System.EventHandler(this.Focused_Handler);
|
||||
this.RenderAreaPictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ThumbnailActivated_Handler);
|
||||
//
|
||||
// Preview
|
||||
// ThumbnailView
|
||||
//
|
||||
this.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -47,12 +47,14 @@ namespace EveOPreview
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(64, 64);
|
||||
this.Name = "ThumbnailWindow";
|
||||
this.Name = "ThumbnailView";
|
||||
this.Opacity = 0.1D;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Preview";
|
||||
this.TopMost = true;
|
||||
this.Move += new System.EventHandler(this.Move_Handler);
|
||||
this.Resize += new System.EventHandler(this.Resize_Handler);
|
||||
((System.ComponentModel.ISupportInitialize)(this.RenderAreaPictureBox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
282
Eve-O-Preview/UI/Implementation/ThumbnailView.cs
Normal file
282
Eve-O-Preview/UI/Implementation/ThumbnailView.cs
Normal file
@@ -0,0 +1,282 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public partial class ThumbnailView : Form, IThumbnailView
|
||||
{
|
||||
#region Private fields
|
||||
|
||||
//private readonly IThumbnailManager _manager;
|
||||
private readonly ThumbnailOverlay _overlay;
|
||||
|
||||
//private Size _baseSize;
|
||||
//private Point _basePosition;
|
||||
|
||||
// This is pure brainless View
|
||||
// Just somewhat more complex than usual
|
||||
private bool _isThumbnailSetUp;
|
||||
private DWM_THUMBNAIL_PROPERTIES _Thumbnail;
|
||||
private IntPtr _ThumbnailHandle;
|
||||
private int _currentWidth;
|
||||
private int _currentHeight;
|
||||
private int _currentTop;
|
||||
private int _currentLeft;
|
||||
#endregion
|
||||
|
||||
public ThumbnailView()
|
||||
{
|
||||
this.IsEnabled = true;
|
||||
this.IsActive = false;
|
||||
|
||||
this.IsOverlayEnabled = false;
|
||||
this._isThumbnailSetUp = false;
|
||||
|
||||
this._currentWidth = -1;
|
||||
this._currentHeight = -1;
|
||||
this._currentTop = -1;
|
||||
this._currentLeft = -1;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this._overlay = new ThumbnailOverlay(this.ThumbnailActivated_Handler);
|
||||
}
|
||||
|
||||
public IntPtr Id { get; set; }
|
||||
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.Text = value;
|
||||
this._overlay.SetOverlayLabel(value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public bool IsOverlayEnabled { get; set; }
|
||||
|
||||
public event Action<IntPtr> ThumbnailResized;
|
||||
|
||||
public event Action<IntPtr> ThumbnailMoved;
|
||||
|
||||
public event Action<IntPtr> ThumbnailFocused;
|
||||
|
||||
public event Action<IntPtr> ThumbnailLostFocus;
|
||||
|
||||
public event Action<IntPtr> ThumbnailActivated;
|
||||
|
||||
public new void Show()
|
||||
{
|
||||
base.Show();
|
||||
|
||||
if (this.IsOverlayEnabled)
|
||||
{
|
||||
this._overlay.Show();
|
||||
this._overlay.TopMost = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._overlay.Hide();
|
||||
}
|
||||
|
||||
this.Refresh();
|
||||
|
||||
this.IsActive = true;
|
||||
}
|
||||
|
||||
public new void Hide()
|
||||
{
|
||||
this.IsActive = false;
|
||||
|
||||
this._overlay.Hide();
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
this.IsActive = false;
|
||||
|
||||
this._overlay.Close();
|
||||
base.Close();
|
||||
}
|
||||
|
||||
// This method is used to determine if the provided Handle is related to client or its thumbnail
|
||||
public bool IsKnownHandle(IntPtr handle)
|
||||
{
|
||||
return (this.Id == handle) || (this.Handle == handle) || (this._overlay.Handle == handle);
|
||||
}
|
||||
|
||||
public void SetOpacity(double opacity)
|
||||
{
|
||||
this.Opacity = opacity;
|
||||
}
|
||||
|
||||
public void SetWindowFrames(bool enable)
|
||||
{
|
||||
this.FormBorderStyle = enable ? FormBorderStyle.SizableToolWindow : FormBorderStyle.None;
|
||||
}
|
||||
|
||||
public void SetTopMost(bool enableTopmost)
|
||||
{
|
||||
this.TopMost = enableTopmost;
|
||||
this._overlay.TopMost = true;
|
||||
}
|
||||
|
||||
public new void Refresh()
|
||||
{
|
||||
if (this._isThumbnailSetUp == false)
|
||||
{
|
||||
this.InitializeThumbnail();
|
||||
}
|
||||
|
||||
bool sizeChanged = (this._currentWidth != this.ClientRectangle.Right) || (this._currentHeight != this.ClientRectangle.Bottom);
|
||||
bool locationChanged = (this._currentLeft != this.Location.X) || (this._currentTop != this.Location.Y);
|
||||
|
||||
if (sizeChanged)
|
||||
{
|
||||
this._currentWidth = this.ClientRectangle.Right;
|
||||
this._currentHeight = this.ClientRectangle.Bottom;
|
||||
|
||||
this._Thumbnail.rcDestination = new RECT(0, 0, this._currentWidth, this._currentHeight);
|
||||
DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._ThumbnailHandle, this._Thumbnail);
|
||||
}
|
||||
|
||||
if (!(this.IsOverlayEnabled && (sizeChanged || locationChanged)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Size overlaySize = this.RenderAreaPictureBox.Size;
|
||||
overlaySize.Width -= 2 * 5;
|
||||
overlaySize.Height -= 2 * 5;
|
||||
|
||||
Point overlayLocation = this.Location;
|
||||
|
||||
this._currentLeft = overlayLocation.X;
|
||||
this._currentTop = overlayLocation.Y;
|
||||
|
||||
overlayLocation.X += 5 + (this.Size.Width - this.RenderAreaPictureBox.Size.Width) / 2;
|
||||
overlayLocation.Y += 5 + (this.Size.Height - this.RenderAreaPictureBox.Size.Height) - (this.Size.Width - this.RenderAreaPictureBox.Size.Width) / 2;
|
||||
|
||||
this._overlay.Size = overlaySize;
|
||||
this._overlay.Location = overlayLocation;
|
||||
}
|
||||
|
||||
#region GUI events
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var Params = base.CreateParams;
|
||||
Params.ExStyle |= (int)DwmApiNativeMethods.WS_EX_TOOLWINDOW;
|
||||
return Params;
|
||||
}
|
||||
}
|
||||
|
||||
private void Move_Handler(object sender, EventArgs e)
|
||||
{
|
||||
this.ThumbnailMoved?.Invoke(this.Id);
|
||||
}
|
||||
|
||||
private void Resize_Handler(object sender, EventArgs e)
|
||||
{
|
||||
this.ThumbnailResized?.Invoke(this.Id);
|
||||
}
|
||||
|
||||
private void Focused_Handler(object sender, EventArgs e)
|
||||
{
|
||||
this.ThumbnailFocused?.Invoke(this.Id);
|
||||
}
|
||||
|
||||
private void LostFocus_Handler(object sender, EventArgs e)
|
||||
{
|
||||
this.ThumbnailLostFocus?.Invoke(this.Id);
|
||||
}
|
||||
|
||||
private void ThumbnailActivated_Handler(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
this.ThumbnailActivated?.Invoke(this.Id);
|
||||
}
|
||||
|
||||
//if (e.Button == MouseButtons.Right)
|
||||
//{
|
||||
// // do smth cool?
|
||||
//}
|
||||
|
||||
//if (e.Button == MouseButtons.Middle)
|
||||
//{
|
||||
// // do smth cool?
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void InitializeThumbnail()
|
||||
{
|
||||
this._ThumbnailHandle = DwmApiNativeMethods.DwmRegisterThumbnail(this.Handle, this.Id);
|
||||
|
||||
this._Thumbnail = new DWM_THUMBNAIL_PROPERTIES();
|
||||
this._Thumbnail.dwFlags = DWM_TNP_CONSTANTS.DWM_TNP_VISIBLE
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_OPACITY
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_RECTDESTINATION
|
||||
+ DWM_TNP_CONSTANTS.DWM_TNP_SOURCECLIENTAREAONLY;
|
||||
this._Thumbnail.opacity = 255;
|
||||
this._Thumbnail.fVisible = true;
|
||||
this._Thumbnail.fSourceClientAreaOnly = true;
|
||||
|
||||
this._isThumbnailSetUp = true;
|
||||
}
|
||||
|
||||
//private Hotkey _hotkey; // This field stores the hotkey reference
|
||||
//public void RegisterShortcut(string shortcut)
|
||||
//{
|
||||
//if (String.IsNullOrEmpty(shortcut))
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
//KeysConverter converter = new KeysConverter();
|
||||
//object keysObject = converter.ConvertFrom(shortcut);
|
||||
//if (keysObject == null)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
//Keys key = (Keys)keysObject;
|
||||
|
||||
//Hotkey hotkey = new Hotkey();
|
||||
|
||||
//if ((key & Keys.Shift) == Keys.Shift)
|
||||
//{
|
||||
// hotkey.Shift = true;
|
||||
//}
|
||||
|
||||
//if ((key & Keys.Alt) == Keys.Alt)
|
||||
//{
|
||||
// hotkey.Alt = true;
|
||||
//}
|
||||
|
||||
//if ((key & Keys.Control) == Keys.Control)
|
||||
//{
|
||||
// hotkey.Control = true;
|
||||
//}
|
||||
|
||||
//key = key & ~Keys.Shift & ~Keys.Alt & ~Keys.Control;
|
||||
//hotkey.KeyCode = key;
|
||||
//hotkey.Pressed += Hotkey_Pressed;
|
||||
//hotkey.Register(this);
|
||||
|
||||
//this._hotkey = hotkey;
|
||||
//}
|
||||
}
|
||||
}
|
52
Eve-O-Preview/UI/Interface/IMainView.cs
Normal file
52
Eve-O-Preview/UI/Interface/IMainView.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Main view interface
|
||||
/// Presenter uses it to access GUI properties
|
||||
/// </summary>
|
||||
public interface IMainView : IView
|
||||
{
|
||||
bool MinimizeToTray { get; set; }
|
||||
|
||||
double ThumbnailsOpacity { get; set; }
|
||||
bool TrackClientLocations { get; set; }
|
||||
bool HideActiveClientThumbnail { get; set; }
|
||||
bool ShowThumbnailsAlwaysOnTop { get; set; }
|
||||
bool HideAllThumbnailsIfClientIsNotActive { get; set; }
|
||||
bool EnableUniqueThumbnailsLayouts { get; set; }
|
||||
|
||||
bool SyncThumbnailsSize { get; set; }
|
||||
int ThumbnailsWidth { get; set; }
|
||||
int ThumbnailsHeight { get; set; }
|
||||
|
||||
bool EnableZoomOnHover { get; set; }
|
||||
int ZoomFactor { get; set; }
|
||||
ZoomAnchor ZoomAnchor { get; set; }
|
||||
|
||||
bool ShowThumbnailOverlays { get; set; }
|
||||
bool ShowThumbnailFrames { get; set; }
|
||||
|
||||
void SetForumUrl(string url);
|
||||
|
||||
void Minimize();
|
||||
|
||||
void AddThumbnails(IList<IThumbnailDescriptionView> thumbnails);
|
||||
void UpdateThumbnails(IList<IThumbnailDescriptionView> thumbnails);
|
||||
void RemoveThumbnails(IList<IThumbnailDescriptionView> thumbnails);
|
||||
void UpdateThumbnailsSizeView(Size size);
|
||||
void UpdateZoomSettingsView();
|
||||
|
||||
event Action ApplicationExitRequested;
|
||||
event Action FormActivated;
|
||||
event Action FormMinimized;
|
||||
event Action<ViewCloseRequest> FormCloseRequested;
|
||||
event Action ApplicationSettingsChanged;
|
||||
event Action ThumbnailsSizeChanged;
|
||||
event Action<IntPtr> ThumbnailStateChanged;
|
||||
event Action ForumUrlLinkActivated;
|
||||
}
|
||||
}
|
11
Eve-O-Preview/UI/Interface/IThumbnailDescriptionView.cs
Normal file
11
Eve-O-Preview/UI/Interface/IThumbnailDescriptionView.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public interface IThumbnailDescriptionView : IView
|
||||
{
|
||||
IntPtr Id { get; set; }
|
||||
string Title { get; set; }
|
||||
bool IsDisabled { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public interface IThumbnailDescriptionViewFactory
|
||||
{
|
||||
IThumbnailDescriptionView Create(IntPtr id, string title, bool isDisabled);
|
||||
}
|
||||
}
|
31
Eve-O-Preview/UI/Interface/IThumbnailView.cs
Normal file
31
Eve-O-Preview/UI/Interface/IThumbnailView.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public interface IThumbnailView : IView
|
||||
{
|
||||
IntPtr Id { get; set; }
|
||||
string Title { get; set; }
|
||||
|
||||
bool IsEnabled { get; set; }
|
||||
bool IsActive { get; set; }
|
||||
Point Location { get; set; }
|
||||
Size Size { get; set; }
|
||||
bool IsOverlayEnabled { get; set; }
|
||||
|
||||
bool IsKnownHandle(IntPtr handle);
|
||||
|
||||
void SetOpacity(double opacity);
|
||||
void SetWindowFrames(bool enable);
|
||||
void SetTopMost(bool enableTopmost);
|
||||
|
||||
void Refresh();
|
||||
|
||||
event Action<IntPtr> ThumbnailResized;
|
||||
event Action<IntPtr> ThumbnailMoved;
|
||||
event Action<IntPtr> ThumbnailFocused;
|
||||
event Action<IntPtr> ThumbnailLostFocus;
|
||||
event Action<IntPtr> ThumbnailActivated;
|
||||
}
|
||||
}
|
10
Eve-O-Preview/UI/Interface/IThumbnailViewFactory.cs
Normal file
10
Eve-O-Preview/UI/Interface/IThumbnailViewFactory.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public interface IThumbnailViewFactory
|
||||
{
|
||||
IThumbnailView Create(IntPtr id, string title, Size size);
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
namespace EveOPreview
|
||||
namespace EveOPreview.UI
|
||||
{
|
||||
public enum ZoomAnchor
|
||||
{
|
4
Eve-O-Preview/packages.config
Normal file
4
Eve-O-Preview/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LightInject" version="4.0.9" targetFramework="net45" />
|
||||
</packages>
|
Reference in New Issue
Block a user