mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
After capture form check on click
This commit is contained in:
parent
c99e738a4e
commit
dbd3216290
3 changed files with 25 additions and 9 deletions
|
@ -95,8 +95,8 @@ public enum AfterUploadTasks
|
|||
|
||||
public enum AfterCaptureFormResult
|
||||
{
|
||||
Continue,
|
||||
Cancel,
|
||||
Continue,
|
||||
Copy
|
||||
}
|
||||
|
||||
|
|
14
ShareX/Forms/AfterCaptureForm.Designer.cs
generated
14
ShareX/Forms/AfterCaptureForm.Designer.cs
generated
|
@ -38,6 +38,8 @@ private void InitializeComponent()
|
|||
//
|
||||
// lvAfterCaptureTasks
|
||||
//
|
||||
this.lvAfterCaptureTasks.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.lvAfterCaptureTasks.CheckBoxes = true;
|
||||
this.lvAfterCaptureTasks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.chAfterCapture});
|
||||
|
@ -51,14 +53,16 @@ private void InitializeComponent()
|
|||
this.lvAfterCaptureTasks.TabIndex = 0;
|
||||
this.lvAfterCaptureTasks.UseCompatibleStateImageBehavior = false;
|
||||
this.lvAfterCaptureTasks.View = System.Windows.Forms.View.Details;
|
||||
this.lvAfterCaptureTasks.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lvAfterCaptureTasks_MouseDown);
|
||||
//
|
||||
// chAfterCapture
|
||||
//
|
||||
this.chAfterCapture.Text = "Tasks";
|
||||
this.chAfterCapture.Width = 235;
|
||||
this.chAfterCapture.Width = 252;
|
||||
//
|
||||
// btnContinue
|
||||
//
|
||||
this.btnContinue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnContinue.Location = new System.Drawing.Point(8, 272);
|
||||
this.btnContinue.Name = "btnContinue";
|
||||
this.btnContinue.Size = new System.Drawing.Size(80, 24);
|
||||
|
@ -69,6 +73,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnCancel.Location = new System.Drawing.Point(96, 272);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(80, 24);
|
||||
|
@ -90,11 +95,12 @@ private void InitializeComponent()
|
|||
this.pbImage.FullscreenOnClick = true;
|
||||
this.pbImage.Location = new System.Drawing.Point(272, 8);
|
||||
this.pbImage.Name = "pbImage";
|
||||
this.pbImage.Size = new System.Drawing.Size(375, 288);
|
||||
this.pbImage.Size = new System.Drawing.Size(376, 288);
|
||||
this.pbImage.TabIndex = 4;
|
||||
//
|
||||
// btnCopy
|
||||
//
|
||||
this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnCopy.Location = new System.Drawing.Point(184, 272);
|
||||
this.btnCopy.Name = "btnCopy";
|
||||
this.btnCopy.Size = new System.Drawing.Size(80, 24);
|
||||
|
@ -108,13 +114,13 @@ private void InitializeComponent()
|
|||
this.AcceptButton = this.btnContinue;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(656, 306);
|
||||
this.ClientSize = new System.Drawing.Size(656, 304);
|
||||
this.Controls.Add(this.btnCopy);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnContinue);
|
||||
this.Controls.Add(this.lvAfterCaptureTasks);
|
||||
this.Controls.Add(this.pbImage);
|
||||
this.MinimumSize = new System.Drawing.Size(672, 344);
|
||||
this.MinimumSize = new System.Drawing.Size(672, 342);
|
||||
this.Name = "AfterCaptureForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
|
|
|
@ -34,7 +34,6 @@ namespace ShareX
|
|||
public partial class AfterCaptureForm : Form
|
||||
{
|
||||
public AfterCaptureTasks AfterCaptureTasks { get; private set; }
|
||||
public Image Image { get; private set; }
|
||||
public AfterCaptureFormResult Result { get; private set; }
|
||||
|
||||
public AfterCaptureForm(Image img, AfterCaptureTasks afterCaptureTasks)
|
||||
|
@ -43,9 +42,7 @@ public AfterCaptureForm(Image img, AfterCaptureTasks afterCaptureTasks)
|
|||
Icon = ShareXResources.Icon;
|
||||
AfterCaptureTasks = afterCaptureTasks;
|
||||
AddAfterCaptureItems(AfterCaptureTasks);
|
||||
Image = img;
|
||||
pbImage.LoadImage(Image);
|
||||
Result = AfterCaptureFormResult.Cancel;
|
||||
pbImage.LoadImage(img);
|
||||
}
|
||||
|
||||
private void AddAfterCaptureItems(AfterCaptureTasks afterCaptureTasks)
|
||||
|
@ -85,6 +82,19 @@ private void Close(AfterCaptureFormResult result)
|
|||
Close();
|
||||
}
|
||||
|
||||
private void lvAfterCaptureTasks_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
|
||||
{
|
||||
ListViewItem lvi = lvAfterCaptureTasks.GetItemAt(e.X, e.Y);
|
||||
|
||||
if (lvi != null)
|
||||
{
|
||||
lvi.Checked = !lvi.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnContinue_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close(AfterCaptureFormResult.Continue);
|
||||
|
|
Loading…
Reference in a new issue