fixed #1388: Added ForceActivate to AfterCapture and BeforeUpload forms shown event

This commit is contained in:
Jaex 2016-03-09 18:37:54 +02:00
parent 4066ae61d3
commit 3455590ea5
31 changed files with 48 additions and 36 deletions

View file

@ -230,7 +230,7 @@ private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
if (!closing)
{
btnRun.Text = Resources.Start;
this.ShowActivate();
this.ForceActivate();
}
}

View file

@ -307,7 +307,7 @@ public static void InvokeSafe(this Control control, Action action)
}
}
public static void ShowActivate(this Form form)
public static void ForceActivate(this Form form)
{
if (!form.Visible)
{

View file

@ -97,7 +97,7 @@ private bool CheckClipboardContents()
private void ClipboardContentViewer_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void cbDontShowThisWindow_CheckedChanged(object sender, EventArgs e)

View file

@ -67,7 +67,7 @@ public ErrorForm(string errorTitle, string errorMessage, string logPath, string
private void ErrorForm_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void btnSendBugReport_Click(object sender, EventArgs e)

View file

@ -67,7 +67,7 @@ public static void ShowImage(string filepath)
private void ShowScreenshot_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void ShowScreenshot_Deactivate(object sender, EventArgs e)

View file

@ -47,7 +47,7 @@ public InputBox(string title = null, string inputText = null)
private void InputBox_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
txtInputText.SelectionLength = txtInputText.Text.Length;
}

View file

@ -154,7 +154,7 @@ public MyMessageBox(string text, string caption, MessageBoxButtons buttons = Mes
private void MyMessageBox_Shown(object sender, System.EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons = MessageBoxButtons.OK)

View file

@ -93,7 +93,7 @@ private void UpdateMessageBox_Shown(object sender, System.EventArgs e)
{
if (ActivateWindow)
{
this.ShowActivate();
this.ForceActivate();
}
}

View file

@ -317,7 +317,7 @@ private void HistoryForm_Shown(object sender, EventArgs e)
cbHostFilterSelection.Items.AddRange(allHistoryItems.Select(x => x.Host).Distinct().Where(x => !string.IsNullOrEmpty(x)).ToArray());
}
this.ShowActivate();
this.ForceActivate();
}
private void HistoryForm_Resize(object sender, EventArgs e)

View file

@ -152,7 +152,7 @@ private HistoryItem[] him_GetHistoryItems()
private void ImageHistoryForm_Shown(object sender, EventArgs e)
{
Application.DoEvents();
this.ShowActivate();
this.ForceActivate();
RefreshHistoryItems();
}

View file

@ -169,7 +169,7 @@ protected override void Dispose(bool disposing)
private void RectangleAnnotate_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void RectangleAnnotate_KeyDown(object sender, KeyEventArgs e)

View file

@ -124,7 +124,7 @@ private void InitializeComponent()
private void RectangleLight_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void RectangleLight_KeyUp(object sender, KeyEventArgs e)

View file

@ -127,7 +127,7 @@ protected override void Dispose(bool disposing)
private void RectangleLight_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void RectangleLight_KeyUp(object sender, KeyEventArgs e)

View file

@ -147,7 +147,7 @@ private void SelectHandle()
}
finally
{
if (!capturing) this.ShowActivate();
if (!capturing) this.ForceActivate();
}
}
@ -168,7 +168,7 @@ private void SelectRectangle()
}
finally
{
this.ShowActivate();
this.ForceActivate();
}
}
@ -234,7 +234,7 @@ private void StopCapture()
{
captureTimer.Stop();
btnCapture.Text = Resources.ScrollingCaptureForm_StopCapture_Start_capture;
if (!Options.AutoUpload) this.ShowActivate();
if (!Options.AutoUpload) this.ForceActivate();
tcScrollingCapture.SelectedTab = tpOutput;
StartingProcess();
if (Options.RemoveDuplicates) RemoveDuplicates();

View file

@ -150,7 +150,7 @@ public virtual void Prepare()
private void Surface_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void Surface_KeyUp(object sender, KeyEventArgs e)

View file

@ -295,7 +295,7 @@ private void FTPCreateDirectory()
using (InputBox ib = new InputBox(Resources.FTPClientForm_FTPCreateDirectory_Directory_name_to_create))
{
ib.ShowDialog();
this.ShowActivate();
this.ForceActivate();
if (ib.DialogResult == DialogResult.OK)
{
Client.CreateDirectory(URLHelpers.CombineURL(currentDirectory, ib.InputText));

View file

@ -153,7 +153,7 @@ private void SendTweet()
private void TwitterMsg_Shown(object sender, EventArgs e)
{
txtTweet.Select(txtTweet.TextLength, 0);
this.ShowActivate();
this.ForceActivate();
}
private void txtTweet_TextChanged(object sender, EventArgs e)

View file

@ -129,7 +129,7 @@ public AboutForm()
private void AboutForm_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void pbLogo_MouseDown(object sender, MouseEventArgs e)

View file

@ -188,6 +188,7 @@ private void InitializeComponent()
this.Name = "AfterCaptureForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.TopMost = true;
this.Shown += new System.EventHandler(this.AfterCaptureForm_Shown);
this.tcTasks.ResumeLayout(false);
this.tpAfterCapture.ResumeLayout(false);
this.tpBeforeUpload.ResumeLayout(false);

View file

@ -67,6 +67,11 @@ public AfterCaptureForm(Image img, TaskSettings taskSettings)
txtFileName.Text = FileName;
}
private void AfterCaptureForm_Shown(object sender, EventArgs e)
{
this.ForceActivate();
}
private void CheckItem(ListViewItem lvi, bool check)
{
lvi.ImageIndex = check ? 1 : 0;

View file

@ -48,7 +48,7 @@ public ApplicationSettingsForm()
private void SettingsForm_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void SettingsForm_Resize(object sender, EventArgs e)

View file

@ -250,7 +250,7 @@ private void AutoCapture_Resize(object sender, EventArgs e)
private void niTray_MouseClick(object sender, MouseEventArgs e)
{
niTray.Visible = false;
this.ShowActivate();
this.ForceActivate();
}
}
}

View file

@ -87,6 +87,7 @@ private void InitializeComponent()
this.Name = "BeforeUploadForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.TopMost = true;
this.Shown += new System.EventHandler(this.BeforeUploadForm_Shown);
this.ResumeLayout(false);
}

View file

@ -49,6 +49,11 @@ public BeforeUploadForm(TaskInfo info)
ucBeforeUpload.Init(info);
}
private void BeforeUploadForm_Shown(object sender, EventArgs e)
{
this.ForceActivate();
}
private void btnOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;

View file

@ -256,7 +256,7 @@
<value>ucBeforeUpload</value>
</data>
<data name="&gt;&gt;ucBeforeUpload.Type" xml:space="preserve">
<value>ShareX.BeforeUploadControl, ShareX, Version=10.4.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.BeforeUploadControl, ShareX, Version=10.7.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;ucBeforeUpload.Parent" xml:space="preserve">
<value>$this</value>

View file

@ -53,7 +53,7 @@ public FileExistForm(string filepath)
private void FileExistForm_Shown(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private string GetNewFilename()

View file

@ -258,7 +258,7 @@ private void AfterShownJobs()
}
else
{
this.ShowActivate();
this.ForceActivate();
}
if (Program.Settings != null && Program.Settings.ShowTrayLeftClickTip && niTray.Visible && Program.Settings.TrayLeftClickAction == HotkeyType.RectangleRegion)
@ -1301,7 +1301,7 @@ private void niTray_MouseDoubleClick(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Left)
{
timerTraySingleClick.Stop();
this.ShowActivate();
this.ForceActivate();
}
}
@ -1317,7 +1317,7 @@ private void niTray_BalloonTipClicked(object sender, EventArgs e)
private void tsmiTrayShow_Click(object sender, EventArgs e)
{
this.ShowActivate();
this.ForceActivate();
}
private void tsmiTrayExit_MouseDown(object sender, MouseEventArgs e)
@ -1860,7 +1860,7 @@ private void DoCaptureWork(ScreenCaptureDelegate capture, CaptureType captureTyp
{
if (autoHideForm)
{
this.ShowActivate();
this.ForceActivate();
}
AfterCapture(img, captureType, taskSettings);

View file

@ -129,7 +129,7 @@ private void btnPipette_Click(object sender, EventArgs e)
}
finally
{
this.ShowActivate();
this.ForceActivate();
}
}

View file

@ -128,7 +128,7 @@ private void ScreenRegionForm_Shown(object sender, EventArgs e)
{
if (activateWindow)
{
this.ShowActivate();
this.ForceActivate();
}
}

View file

@ -343,11 +343,11 @@ private static void SingleInstanceCallback(object sender, InstanceCallbackEventA
MainForm.niTray.Visible = true;
}
MainForm.ShowActivate();
MainForm.ForceActivate();
}
else if (MainForm.Visible)
{
MainForm.ShowActivate();
MainForm.ForceActivate();
}
CLIManager cli = new CLIManager(args.CommandLineArgs);

View file

@ -415,7 +415,7 @@ public static string CheckFilePath(string folder, string filename, TaskSettings
public static void OpenDropWindow(TaskSettings taskSettings = null)
{
DropForm.GetInstance(Program.Settings.DropSize, Program.Settings.DropOffset, Program.Settings.DropAlignment, Program.Settings.DropOpacity,
Program.Settings.DropHoverOpacity, taskSettings).ShowActivate();
Program.Settings.DropHoverOpacity, taskSettings).ForceActivate();
}
public static void StartScreenRecording(ScreenRecordOutput outputType, ScreenRecordStartMethod startMethod, TaskSettings taskSettings = null)
@ -436,7 +436,7 @@ public static void OpenScrollingCapture(TaskSettings taskSettings = null, bool f
public static void OpenAutoCapture()
{
AutoCaptureForm.Instance.ShowActivate();
AutoCaptureForm.Instance.ForceActivate();
}
public static void OpenWebpageCapture(TaskSettings taskSettings = null)
@ -551,7 +551,7 @@ public static void OpenRuler()
public static void OpenAutomate()
{
AutomateForm form = AutomateForm.GetInstance(Program.Settings.AutomateScripts);
form.ShowActivate();
form.ForceActivate();
}
public static void StartAutomate()
@ -571,7 +571,7 @@ public static void StartAutomate()
}
else
{
form.ShowActivate();
form.ForceActivate();
}
}