Skip to content

Commit

Permalink
Skyline: Fixes to make covershots fully automated again and matching …
Browse files Browse the repository at this point in the history
…24.1 tutorials (#3329)

* Skyline: Update covershots to go with 24.1 screenshots
- fixed GetCoverShotPath
- remove, rename, and add StartPage covershot thumbnail images

- ProgressBar painting to ensure consistency where Windows may have animation
- Fixed a HBITMAP leak in CustomTip
- Fixed Ctrl-tab working to switch pages in WizardPages - also turned off TabStop in constructor
- Added IProgressLock to SearchControl to improve its screenshot consistency
- Implemented SearchControl fixes for DdaTutorialTest
- Partially fixed problem with Skyline windows staying active during covershots
- Accumulated other specific fixes like FocusDocument to produce 24.1 covershots
  • Loading branch information
brendanx67 authored Jan 15, 2025
1 parent b8edf2a commit 341bee6
Show file tree
Hide file tree
Showing 170 changed files with 670 additions and 120 deletions.
43 changes: 20 additions & 23 deletions pwiz_tools/Shared/Common/Controls/CustomTextProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

using System.Drawing;
using System.Windows.Forms;
using System;

namespace pwiz.Common.Controls
{
Expand Down Expand Up @@ -60,34 +59,32 @@ protected override void WndProc(ref Message m)
switch (m.Msg)
{
case WM_PAINT:
int m_Percent = Convert.ToInt32((Convert.ToDouble(Value) / Convert.ToDouble(Maximum)) * 100);
dynamic flags = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter |
TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis;

using (Graphics g = Graphics.FromHwnd(Handle))
using (var g = Graphics.FromHwnd(Handle))
{
using (Brush textBrush = new SolidBrush(ForeColor))
{
DrawText(g, new Rectangle(0, 0, Width, Height));
}
break;
}
}

switch (DisplayStyle)
{
case ProgressBarDisplayText.CustomText:
TextRenderer.DrawText(g, CustomText, Font,
new Rectangle(0, 0, Width, Height), Color.Black, flags);
break;
case ProgressBarDisplayText.Percentage:
TextRenderer.DrawText(g, string.Format(@"{0}%", m_Percent), Font,
new Rectangle(0, 0, Width, Height), Color.Black, flags);
break;
}
public void DrawText(Graphics g, Rectangle rectangle)
{
int percent = (int) (Value * 100.0 / Maximum);
dynamic flags = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter |
TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis;

}
}
using var textBrush = new SolidBrush(ForeColor);

switch (DisplayStyle)
{
case ProgressBarDisplayText.CustomText:
TextRenderer.DrawText(g, CustomText, Font, rectangle, Color.Black, flags);
break;
case ProgressBarDisplayText.Percentage:
TextRenderer.DrawText(g, string.Format(@"{0}%", percent), Font,
rectangle, Color.Black, flags);
break;
}

}

}
}
3 changes: 3 additions & 0 deletions pwiz_tools/Shared/CommonUtil/SystemUtil/PInvoke/Gdi32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ public static class Gdi32

[DllImport("gdi32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);

[DllImport("gdi32.dll", SetLastError = true)]
public static extern bool DeleteObject(IntPtr hObject);
}
}
37 changes: 22 additions & 15 deletions pwiz_tools/Skyline/Controls/CustomTip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,29 @@ private void UpdateLayeredWindow(Point point, Size size, byte alpha)
IntPtr ptr1 = User32.GetDC(IntPtr.Zero);
IntPtr ptr2 = Gdi32.CreateCompatibleDC(ptr1);
IntPtr ptr3 = bmp.GetHbitmap(Color.FromArgb(0));
IntPtr ptr4 = Gdi32.SelectObject(ptr2, ptr3);
size1.cx = size.Width;
size1.cy = size.Height;
point1.x = point.X;
point1.y = point.Y;
point2.x = 0;
point2.y = 0;
User32.BLENDFUNCTION blendfunction1 = new User32.BLENDFUNCTION
try
{
BlendOp = 0,
BlendFlags = 0,
SourceConstantAlpha = alpha,
AlphaFormat = 1
};
User32.UpdateLayeredWindow(Handle, ptr1, ref point1, ref size1, ptr2, ref point2, 0, ref blendfunction1, 2);
Gdi32.SelectObject(ptr2, ptr4);
IntPtr ptr4 = Gdi32.SelectObject(ptr2, ptr3);
size1.cx = size.Width;
size1.cy = size.Height;
point1.x = point.X;
point1.y = point.Y;
point2.x = 0;
point2.y = 0;
User32.BLENDFUNCTION blendfunction1 = new User32.BLENDFUNCTION
{
BlendOp = 0,
BlendFlags = 0,
SourceConstantAlpha = alpha,
AlphaFormat = 1
};
User32.UpdateLayeredWindow(Handle, ptr1, ref point1, ref size1, ptr2, ref point2, 0, ref blendfunction1, 2);
Gdi32.SelectObject(ptr2, ptr4);
}
finally
{
Gdi32.DeleteObject(ptr3);
}
User32.ReleaseDC(IntPtr.Zero, ptr1);
Gdi32.DeleteDC(ptr2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,8 @@ public LabelLayout LabelLayout
get { return zedGraphControl.GraphPane.Layout; }
}

public ZedGraphControl GraphControl { get { return zedGraphControl; } }

#endregion
}
}
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Controls/Startup/StartPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private void PopulateTutorialPanel()
new TutorialActionBoxControl
{
Caption = TutorialTextResources.TargetedMSMS_Caption,
Icon = TutorialImageResources.TargetedMSMS_start,
Icon = TutorialImageResources.PRM_start,
EventAction = () => Tutorial(
TutorialLinkResources.TargetedMSMS_zip,
TutorialLinkResources.TargetedMSMS_pdf,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<data name="SmallMolecule_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\smallmolecule_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TargetedMSMS_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\targetedmsms_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="PRM_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\prm_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@
<value>..\..\resources\startpage\smallmoleculequantification_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SmallMolLibraries_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\smallmollibraries_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\..\resources\startpage\smallmoleculeimslibraries_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SmallMolecule_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\smallmolecule_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TargetedMSMS_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\targetedmsms_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="PRM_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\prm_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<data name="SmallMolecule_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\smallmolecule_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TargetedMSMS_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\targetedmsms_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="PRM_start" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\resources\startpage\prm_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
20 changes: 20 additions & 0 deletions pwiz_tools/Skyline/Controls/WizardPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,32 @@ namespace pwiz.Skyline.Controls
{
public class WizardPages : TabControl
{
public WizardPages()
{
TabStop = false; // Make sure the TabControl is not a tab stop
}

protected override void WndProc(ref Message m)
{
// Hide tabs by trapping the TCM_ADJUSTRECT message
if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1;
else base.WndProc(ref m);
}

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// If the user presses Ctrl+Tab or Ctrl+Shift+Tab,
// just return true to swallow the keystroke, or
// these key combinations will rotate through the tabs.
if (keyData == (Keys.Control | Keys.Tab) ||
keyData == (Keys.Control | Keys.Shift | Keys.Tab))
{
return true; // Keystroke is handled; don't pass to base.
}

// Otherwise, let the base class handle it
return base.ProcessCmdKey(ref msg, keyData);
}
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/s-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/s-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA-PASEF/en/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/en/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/ja/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/ja/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA/ja/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/DIA/zh-CHS/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/cover.png
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/PRM/ja/cover.png
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/PRM/zh-CHS/cover.png
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/iRT/en/cover.png
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/iRT/ja/cover.png
Binary file modified pwiz_tools/Skyline/Documentation/Tutorials/iRT/zh-CHS/cover.png
58 changes: 51 additions & 7 deletions pwiz_tools/Skyline/FileUI/PeptideSearch/SearchControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,37 @@ protected virtual void UpdateTaskbarProgress(TaskbarProgress.TaskbarStates state
Program.MainWindow.UpdateTaskbarProgress(state, percentComplete);
}

public interface IProgressLock
{
int? LockLineCount { get; }
string FilterMessage(string message);
}

private IProgressLock _progressLock;

public IProgressLock ProgressLock
{
get
{
return _progressLock;
}
set
{
bool unlocking = IsProgressLocked && value == null;
_progressLock = value;
if (unlocking)
RefreshProgressTextbox();
}
}

public bool IsProgressLocked
{
get
{
return (_progressLock?.LockLineCount ?? int.MaxValue) <= _progressTextItems.Count;
}
}

protected int lastSegment = -1;
protected string lastMessage;
protected string lastSegmentName;
Expand Down Expand Up @@ -133,13 +164,16 @@ protected void UpdateSearchEngineProgress(IProgressStatus status)
if (status.SegmentCount > 0)
percentComplete = status.Segment * 100 / status.SegmentCount + status.ZoomedPercentComplete / status.SegmentCount;

UpdateTaskbarProgress(TaskbarProgress.TaskbarStates.Normal, percentComplete);
if (status.PercentComplete == -1)
progressBar.Style = ProgressBarStyle.Marquee;
else
if (!IsProgressLocked)
{
progressBar.Value = percentComplete;
progressBar.Style = ProgressBarStyle.Continuous;
UpdateTaskbarProgress(TaskbarProgress.TaskbarStates.Normal, percentComplete);
if (status.PercentComplete == -1)
progressBar.Style = ProgressBarStyle.Marquee;
else
{
progressBar.Value = percentComplete;
progressBar.Style = ProgressBarStyle.Continuous;
}
}

// look at the last 10 lines for the same message and if found do not relog the same message
Expand All @@ -155,9 +189,17 @@ protected void UpdateSearchEngineProgress(IProgressStatus status)
return;
}

if (ProgressLock != null)
{
message = ProgressLock.FilterMessage(message);
if (string.IsNullOrEmpty(message))
return;
}

var newEntry = new ProgressEntry(DateTime.Now, message);
_progressTextItems.Add(newEntry);
txtSearchProgress.AppendLineWithAutoScroll($@"{newEntry.ToString(showTimestampsCheckbox.Checked)}{Environment.NewLine}");
if (!IsProgressLocked)
txtSearchProgress.AppendLineWithAutoScroll($@"{newEntry.ToString(showTimestampsCheckbox.Checked)}{Environment.NewLine}");
}

public void SetProgressBarDisplayStyle(ProgressBarDisplayText style)
Expand All @@ -174,6 +216,8 @@ public void SetProgressBarText(string message)
}
}

public ProgressBar ProgressBar => progressBar;

public int PercentComplete => progressBar.Value;

protected CancellationTokenSource _cancelToken;
Expand Down
Binary file modified pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/AuditLog_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/CustomReports_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-zh-CHS.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DDASearch_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DIA-PASEF_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DIA_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DIA_start-zh-CHS.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/DIA_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/IMSFiltering_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/LibraryExplorer_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-zh-CHS.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/OptimizeCE_start.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/PeakPicking_start.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified pwiz_tools/Skyline/Resources/StartPage/iRT_start-ja.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/iRT_start-zh-CHS.png
Binary file modified pwiz_tools/Skyline/Resources/StartPage/iRT_start.png
Loading

0 comments on commit 341bee6

Please sign in to comment.