fixed #98: Added drag & drop box

This commit is contained in:
Jaex 2014-04-06 05:10:34 +03:00
parent de80bb9f92
commit 3379cd133b
11 changed files with 427 additions and 74 deletions

View file

@ -88,6 +88,9 @@
<Compile Include="ConvolutionMatrix.cs" />
<Compile Include="ConvolutionMatrixManager.cs" />
<Compile Include="FontSafe.cs" />
<Compile Include="Native\LayeredForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\MonitorTestForm.cs">
<SubType>Form</SubType>
</Compile>
@ -95,6 +98,7 @@
<DependentUpon>MonitorTestForm.cs</DependentUpon>
</Compile>
<Compile Include="Helpers\SSLBypassHelper.cs" />
<Compile Include="Native\NativeConstants.cs" />
<Compile Include="PingHelper.cs" />
<Compile Include="PingResult.cs" />
<Compile Include="UITypeEditors\EnumDescriptionConverter.cs" />

View file

@ -0,0 +1,140 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (C) 2008-2014 ShareX Developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace HelpersLib
{
public partial class LayeredForm : Form
{
public LayeredForm()
{
InitializeComponent();
}
#region Windows Form Designer generated code
/// <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>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "LayeredForm";
this.ShowInTaskbar = false;
this.Text = "LayeredForm";
this.TopMost = true;
this.ResumeLayout(false);
}
#endregion Windows Form Designer generated code
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle |= (int)WindowStyles.WS_EX_LAYERED;
return createParams;
}
}
public void SelectBitmap(Bitmap bitmap)
{
SelectBitmap(bitmap, 255);
}
public void SelectBitmap(Bitmap bitmap, int opacity)
{
if (bitmap.PixelFormat != PixelFormat.Format32bppArgb)
{
throw new ApplicationException("The bitmap must be 32bpp with alpha-channel.");
}
IntPtr screenDc = NativeMethods.GetDC(IntPtr.Zero);
IntPtr memDc = NativeMethods.CreateCompatibleDC(screenDc);
IntPtr hBitmap = IntPtr.Zero;
IntPtr hOldBitmap = IntPtr.Zero;
try
{
hBitmap = bitmap.GetHbitmap(Color.FromArgb(0));
hOldBitmap = NativeMethods.SelectObject(memDc, hBitmap);
SIZE newSize = new SIZE(bitmap.Width, bitmap.Height);
POINT sourceLocation = new POINT(0, 0);
POINT newLocation = new POINT(this.Left, this.Top);
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.BlendOp = NativeMethods.AC_SRC_OVER;
blend.BlendFlags = 0;
blend.SourceConstantAlpha = (byte)opacity;
blend.AlphaFormat = NativeMethods.AC_SRC_ALPHA;
NativeMethods.UpdateLayeredWindow(this.Handle, screenDc, ref newLocation, ref newSize, memDc, ref sourceLocation, 0, ref blend, NativeMethods.ULW_ALPHA);
}
finally
{
NativeMethods.ReleaseDC(IntPtr.Zero, screenDc);
if (hBitmap != IntPtr.Zero)
{
NativeMethods.SelectObject(memDc, hOldBitmap);
NativeMethods.DeleteObject(hBitmap);
}
NativeMethods.DeleteDC(memDc);
}
}
}
}

View file

@ -0,0 +1,50 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (C) 2008-2014 ShareX Developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
namespace HelpersLib
{
public static partial class NativeMethods
{
public const int GCL_HICONSM = -34;
public const int GCL_HICON = -14;
public const int ICON_SMALL = 0;
public const int ICON_BIG = 1;
public const int ICON_SMALL2 = 2;
public const int SC_MINIMIZE = 0xF020;
public const int HT_CAPTION = 2;
public const int CURSOR_SHOWING = 1;
public const int GWL_STYLE = -16;
public const int DWM_TNP_RECTDESTINATION = 0x1;
public const int DWM_TNP_RECTSOURCE = 0x2;
public const int DWM_TNP_OPACITY = 0x4;
public const int DWM_TNP_VISIBLE = 0x8;
public const int DWM_TNP_SOURCECLIENTAREAONLY = 0x10;
public const int WH_KEYBOARD_LL = 13;
public const int WH_MOUSE_LL = 14;
public const int ULW_ALPHA = 0x02;
public const byte AC_SRC_OVER = 0x00;
public const byte AC_SRC_ALPHA = 0x01;
}
}

View file

@ -32,33 +32,6 @@ namespace HelpersLib
{
public static partial class NativeMethods
{
#region Constants
public const int GCL_HICONSM = -34;
public const int GCL_HICON = -14;
public const int ICON_SMALL = 0;
public const int ICON_BIG = 1;
public const int ICON_SMALL2 = 2;
public const int SC_MINIMIZE = 0xF020;
public const int HT_CAPTION = 2;
public const int CURSOR_SHOWING = 1;
public const int GWL_STYLE = -16;
public const ulong TARGETWINDOW = (uint)WindowStyles.WS_BORDER | (uint)WindowStyles.WS_VISIBLE;
public const int DWM_TNP_RECTDESTINATION = 0x1;
public const int DWM_TNP_RECTSOURCE = 0x2;
public const int DWM_TNP_OPACITY = 0x4;
public const int DWM_TNP_VISIBLE = 0x8;
public const int DWM_TNP_SOURCECLIENTAREAONLY = 0x10;
public const int WH_KEYBOARD_LL = 13;
public const int WH_MOUSE_LL = 14;
#endregion Constants
#region Delegates
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);

142
ShareX/Forms/DropForm.cs Normal file
View file

@ -0,0 +1,142 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (C) 2008-2014 ShareX Developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using HelpersLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX
{
public partial class DropForm : LayeredForm
{
public DropForm()
{
InitializeComponent();
Image logo = null;
try
{
logo = ShareXResources.Logo;
logo = ImageHelpers.ResizeImage(logo, 150, 150);
int windowOffset = 5;
ContentAlignment placement = ContentAlignment.BottomRight;
Point position = Helpers.GetPosition(placement, new Point(windowOffset, windowOffset), Screen.PrimaryScreen.WorkingArea.Size, logo.Size);
Location = position;
SelectBitmap((Bitmap)logo, 150);
}
finally
{
if (logo != null)
{
logo.Dispose();
}
}
}
private void DropForm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
NativeMethods.ReleaseCapture();
NativeMethods.SendMessage(Handle, (uint)WindowsMessages.NCLBUTTONDOWN, (IntPtr)NativeMethods.HT_CAPTION, IntPtr.Zero);
}
}
private void DropForm_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
this.Close();
}
}
private void DropForm_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.All;
}
else
{
e.Effect = DragDropEffects.None;
}
}
private void DropForm_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, true);
UploadManager.UploadFile(files);
}
#region Windows Form Designer generated code
/// <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>
/// 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();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "DropForm";
this.AllowDrop = true;
MouseDown += DropForm_MouseDown;
MouseUp += DropForm_MouseUp;
DragEnter += DropForm_DragEnter;
DragDrop += DropForm_DragDrop;
}
#endregion Windows Form Designer generated code
}
}

View file

@ -58,6 +58,7 @@ private void InitializeComponent()
this.tsMain = new System.Windows.Forms.ToolStrip();
this.tsbClipboardUpload = new System.Windows.Forms.ToolStripButton();
this.tsbFileUpload = new System.Windows.Forms.ToolStripButton();
this.tsbDragDropUpload = new System.Windows.Forms.ToolStripButton();
this.tsddbCapture = new System.Windows.Forms.ToolStripDropDownButton();
this.tsmiFullscreen = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiWindow = new System.Windows.Forms.ToolStripMenuItem();
@ -122,6 +123,7 @@ private void InitializeComponent()
this.chURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.pbPreview = new HelpersLib.MyPictureBox();
this.cmsUploadInfo = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiShowErrors = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiStopUpload = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiOpen = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiOpenURL = new System.Windows.Forms.ToolStripMenuItem();
@ -154,7 +156,6 @@ private void InitializeComponent()
this.tsmiCopyFileNameWithExtension = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiCopyFolder = new System.Windows.Forms.ToolStripMenuItem();
this.tssCopy5 = new System.Windows.Forms.ToolStripSeparator();
this.tsmiShowErrors = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiShowResponse = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiUploadSelectedFile = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiClearList = new System.Windows.Forms.ToolStripMenuItem();
@ -213,6 +214,7 @@ private void InitializeComponent()
this.tsmiTrayShow = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayExit = new System.Windows.Forms.ToolStripMenuItem();
this.ssToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayDragDropUpload = new System.Windows.Forms.ToolStripMenuItem();
this.tsMain.SuspendLayout();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
@ -230,6 +232,7 @@ private void InitializeComponent()
this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbClipboardUpload,
this.tsbFileUpload,
this.tsbDragDropUpload,
this.tsddbCapture,
this.tsddbAfterCaptureTasks,
this.tsddbAfterUploadTasks,
@ -254,7 +257,6 @@ private void InitializeComponent()
this.tsMain.ShowItemToolTips = false;
this.tsMain.Size = new System.Drawing.Size(160, 430);
this.tsMain.TabIndex = 0;
this.tsMain.Text = "toolStrip1";
//
// tsbClipboardUpload
//
@ -276,6 +278,16 @@ private void InitializeComponent()
this.tsbFileUpload.Text = "File upload...";
this.tsbFileUpload.Click += new System.EventHandler(this.tsbFileUpload_Click);
//
// tsbDragDropUpload
//
this.tsbDragDropUpload.Image = global::ShareX.Properties.Resources.inbox_plus;
this.tsbDragDropUpload.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.tsbDragDropUpload.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDragDropUpload.Name = "tsbDragDropUpload";
this.tsbDragDropUpload.Size = new System.Drawing.Size(147, 20);
this.tsbDragDropUpload.Text = "Drag && drop upload...";
this.tsbDragDropUpload.Click += new System.EventHandler(this.tsbDragDropUpload_Click);
//
// tsddbCapture
//
this.tsddbCapture.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -872,7 +884,14 @@ private void InitializeComponent()
this.tsmiHidePreview});
this.cmsUploadInfo.Name = "cmsHistory";
this.cmsUploadInfo.ShowImageMargin = false;
this.cmsUploadInfo.Size = new System.Drawing.Size(155, 280);
this.cmsUploadInfo.Size = new System.Drawing.Size(155, 258);
//
// tsmiShowErrors
//
this.tsmiShowErrors.Name = "tsmiShowErrors";
this.tsmiShowErrors.Size = new System.Drawing.Size(154, 22);
this.tsmiShowErrors.Text = "Show errors";
this.tsmiShowErrors.Click += new System.EventHandler(this.tsmiShowErrors_Click);
//
// tsmiStopUpload
//
@ -1116,13 +1135,6 @@ private void InitializeComponent()
this.tssCopy5.Size = new System.Drawing.Size(230, 6);
this.tssCopy5.Visible = false;
//
// tsmiShowErrors
//
this.tsmiShowErrors.Name = "tsmiShowErrors";
this.tsmiShowErrors.Size = new System.Drawing.Size(154, 22);
this.tsmiShowErrors.Text = "Show errors";
this.tsmiShowErrors.Click += new System.EventHandler(this.tsmiShowErrors_Click);
//
// tsmiShowResponse
//
this.tsmiShowResponse.Name = "tsmiShowResponse";
@ -1195,6 +1207,7 @@ private void InitializeComponent()
this.cmsTray.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiTrayClipboardUpload,
this.tsmiTrayFileUpload,
this.tsmiTrayDragDropUpload,
this.tsmiTrayCapture,
this.tsmiTrayAfterCaptureTasks,
this.tsmiTrayAfterUploadTasks,
@ -1215,13 +1228,13 @@ private void InitializeComponent()
this.tsmiTrayShow,
this.tsmiTrayExit});
this.cmsTray.Name = "cmsTray";
this.cmsTray.Size = new System.Drawing.Size(189, 418);
this.cmsTray.Size = new System.Drawing.Size(190, 440);
//
// tsmiTrayClipboardUpload
//
this.tsmiTrayClipboardUpload.Image = global::ShareX.Properties.Resources.clipboard_plus;
this.tsmiTrayClipboardUpload.Name = "tsmiTrayClipboardUpload";
this.tsmiTrayClipboardUpload.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayClipboardUpload.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayClipboardUpload.Text = "Clipboard upload...";
this.tsmiTrayClipboardUpload.Click += new System.EventHandler(this.tsbClipboardUpload_Click);
//
@ -1229,7 +1242,7 @@ private void InitializeComponent()
//
this.tsmiTrayFileUpload.Image = global::ShareX.Properties.Resources.folder_plus;
this.tsmiTrayFileUpload.Name = "tsmiTrayFileUpload";
this.tsmiTrayFileUpload.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayFileUpload.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayFileUpload.Text = "File upload...";
this.tsmiTrayFileUpload.Click += new System.EventHandler(this.tsbFileUpload_Click);
//
@ -1252,7 +1265,7 @@ private void InitializeComponent()
this.tsmiTrayAutoCapture});
this.tsmiTrayCapture.Image = global::ShareX.Properties.Resources.camera;
this.tsmiTrayCapture.Name = "tsmiTrayCapture";
this.tsmiTrayCapture.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayCapture.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayCapture.Text = "Capture";
this.tsmiTrayCapture.DropDownOpening += new System.EventHandler(this.tsmiCapture_DropDownOpening);
//
@ -1370,14 +1383,14 @@ private void InitializeComponent()
//
this.tsmiTrayAfterCaptureTasks.Image = global::ShareX.Properties.Resources.image_export;
this.tsmiTrayAfterCaptureTasks.Name = "tsmiTrayAfterCaptureTasks";
this.tsmiTrayAfterCaptureTasks.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayAfterCaptureTasks.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayAfterCaptureTasks.Text = "After capture";
//
// tsmiTrayAfterUploadTasks
//
this.tsmiTrayAfterUploadTasks.Image = global::ShareX.Properties.Resources.upload_cloud;
this.tsmiTrayAfterUploadTasks.Name = "tsmiTrayAfterUploadTasks";
this.tsmiTrayAfterUploadTasks.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayAfterUploadTasks.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayAfterUploadTasks.Text = "After upload";
//
// tsmiTrayDestinations
@ -1390,7 +1403,7 @@ private void InitializeComponent()
this.tsmiTraySocialServices});
this.tsmiTrayDestinations.Image = global::ShareX.Properties.Resources.drive_globe;
this.tsmiTrayDestinations.Name = "tsmiTrayDestinations";
this.tsmiTrayDestinations.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayDestinations.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayDestinations.Text = "Destinations";
this.tsmiTrayDestinations.DropDownOpened += new System.EventHandler(this.tsddbDestinations_DropDownOpened);
//
@ -1432,13 +1445,13 @@ private void InitializeComponent()
// tssTray1
//
this.tssTray1.Name = "tssTray1";
this.tssTray1.Size = new System.Drawing.Size(185, 6);
this.tssTray1.Size = new System.Drawing.Size(186, 6);
//
// tsmiTrayApplicationSettings
//
this.tsmiTrayApplicationSettings.Image = global::ShareX.Properties.Resources.application_pencil;
this.tsmiTrayApplicationSettings.Name = "tsmiTrayApplicationSettings";
this.tsmiTrayApplicationSettings.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayApplicationSettings.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayApplicationSettings.Text = "Application settings...";
this.tsmiTrayApplicationSettings.Click += new System.EventHandler(this.tsbApplicationSettings_Click);
//
@ -1446,7 +1459,7 @@ private void InitializeComponent()
//
this.tsmiTrayTaskSettings.Image = global::ShareX.Properties.Resources.hammer_pencil;
this.tsmiTrayTaskSettings.Name = "tsmiTrayTaskSettings";
this.tsmiTrayTaskSettings.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayTaskSettings.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayTaskSettings.Text = "Task settings...";
this.tsmiTrayTaskSettings.Click += new System.EventHandler(this.tsbTaskSettings_Click);
//
@ -1454,7 +1467,7 @@ private void InitializeComponent()
//
this.tsmiTrayHotkeySettings.Image = global::ShareX.Properties.Resources.keyboard_pencil;
this.tsmiTrayHotkeySettings.Name = "tsmiTrayHotkeySettings";
this.tsmiTrayHotkeySettings.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayHotkeySettings.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayHotkeySettings.Text = "Hotkey settings...";
this.tsmiTrayHotkeySettings.Click += new System.EventHandler(this.tsbHotkeySettings_Click);
//
@ -1462,14 +1475,14 @@ private void InitializeComponent()
//
this.tsmiTrayDestinationSettings.Image = global::ShareX.Properties.Resources.globe_pencil;
this.tsmiTrayDestinationSettings.Name = "tsmiTrayDestinationSettings";
this.tsmiTrayDestinationSettings.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayDestinationSettings.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayDestinationSettings.Text = "Destination settings...";
this.tsmiTrayDestinationSettings.Click += new System.EventHandler(this.tsbDestinationSettings_Click);
//
// tssTray2
//
this.tssTray2.Name = "tssTray2";
this.tssTray2.Size = new System.Drawing.Size(185, 6);
this.tssTray2.Size = new System.Drawing.Size(186, 6);
//
// tsmiTrayTools
//
@ -1482,7 +1495,7 @@ private void InitializeComponent()
this.tsmiTrayDNSChanger});
this.tsmiTrayTools.Image = global::ShareX.Properties.Resources.toolbox;
this.tsmiTrayTools.Name = "tsmiTrayTools";
this.tsmiTrayTools.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayTools.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayTools.Text = "Tools";
//
// tsmiTrayScreenColorPicker
@ -1537,7 +1550,7 @@ private void InitializeComponent()
//
this.tsmiScreenshotsFolder.Image = global::ShareX.Properties.Resources.folder_open_image;
this.tsmiScreenshotsFolder.Name = "tsmiScreenshotsFolder";
this.tsmiScreenshotsFolder.Size = new System.Drawing.Size(188, 22);
this.tsmiScreenshotsFolder.Size = new System.Drawing.Size(189, 22);
this.tsmiScreenshotsFolder.Text = "Screenshots folder...";
this.tsmiScreenshotsFolder.Click += new System.EventHandler(this.tsbScreenshotsFolder_Click);
//
@ -1545,7 +1558,7 @@ private void InitializeComponent()
//
this.tsmiTrayHistory.Image = global::ShareX.Properties.Resources.address_book_blue;
this.tsmiTrayHistory.Name = "tsmiTrayHistory";
this.tsmiTrayHistory.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayHistory.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayHistory.Text = "History...";
this.tsmiTrayHistory.Click += new System.EventHandler(this.tsbHistory_Click);
//
@ -1553,7 +1566,7 @@ private void InitializeComponent()
//
this.tsmiTrayImageHistory.Image = global::ShareX.Properties.Resources.application_icon_large;
this.tsmiTrayImageHistory.Name = "tsmiTrayImageHistory";
this.tsmiTrayImageHistory.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayImageHistory.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayImageHistory.Text = "Image history...";
this.tsmiTrayImageHistory.Click += new System.EventHandler(this.tsbImageHistory_Click);
//
@ -1561,7 +1574,7 @@ private void InitializeComponent()
//
this.tsmiTrayDonate.Image = global::ShareX.Properties.Resources.present;
this.tsmiTrayDonate.Name = "tsmiTrayDonate";
this.tsmiTrayDonate.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayDonate.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayDonate.Text = "Donate...";
this.tsmiTrayDonate.Click += new System.EventHandler(this.tsbDonate_Click);
//
@ -1569,20 +1582,20 @@ private void InitializeComponent()
//
this.tsmiTrayAbout.Image = global::ShareX.Properties.Resources.application_browser;
this.tsmiTrayAbout.Name = "tsmiTrayAbout";
this.tsmiTrayAbout.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayAbout.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayAbout.Text = "About...";
this.tsmiTrayAbout.Click += new System.EventHandler(this.tsbAbout_Click);
//
// tssTray3
//
this.tssTray3.Name = "tssTray3";
this.tssTray3.Size = new System.Drawing.Size(185, 6);
this.tssTray3.Size = new System.Drawing.Size(186, 6);
//
// tsmiTrayShow
//
this.tsmiTrayShow.Image = global::ShareX.Properties.Resources.tick_button;
this.tsmiTrayShow.Name = "tsmiTrayShow";
this.tsmiTrayShow.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayShow.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayShow.Text = "Show ShareX window";
this.tsmiTrayShow.Click += new System.EventHandler(this.tsmiTrayShow_Click);
//
@ -1590,7 +1603,7 @@ private void InitializeComponent()
//
this.tsmiTrayExit.Image = global::ShareX.Properties.Resources.cross_button;
this.tsmiTrayExit.Name = "tsmiTrayExit";
this.tsmiTrayExit.Size = new System.Drawing.Size(188, 22);
this.tsmiTrayExit.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayExit.Text = "Exit";
this.tsmiTrayExit.Click += new System.EventHandler(this.tsmiTrayExit_Click);
//
@ -1600,6 +1613,14 @@ private void InitializeComponent()
this.ssToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.ssToolStripMenuItem.Text = "ss";
//
// tsmiTrayDragDropUpload
//
this.tsmiTrayDragDropUpload.Image = global::ShareX.Properties.Resources.inbox_plus;
this.tsmiTrayDragDropUpload.Name = "tsmiTrayDragDropUpload";
this.tsmiTrayDragDropUpload.Size = new System.Drawing.Size(189, 22);
this.tsmiTrayDragDropUpload.Text = "Drag && drop upload...";
this.tsmiTrayDragDropUpload.Click += new System.EventHandler(this.tsbDragDropUpload_Click);
//
// MainForm
//
this.AllowDrop = true;
@ -1790,5 +1811,7 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmiTrayShow;
private System.Windows.Forms.ToolStripMenuItem tsmiDNSChanger;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayDNSChanger;
private System.Windows.Forms.ToolStripButton tsbDragDropUpload;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayDragDropUpload;
}
}

View file

@ -685,6 +685,11 @@ private void tsbFileUpload_Click(object sender, EventArgs e)
UploadManager.UploadFile();
}
private void tsbDragDropUpload_Click(object sender, EventArgs e)
{
new DropForm().Show();
}
private void tsddbDestinations_DropDownOpened(object sender, EventArgs e)
{
UpdateDestinationStates();

View file

@ -519,6 +519,16 @@ public static System.Drawing.Bitmap image_saturation {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap inbox_plus {
get {
object obj = ResourceManager.GetObject("inbox_plus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -644,7 +654,7 @@ public static System.Drawing.Bitmap navigation_090_button {
/// </summary>
public static System.Drawing.Bitmap network_ip {
get {
object obj = ResourceManager.GetObject("network-ip", resourceCulture);
object obj = ResourceManager.GetObject("network_ip", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

View file

@ -117,7 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="layer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -169,6 +169,9 @@
<data name="folder_open_image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\folder-open-image.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="navigation_090_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\navigation-090-button.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layers_ungroup" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layers-ungroup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -193,9 +196,6 @@
<data name="image_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image-export.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="au" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\au.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="keyboard_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\keyboard--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -205,6 +205,9 @@
<data name="hammer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\hammer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Window" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Window.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Polygon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -235,9 +238,6 @@
<data name="address_book_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\address-book-blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="block" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\block.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -313,14 +313,17 @@
<data name="application_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="network_ip" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\network-ip.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pipette" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pipette.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Window" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Window.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="navigation_090_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\navigation-090-button.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="au" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\au.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="checkbox_uncheck" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\checkbox_uncheck.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -340,8 +343,7 @@
<data name="application_task" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application-task.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="network-ip" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\network-ip.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="inbox_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\inbox--plus.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

View file

@ -106,6 +106,9 @@
<Compile Include="Forms\AutoCaptureForm.Designer.cs">
<DependentUpon>AutoCaptureForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\DropForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ExternalProgramForm.cs">
<SubType>Form</SubType>
</Compile>
@ -444,6 +447,7 @@
<None Include="Resources\checkbox_uncheck.png" />
<None Include="Resources\checkbox_check.png" />
<None Include="Resources\network-ip.png" />
<None Include="Resources\inbox--plus.png" />
<Content Include="ShareX_Icon.ico" />
<None Include="Resources\ru.png" />
<None Include="Resources\keyboard--pencil.png" />