Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.
C#
Help > About: version, credits, the license as a document, system facts; "license" spelling
Alexander Graef5ddbb3975f54
diff --git a/.editorconfig b/.editorconfigindex 96b395c..82e7085 100644--- a/.editorconfig+++ b/.editorconfig@@ -10,7 +10,7 @@ trim_trailing_whitespace = trueindent_style = tabindent_size = 4-# the licence header of every source file (the IDE adds it to new files, IDE0073 flags a file without it)+# the license header of every source file (the IDE adds it to new files, IDE0073 flags a file without it)file_header_template = SPDX-License-Identifier: GPL-3.0-or-later\nCopyright (C) 2026 Alexander Graef <[email protected]>\n\nThis file is part of WaveDude Next, a 2D wave simulator.\n\nBased on the work of\n JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026\n <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>\n Manuel (0x23, Diffraction Limited), author of WaveSimulator2D\n <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>\n\nWaveDude Next is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or\n<https://www.gnu.org/licenses/>.dotnet_diagnostic.IDE0073.severity = warningdiff --git a/CLAUDE.md b/CLAUDE.mdindex 4426ed4..245bf01 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -7,7 +7,7 @@ Last updated 2026-10-15. Update this file when the facts below change.**WaveDude Next** — a 2D wave-equation simulator (field + accumulated intensity views, refractive-indexscenes from images, point/composite sources, probes with live graphs, video export), the successor ofJeroen Vleggaar's (Huygens Optics) **Wave Dude 2D v0.29**, rebuilt as a .NET 10 library plus a WPF app with a-live, scrubbable preview. Licence **GPL-3.0-or-later** (see "Rebrand and licensing" below for the people,+live, scrubbable preview. License **GPL-3.0-or-later** (see "Rebrand and licensing" below for the people,the header and LICENSE.md).**The old sources are gone from the tree** (2026-10-15, the first rebrand step): the author's VB.NET@@ -441,6 +441,29 @@ WPF shell as it stands:compresses slower, about 33 ms per frame in the job (`CompressionLevel.Fastest` would be the lever, at somesize). `JpegEncoder.ParallelRows` and `LastPhases` exist for the bench. The harness project is`net10.0-windows` with `UseWPF` for that bench (the library stays `net10.0`).+- **Help > About** (2026-10-15, the user's go on the recommendation): `Help/AboutWindow`, a modal window owned by the+ main window (themed, dark title bar, `HelpCommands.About`, id `MenuHelpAbout`; Esc and Enter close, every link and+ button in the Tab cycle, the focus starts on Close; sized to its content at first and **resizable** (the user's+ rule, 2026-10-15: modal does not mean fixed), the license document taking the extra height while it is shown, a+ filler row above the buttons otherwise, so Close stays at the bottom). One page: the icon, product, "Version 0.1.0 (05e5865)" and the+ copyright from the assembly attributes (`Help/AboutInfo`; the version is `Directory.Build.props`' `Version` plus the+ commit hash the SDK puts into the informational version, shortened to seven characters); the credits word for word+ as in the source header, in English, with the four links; the GPL sentence (localised) with the link to gnu.org and+ a button that shows LICENSE.md as a document (the user's rule, 2026-10-15: no raw Markdown on screen, no Markdown+ library and no Markdown code in the app): `Build/LicenseDocument.targets` turns the file into a `FlowDocument`+ at build time with an inline C# task (`RoslynCodeTaskFactory`, part of MSBuild; headings, paragraphs, the rule,+ bullet lists, indented code and the bare URL links, which is all the FSF's file has) into+ `obj/<Configuration>/License.xaml`, embedded as the resource `License.xaml`, regenerated only when LICENSE.md is+ newer; `AboutInfo.LicenseDocument` loads it with `XamlReader` into a `FlowDocumentScrollViewer`, whose links+ bubble `RequestNavigate` to the window's one handler; a System block as "label: value" lines (program and version, runtime,+ OS, logical cores, memory free of physical, the GPU setting, the OpenCL devices with vendor and memory, the H.264+ encoders of Media Foundation; a missing OpenCL or Media Foundation is a line, not an exception) in a read-only text+ box, and "Copy system info" putting those lines on the clipboard for a bug report. Labels are `About*` keys in the+ four tables; the credits and the license text stay English. Ids `AboutWindow`, `AboutVersion`, `AboutProduct`,+ `AboutCopyright`, `AboutCredit*`, `AboutLink*`, `AboutLicenseToggle`, `AboutLicenseText`, `AboutSystemText`,+ `AboutCopy`, `AboutClose`. A `Hyperlink` style (accent, underlined on hover and keyboard focus) went into+ `Editors.xaml`. UI Automation lists the owned dialog under the main window, not at the root like a popup. Spelling: **"license"**, the+ GPL's own, everywhere (the user's rule, 2026-10-15), while the UI otherwise keeps "colour".- **Unsaved edits** (2026-10-14): `MainWindow.IsDirty`, set by the watcher on any model change, cleared onopen/new/save; the title gets `*` after the file (or "Untitled*", `TitleConverter`, re-read on a languageswitch) and New, Open, Close, Exit and a drop ask Yes/No/Cancel (`ConfirmDiscard`, `SaveChangesFormat`).@@ -550,6 +573,9 @@ No automated tests in the solution; standalone harnesses exist under `_tools/` (- Publish: `dotnet publish WaveDudeNext.WPF/WaveDudeNext.WPF.csproj -p:PublishProfile=SingleFile` →`WaveDudeNext.WPF/bin/Publish/`: one framework-dependent win-x64 `WaveDudeNext.WPF.exe`, nothing else needed.The profile takes the framework from the project.+- `Directory.Build.props` at the repo root carries `Version` (0.1.0), `Product` and `Description` for every project+ under it; the SDK appends the commit hash to the informational version by itself (`0.1.0+<sha>`), which About and+ the exe's file properties show. Bump the version there, nowhere else.- Expected result: 0 errors, 0 warnings. `DocumentationFile` is on, so malformed `///` XML or a wrong`<param>` name is a build warning — keep it at zero.@@ -671,6 +697,13 @@ passing harnesses for comfort, never all of them after an edit.file and turns the project dirty, the status bar says so, the scene view shows the path; then the file isoverwritten on disk and the picture follows within a moment; a second project without a path finds itsimage by name in `scene_images` and stores the relative path (8 checks, about 40 s).+ `_tools/ui_check/AboutCheck.ps1` (2026-10-15, 17 checks, about 10 s) opens Help > About by keyboard (F10, Left wraps+ to the Help header, Down, Enter), finds the dialog as a child of the main window, posts its keys to the dialog's own+ handle (`DKey`), and checks the version line against `git rev-parse --short=7 HEAD`, the copyright and credit lines,+ the five links, the eight system lines, the focus on Close, the Tab cycle, Space on the license toggle showing the+ GPL document and hiding it again, a resize through `SetWindowPos` giving the height to the document, and Esc closing;+ saves `%TEMP%\wavedude_about.png` with the license text shown and+ prints the system report.`FocusedId` is **one** UI Automation query for the element with keyboard focus (a template part'sid such as `PART_EditableTextBox` is mapped to its owner); asking 17 ids one by one cost half asecond per Tab and made `FocusOn` crawl. Timings after the 2026-10-14 clean-up: RunCheck 67 s@@ -854,7 +887,7 @@ FrameStore (temporary file in %LOCALAPPDATA%\WaveDudeNext\cache, DeleteOnClose,## Known issues (open)-- WPF: no progress bar for a run (status text only; the export has one); the Simulation menu has no About/Help; the probe+- WPF: no progress bar for a run (status text only; the export has one); the probesignal lane is not drawn yet (the graph boxes are); the preview skips frames at1080p (see the numbers in the library architecture section).- WPF preview, frames vs. steps: the transport bar, scrubber and playback count **frames**@@ -933,7 +966,7 @@ canvases, HEVC (Media Foundation has it on some machines). Author's point 10.offer `ColorScheme.Simplify` in the editor; renaming a project scheme does not update the layers thatrefer to it; base64 vs BaseXML for the embedded image; the RAM-first frame store (numbers above);dropping the 9-point Laplacian (author's suggestion, user undecided); timeline event tracks, zoom and-pan (roadmap); Help > About has no content; dock pane titles are not exposed to UI Automation.+pan (roadmap); dock pane titles are not exposed to UI Automation.## Roadmap@@ -987,7 +1020,7 @@ JJM (Jeroen) Vleggaar, Huygens Optics (author of Wave Dude 2D, GPL-3.0-or-later,Manuel, GitHub `0x23`, YouTube "Diffraction Limited" (author of WaveSimulator2D, the Python/CuPynumerics Jeroen's engine took its design from; surname not public; the 0x23 = Manuel link comes fromJeroen's mail of 2026-10-08, which also says Manuel consented to publication and will add an MIT-licence to his repo). Private addresses stay out of files.+license to his repo). Private addresses stay out of files.**Source header** (accepted 2026-10-15, applied to every `.cs`, `.xaml`, `.ps1` and `.py` file the same day, thegenerated `Settings.Designer.cs` excepted; the same text in every file, `'` in VB, `//` in C#, `<!-- -->` as one@@ -1020,11 +1053,11 @@ was removed from the repo on 2026-10-15; his headers live on in git history.**LICENSE.md** (written 2026-10-15, the user's call): a short attribution block on top (the projectname, the copyright line, the same "Based on the work of" list as the header, one GPL sentence, a-rule), then the FSF's own Markdown of the licence, <https://www.gnu.org/licenses/gpl-3.0.md>,+rule), then the FSF's own Markdown of the license, <https://www.gnu.org/licenses/gpl-3.0.md>,**verbatim** (34,893 bytes, md5 `ba29b1da0f9c28e2a9e072aba46cf040`; `tail -n +19 LICENSE.md | md5sum`must give that). The block is about 2 % of the file, which should stay inside the near-exact match-GitHub's licence detection (licensee) needs to label the repo "GPL-3.0"; **check the sidebar after the-first push** and move the block into the README if the label is missing. The licence text itself is+GitHub's license detection (licensee) needs to label the repo "GPL-3.0"; **check the sidebar after the+first push** and move the block into the README if the label is missing. The license text itself isnever edited (the FSF allows verbatim copies only). `LICENSE.md` is the name the header points at(GitHub also accepts `LICENSE` and `COPYING`; one file, one name).diff --git a/Directory.Build.props b/Directory.Build.propsnew file mode 100644index 0000000..bf30106--- /dev/null+++ b/Directory.Build.props@@ -0,0 +1,11 @@+<Project>++ <!-- shared by every project under the repo root: the product version (the SDK appends the commit hash to the+ informational version, which Help > About shows shortened) and the names Explorer's file properties show -->+ <PropertyGroup>+ <Version>0.1.0</Version>+ <Product>WaveDude Next</Product>+ <Description>A 2D wave simulator</Description>+ </PropertyGroup>++</Project>diff --git a/LICENSE.md b/LICENSE.mdindex 7df08c2..c3686a6 100644--- a/LICENSE.md+++ b/LICENSE.md@@ -12,7 +12,7 @@ Based on the work ofWaveDude Next is free software: you can redistribute it and/or modify it under the terms of theGNU General Public License as published by the Free Software Foundation, either version 3 of theLicense, or (at your option) any later version. It is distributed WITHOUT ANY WARRANTY. The full-licence text follows.+license text follows.---diff --git a/WaveDudeNext.WPF/App.xaml.cs b/WaveDudeNext.WPF/App.xaml.csindex f6b316f..e911dba 100644--- a/WaveDudeNext.WPF/App.xaml.cs+++ b/WaveDudeNext.WPF/App.xaml.cs@@ -203,7 +203,7 @@ public partial class App : Application};Logger.Info("Application: '{Path}'", Environment.ProcessPath);- Logger.Info("Application Version: {Version}", Assembly.GetExecutingAssembly().GetName().Version);+ Logger.Info("Application Version: {Version}", Help.AboutInfo.Version);Logger.Info("OS: '{OS}'", Environment.OSVersion.VersionString);Logger.Info("Runtime: '{Runtime}'", RuntimeInformation.FrameworkDescription);Logger.Info("Log file: '{Path}'", LogFile);diff --git a/WaveDudeNext.WPF/Build/LicenseDocument.targets b/WaveDudeNext.WPF/Build/LicenseDocument.targetsnew file mode 100644index 0000000..194b3c4--- /dev/null+++ b/WaveDudeNext.WPF/Build/LicenseDocument.targets@@ -0,0 +1,171 @@+<!--+SPDX-License-Identifier: GPL-3.0-or-later+Copyright (C) 2026 Alexander Graef <[email protected]>++This file is part of WaveDude Next, a 2D wave simulator.++Based on the work of+ JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+ <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+ Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+ <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>++WaveDude Next 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 3 of the License, or (at your option) any later+version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+<https://www.gnu.org/licenses/>.+-->++<!-- Build action: LICENSE.md becomes a WPF FlowDocument (obj/<Configuration>/License.xaml), embedded as the resource+ "License.xaml", which Help > About loads with XamlReader into a FlowDocumentScrollViewer. The Markdown subset is+ what the FSF's file uses: headings (#, ##, ###), paragraphs with hard line breaks, a rule of three dashes, bullet lists+ with indented continuation lines, indented code blocks and <https://...> autolinks; backslash escapes are+ undone. The converter is an inline C# task (RoslynCodeTaskFactory, part of MSBuild), so the app carries no+ Markdown code and the build needs no package. Regenerated only when LICENSE.md is newer than the output. -->+<Project>++ <UsingTask TaskName="MarkdownToFlowDocument" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">+ <ParameterGroup>+ <Source ParameterType="System.String" Required="true" />+ <Destination ParameterType="System.String" Required="true" />+ </ParameterGroup>+ <Task>+ <Code Type="Class" Language="cs"><![CDATA[+using System;+using System.Collections.Generic;+using System.IO;+using System.Text;+using System.Text.RegularExpressions;++public class MarkdownToFlowDocument : Microsoft.Build.Utilities.Task+{+ [Microsoft.Build.Framework.Required] public string Source { get; set; }+ [Microsoft.Build.Framework.Required] public string Destination { get; set; }++ private static readonly Regex Item = new Regex(@"^[-*+]\s+");+ private static readonly Regex Rule = new Regex(@"^-{3,}\s*$");+ private static readonly Regex AutoLink = new Regex(@"<(https?://[^\s>]+)>");+ private static readonly Regex Escaped = new Regex(@"\\([\\`*_{}\[\]()#+\-.!<>])");++ public override bool Execute()+ {+ try+ {+ string[] lines = File.ReadAllLines(Source);+ var sb = new StringBuilder();+ sb.AppendLine("<FlowDocument xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" FontFamily=\"Segoe UI\" FontSize=\"12\" PagePadding=\"10\" TextAlignment=\"Left\" IsHyphenationEnabled=\"False\">");+ int i = 0, n = lines.Length;+ while (i < n)+ {+ string line = lines[i];+ if (line.Trim().Length == 0) { i++; continue; }+ if (line.StartsWith("#"))+ {+ int level = line.Length - line.TrimStart('#').Length;+ string text = line.Substring(level).Trim();+ string style = level == 1 ? "FontSize=\"18\" FontWeight=\"SemiBold\" Margin=\"0,6,0,10\""+ : level == 2 ? "FontSize=\"15\" FontWeight=\"SemiBold\" Margin=\"0,14,0,8\""+ : "FontSize=\"13\" FontWeight=\"SemiBold\" Margin=\"0,10,0,6\"";+ sb.AppendLine("<Paragraph " + style + ">" + Inline(text) + "</Paragraph>");+ i++;+ continue;+ }+ if (Rule.IsMatch(line))+ {+ sb.AppendLine("<Paragraph BorderThickness=\"0,0,0,1\" BorderBrush=\"{DynamicResource ControlBorder}\" Margin=\"0,6,0,14\" FontSize=\"1\" />");+ i++;+ continue;+ }+ if (line.StartsWith(" "))+ {+ var code = new List<string>();+ int j = i;+ while (j < n && (lines[j].StartsWith(" ") || lines[j].Trim().Length == 0)) { code.Add(lines[j]); j++; }+ while (code.Count > 0 && code[code.Count - 1].Trim().Length == 0) { code.RemoveAt(code.Count - 1); }+ int indent = int.MaxValue;+ foreach (string c in code) { if (c.Trim().Length > 0) { indent = Math.Min(indent, c.Length - c.TrimStart(' ').Length); } }+ var parts = new List<string>();+ foreach (string c in code) { parts.Add(Escape(c.Length >= indent ? c.Substring(indent) : "")); }+ sb.AppendLine("<Paragraph FontFamily=\"Consolas\" FontSize=\"11\" Margin=\"16,0,0,10\" xml:space=\"preserve\">" + string.Join("<LineBreak />", parts) + "</Paragraph>");+ i = j;+ continue;+ }+ if (Item.IsMatch(line))+ {+ sb.AppendLine("<List MarkerStyle=\"Disc\" Margin=\"0,0,0,10\" Padding=\"20,0,0,0\">");+ while (i < n)+ {+ if (lines[i].Trim().Length == 0)+ {+ int k = i;+ while (k < n && lines[k].Trim().Length == 0) { k++; }+ if (k < n && Item.IsMatch(lines[k])) { i = k; } else { break; }+ }+ if (!Item.IsMatch(lines[i])) { break; }+ string text = Item.Replace(lines[i], "").Trim();+ i++;+ while (i < n && lines[i].Trim().Length > 0 && !Item.IsMatch(lines[i])) { text += " " + lines[i].Trim(); i++; }+ sb.AppendLine("<ListItem Margin=\"0,0,0,4\"><Paragraph>" + Inline(text) + "</Paragraph></ListItem>");+ }+ sb.AppendLine("</List>");+ continue;+ }+ string para = line.Trim();+ i++;+ while (i < n && lines[i].Trim().Length > 0 && !lines[i].StartsWith("#") && !Item.IsMatch(lines[i]) && !lines[i].StartsWith(" ")) { para += " " + lines[i].Trim(); i++; }+ sb.AppendLine("<Paragraph Margin=\"0,0,0,10\">" + Inline(para) + "</Paragraph>");+ }+ sb.AppendLine("</FlowDocument>");+ Directory.CreateDirectory(Path.GetDirectoryName(Destination));+ File.WriteAllText(Destination, sb.ToString(), new UTF8Encoding(false));+ Log.LogMessage(Microsoft.Build.Framework.MessageImportance.Normal, "License document: " + Destination + " from " + Source);+ return true;+ }+ catch (Exception ex)+ {+ Log.LogErrorFromException(ex);+ return false;+ }+ }++ private static string Escape(string s) => s.Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace("\"", """);++ // text with its <https://...> autolinks as Hyperlinks and the rest escaped+ private static string Inline(string text)+ {+ text = Escaped.Replace(text, "$1");+ var sb = new StringBuilder();+ int last = 0;+ foreach (Match m in AutoLink.Matches(text))+ {+ sb.Append(Escape(text.Substring(last, m.Index - last)));+ string url = Escape(m.Groups[1].Value);+ sb.Append("<Hyperlink NavigateUri=\"" + url + "\">" + url + "</Hyperlink>");+ last = m.Index + m.Length;+ }+ sb.Append(Escape(text.Substring(last)));+ return sb.ToString();+ }+}+]]></Code>+ </Task>+ </UsingTask>++ <PropertyGroup>+ <LicenseMarkdown>$(MSBuildThisFileDirectory)..\..\LICENSE.md</LicenseMarkdown>+ </PropertyGroup>++ <!-- the conversion, skipped while the output is newer than LICENSE.md -->+ <Target Name="GenerateLicenseDocument" Inputs="$(LicenseMarkdown);$(MSBuildThisFileFullPath)" Outputs="$(IntermediateOutputPath)License.xaml">+ <MarkdownToFlowDocument Source="$(LicenseMarkdown)" Destination="$(IntermediateOutputPath)License.xaml" />+ </Target>++ <!-- the embedding; a target of its own, so the item is added even when the conversion was skipped as up to date -->+ <Target Name="EmbedLicenseDocument" BeforeTargets="BeforeBuild" DependsOnTargets="GenerateLicenseDocument">+ <ItemGroup>+ <EmbeddedResource Include="$(IntermediateOutputPath)License.xaml" LogicalName="License.xaml" />+ </ItemGroup>+ </Target>++</Project>diff --git a/WaveDudeNext.WPF/Commands/HelpCommands.cs b/WaveDudeNext.WPF/Commands/HelpCommands.csnew file mode 100644index 0000000..c02f78a--- /dev/null+++ b/WaveDudeNext.WPF/Commands/HelpCommands.cs@@ -0,0 +1,28 @@+// SPDX-License-Identifier: GPL-3.0-or-later+// Copyright (C) 2026 Alexander Graef <[email protected]>+//+// This file is part of WaveDude Next, a 2D wave simulator.+//+// Based on the work of+// JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+// <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+// Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+// <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>+//+// WaveDude Next 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 3 of the License, or (at your option) any later+// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+// <https://www.gnu.org/licenses/>.+++using System.Windows.Input;++namespace WaveDudeNext.WPF.Commands;++/// <summary>Commands of the Help menu, bound by <see cref="MainWindow"/>.</summary>+public static class HelpCommands+{+ /// <summary>Opens the About dialog: version, credits, license and the system facts a bug report needs.</summary>+ public static readonly RoutedUICommand About = new("About", nameof(About), typeof(HelpCommands));+}diff --git a/WaveDudeNext.WPF/Help/AboutInfo.cs b/WaveDudeNext.WPF/Help/AboutInfo.csnew file mode 100644index 0000000..c6bf78c--- /dev/null+++ b/WaveDudeNext.WPF/Help/AboutInfo.cs@@ -0,0 +1,132 @@+// SPDX-License-Identifier: GPL-3.0-or-later+// Copyright (C) 2026 Alexander Graef <[email protected]>+//+// This file is part of WaveDude Next, a 2D wave simulator.+//+// Based on the work of+// JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+// <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+// Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+// <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>+//+// WaveDude Next 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 3 of the License, or (at your option) any later+// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+// <https://www.gnu.org/licenses/>.+++using System.IO;+using System.Reflection;+using System.Runtime.InteropServices;+using System.Text;+using System.Windows.Documents;+using System.Windows.Markup;+using WaveDudeNext.Engine;+using WaveDudeNext.Export;+using WaveDudeNext.Runs;++namespace WaveDudeNext.WPF.Help;++/// <summary>+/// What the About dialog shows and what a bug report needs: the product name, version and copyright from the assembly+/// attributes (set in <c>Directory.Build.props</c> and the project file), the license text embedded from+/// <c>LICENSE.md</c>, and the system facts (runtime, OS, memory, cores, the OpenCL devices, the H.264 encoders).+/// Thread-free; <see cref="SystemReport"/> enumerates devices and encoders, a few milliseconds, call it once.+/// </summary>+public static class AboutInfo+{+ private static readonly Assembly Assembly = typeof(AboutInfo).Assembly;++ /// <summary>The product name of the assembly ("WaveDude Next").</summary>+ public static string Product { get; } = Assembly.GetCustomAttribute<AssemblyProductAttribute>()?.Product ?? "WaveDude Next";++ /// <summary>The copyright line of the assembly.</summary>+ public static string Copyright { get; } = Assembly.GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright ?? "";++ /// <summary>+ /// The version for people: "0.1.0 (05e5865)", the informational version with the SDK's commit hash shortened+ /// to seven characters in brackets; without a hash, the plain version.+ /// </summary>+ public static string Version { get; } = FormatVersion(+ Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion+ ?? Assembly.GetName().Version?.ToString(3) ?? "");++ /// <summary>Splits "0.1.0+05e58652c8..." into "0.1.0 (05e5865)"; a hash of seven characters or fewer stays as it is.</summary>+ public static string FormatVersion(string informational)+ {+ int plus = informational.IndexOf('+');+ if (plus < 0)+ {+ return informational;+ }+ string hash = informational[(plus + 1)..];+ if (hash.Length > 7)+ {+ hash = hash[..7];+ }+ return hash.Length == 0 ? informational[..plus] : $"{informational[..plus]} ({hash})";+ }++ /// <summary>+ /// LICENSE.md as a <see cref="FlowDocument"/>: the build turns the Markdown into the embedded resource+ /// <c>License.xaml</c> (<c>Build/LicenseDocument.targets</c>), read here with <see cref="XamlReader"/>. A build without+ /// the resource gets a one-paragraph document pointing at gnu.org. UI thread (the document is a WPF object).+ /// </summary>+ public static FlowDocument LicenseDocument()+ {+ using Stream? stream = Assembly.GetManifestResourceStream("License.xaml");+ if (stream != null)+ {+ return (FlowDocument)XamlReader.Load(stream);+ }+ var document = new FlowDocument();+ document.Blocks.Add(new Paragraph(new Run("LICENSE.md is not embedded in this build. See https://www.gnu.org/licenses/gpl-3.0.html")));+ return document;+ }++ /// <summary>+ /// The system facts as "label: value" lines, the labels looked up through <paramref name="label"/> (a string table+ /// key to its text). <paramref name="gpuSetting"/> is the application's GPU switch. Devices and encoders are+ /// enumerated here; a missing OpenCL or Media Foundation is reported as a line, never thrown.+ /// </summary>+ public static string SystemReport(bool gpuSetting, Func<string, string> label)+ {+ var sb = new StringBuilder();+ void Line(string key, string value) => sb.Append(label(key)).Append(": ").AppendLine(value);+ Line("AboutProductLine", $"{Product} {Version}");+ Line("AboutRuntime", $"{RuntimeInformation.FrameworkDescription}, {RuntimeInformation.ProcessArchitecture}");+ Line("AboutOperatingSystem", $"{RuntimeInformation.OSDescription}, {RuntimeInformation.OSArchitecture}");+ Line("AboutProcessor", $"{Environment.ProcessorCount} {label("AboutCores")}");+ Line("AboutMemory", $"{FrameMemory.Gigabytes(FrameMemory.AvailableBytes())} {label("AboutMemoryFree")} {FrameMemory.Gigabytes(FrameMemory.PhysicalBytes())}");+ Line("AboutGpuSetting", label(gpuSetting ? "AboutOn" : "AboutOff"));+ Line("AboutOpenClDevices", Devices(label));+ Line("AboutH264Encoders", Encoders(label));+ return sb.ToString().TrimEnd();+ }++ private static string Devices(Func<string, string> label)+ {+ try+ {+ List<GpuDeviceInfo> devices = GpuDeviceInfo.FindAll();+ return devices.Count == 0+ ? label("AboutNone")+ : string.Join("; ", devices.Select(d => $"{d.Name} ({d.Vendor}, {FrameMemory.Gigabytes(d.GlobalMemory)})"));+ }+ catch (Exception ex) when (ex is DllNotFoundException or EntryPointNotFoundException or BadImageFormatException)+ {+ return label("AboutOpenClMissing");+ }+ }++ private static string Encoders(Func<string, string> label)+ {+ if (!Mp4Writer.IsAvailable())+ {+ return label("AboutMediaFoundationMissing");+ }+ IReadOnlyList<string> encoders = Mp4Writer.AvailableEncoders(hardwareOnly: false);+ return encoders.Count == 0 ? label("AboutNone") : string.Join("; ", encoders);+ }+}diff --git a/WaveDudeNext.WPF/Help/AboutWindow.xaml b/WaveDudeNext.WPF/Help/AboutWindow.xamlnew file mode 100644index 0000000..ab44a3c--- /dev/null+++ b/WaveDudeNext.WPF/Help/AboutWindow.xaml@@ -0,0 +1,101 @@+<!--+SPDX-License-Identifier: GPL-3.0-or-later+Copyright (C) 2026 Alexander Graef <[email protected]>++This file is part of WaveDude Next, a 2D wave simulator.++Based on the work of+ JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+ <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+ Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+ <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>++WaveDude Next 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 3 of the License, or (at your option) any later+version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+<https://www.gnu.org/licenses/>.+-->+++<Window x:Class="WaveDudeNext.WPF.Help.AboutWindow"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ Title="{DynamicResource AboutTitle}" Icon="/App.ico"+ Width="600" SizeToContent="Height" MinWidth="480" MinHeight="620" ShowInTaskbar="False"+ WindowStartupLocation="CenterOwner"+ Background="{DynamicResource WindowBackground}" Foreground="{DynamicResource WindowForeground}"+ FocusManager.FocusedElement="{Binding ElementName=closeButton}"+ AutomationProperties.AutomationId="AboutWindow">+ <!-- Help > About: identity, the credits word for word as in the source header, the license sentence with the full+ text on request, and the system facts a bug report needs; everything reachable by Tab, Esc and Enter close.+ Sized to its content at first and resizable: the license document takes the extra height while it is shown+ (its row is the star row then, code-behind), otherwise the filler row above the buttons does -->+ <Grid Margin="20,16,20,16">+ <Grid.RowDefinitions>+ <RowDefinition Height="Auto" />+ <RowDefinition Height="Auto" />+ <RowDefinition Height="Auto" />+ <RowDefinition x:Name="licenseRow" Height="Auto" />+ <RowDefinition Height="Auto" />+ <RowDefinition x:Name="fillerRow" Height="*" />+ <RowDefinition Height="Auto" />+ </Grid.RowDefinitions>++ <DockPanel Grid.Row="0">+ <Image Source="/App.png" Width="64" Height="64" Margin="0,0,16,0" VerticalAlignment="Top" DockPanel.Dock="Left" />+ <StackPanel>+ <TextBlock x:Name="productText" FontSize="20" FontWeight="SemiBold" AutomationProperties.AutomationId="AboutProduct" />+ <TextBlock x:Name="versionText" Margin="0,2,0,0" AutomationProperties.AutomationId="AboutVersion" />+ <TextBlock x:Name="copyrightText" AutomationProperties.AutomationId="AboutCopyright" />+ <TextBlock Text="{DynamicResource AboutTagline}" Foreground="{DynamicResource GrayText}" Margin="0,2,0,0" />+ </StackPanel>+ </DockPanel>++ <StackPanel Grid.Row="1">+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource AboutCredits}" Margin="0,14,0,6" />+ <!-- the credits are the source header's lines, in English, so every place names the two the same way -->+ <TextBlock TextWrapping="Wrap" AutomationProperties.AutomationId="AboutCreditVleggaar">+ JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026<LineBreak />+ <Run Text=" " /><Hyperlink NavigateUri="https://www.youtube.com/@HuygensOptics" RequestNavigate="OnNavigate" AutomationProperties.AutomationId="AboutLinkHuygensYouTube">youtube.com/@HuygensOptics</Hyperlink>+ <Run Text=" · " /><Hyperlink NavigateUri="https://www.huygensoptics.com" RequestNavigate="OnNavigate" AutomationProperties.AutomationId="AboutLinkHuygensSite">huygensoptics.com</Hyperlink>+ </TextBlock>+ <TextBlock TextWrapping="Wrap" Margin="0,6,0,0" AutomationProperties.AutomationId="AboutCreditManuel">+ Manuel (0x23, Diffraction Limited), author of WaveSimulator2D<LineBreak />+ <Run Text=" " /><Hyperlink NavigateUri="https://www.youtube.com/@DiffractionLimited" RequestNavigate="OnNavigate" AutomationProperties.AutomationId="AboutLinkDiffractionYouTube">youtube.com/@DiffractionLimited</Hyperlink>+ <Run Text=" · " /><Hyperlink NavigateUri="https://github.com/0x23/WaveSimulator2D" RequestNavigate="OnNavigate" AutomationProperties.AutomationId="AboutLinkWaveSimulator2D">github.com/0x23/WaveSimulator2D</Hyperlink>+ </TextBlock>+ </StackPanel>++ <StackPanel Grid.Row="2">+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource AboutLicense}" Margin="0,14,0,6" />+ <TextBlock TextWrapping="Wrap">+ <Run Text="{DynamicResource AboutLicenseNotice}" /><LineBreak />+ <Hyperlink NavigateUri="https://www.gnu.org/licenses/gpl-3.0.html" RequestNavigate="OnNavigate" AutomationProperties.AutomationId="AboutLinkGpl">gnu.org/licenses/gpl-3.0.html</Hyperlink>+ </TextBlock>+ <Button x:Name="licenseToggle" HorizontalAlignment="Left" Margin="0,8,0,0" Click="OnToggleLicense"+ Content="{DynamicResource AboutShowLicense}" AutomationProperties.AutomationId="AboutLicenseToggle" />+ </StackPanel>++ <!-- the FlowDocument the build made from LICENSE.md; the viewer scrolls, selects and copies by itself -->+ <Border x:Name="licenseBox" Grid.Row="3" Visibility="Collapsed" Height="260" MinHeight="120" Margin="0,8,0,0" BorderThickness="1"+ BorderBrush="{DynamicResource TextBoxBorder}" Background="{DynamicResource TextBoxBackground}">+ <FlowDocumentScrollViewer x:Name="licenseView" IsToolBarVisible="False" VerticalScrollBarVisibility="Auto"+ Foreground="{DynamicResource WindowForeground}" AutomationProperties.AutomationId="AboutLicenseText" />+ </Border>++ <StackPanel Grid.Row="4">+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource AboutSystem}" Margin="0,14,0,6" />+ <TextBox x:Name="systemText" IsReadOnly="True" IsReadOnlyCaretVisible="True" TextWrapping="Wrap" AcceptsReturn="True"+ VerticalContentAlignment="Top" VerticalScrollBarVisibility="Auto" MaxHeight="160"+ AutomationProperties.AutomationId="AboutSystemText" />+ </StackPanel>++ <StackPanel Grid.Row="6" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,14,0,0">+ <Button Content="{DynamicResource AboutCopy}" MinWidth="110" Margin="0,0,8,0" Click="OnCopy" ToolTip="{DynamicResource TipAboutCopy}"+ AutomationProperties.AutomationId="AboutCopy" />+ <Button x:Name="closeButton" Content="{DynamicResource AboutClose}" MinWidth="90" IsDefault="True" IsCancel="True"+ AutomationProperties.AutomationId="AboutClose" />+ </StackPanel>+ </Grid>+</Window>diff --git a/WaveDudeNext.WPF/Help/AboutWindow.xaml.cs b/WaveDudeNext.WPF/Help/AboutWindow.xaml.csnew file mode 100644index 0000000..f694ea1--- /dev/null+++ b/WaveDudeNext.WPF/Help/AboutWindow.xaml.cs@@ -0,0 +1,130 @@+// SPDX-License-Identifier: GPL-3.0-or-later+// Copyright (C) 2026 Alexander Graef <[email protected]>+//+// This file is part of WaveDude Next, a 2D wave simulator.+//+// Based on the work of+// JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+// <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+// Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+// <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>+//+// WaveDude Next 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 3 of the License, or (at your option) any later+// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+// <https://www.gnu.org/licenses/>.+++using System.Diagnostics;+using System.Windows;+using System.Windows.Documents;+using System.Windows.Input;+using System.Windows.Navigation;+using System.Windows.Threading;+using NLog;+using WaveDudeNext.WPF.Properties;+using WaveDudeNext.WPF.Theming;++namespace WaveDudeNext.WPF.Help;++/// <summary>+/// The About dialog (Help > About): product, version and copyright from the assembly, the credits as in the source+/// header, the license sentence with the embedded LICENSE.md on request, and the system report of+/// <see cref="AboutInfo.SystemReport"/> with a Copy button. Modal, owned by the main window, closed by Esc or Enter;+/// every link and button is in the Tab cycle. UI thread only.+/// </summary>+public partial class AboutWindow : Window+{+ private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();+ /// <summary>The document box's height while the window is sized to its content (the XAML value).</summary>+ private const double LicenseBoxHeight = 260;+ private readonly string _report;++ /// <summary>Builds the dialog and gathers the system report once.</summary>+ public AboutWindow()+ {+ InitializeComponent();+ SourceInitialized += (_, _) => ThemeController.Instance.ApplyTitleBar(this);+ // the links inside the loaded license document bubble their navigation up to the viewer+ licenseView.AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnNavigate));+ productText.Text = AboutInfo.Product;+ versionText.Text = string.Format(Label("AboutVersionFormat"), AboutInfo.Version);+ copyrightText.Text = AboutInfo.Copyright;+ _report = AboutInfo.SystemReport(Settings.Default.UseGpu, Label);+ systemText.Text = _report;+ }++ /// <summary>A string table entry, or the key itself when a table lacks it.</summary>+ private static string Label(string key) => Application.Current.TryFindResource(key) as string ?? key;++ /// <summary>Esc closes even while a text box has the focus (its edit behaviour would otherwise swallow the key).</summary>+ protected override void OnPreviewKeyDown(KeyEventArgs e)+ {+ if (e.Key == Key.Escape)+ {+ e.Handled = true;+ Close();+ return;+ }+ base.OnPreviewKeyDown(e);+ }++ private void OnNavigate(object sender, RequestNavigateEventArgs e)+ {+ Logger.Debug("About: opening {Uri}", e.Uri);+ try+ {+ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });+ }+ catch (Exception ex)+ {+ Logger.Warn(ex, "About: could not open {Uri}", e.Uri);+ }+ e.Handled = true;+ }++ private void OnToggleLicense(object sender, RoutedEventArgs e)+ {+ bool show = licenseBox.Visibility != Visibility.Visible;+ if (show && licenseView.Document == null)+ {+ licenseView.Document = AboutInfo.LicenseDocument();+ }+ licenseBox.Visibility = show ? Visibility.Visible : Visibility.Collapsed;+ // the extra height of a resized window goes to the document while it is shown, else to the gap above the buttons+ licenseRow.Height = show ? new GridLength(1, GridUnitType.Star) : GridLength.Auto;+ fillerRow.Height = show ? GridLength.Auto : new GridLength(1, GridUnitType.Star);+ licenseToggle.SetResourceReference(ContentProperty, show ? "AboutHideLicense" : "AboutShowLicense");+ // the window follows its content while the document is hidden (it grows by the box's fixed height when the+ // document appears and shrinks when it goes) and is sized by hand while the document is shown, since a window+ // sized to content snaps back after a resize and a star row under content sizing would take the whole+ // document; the switch waits for the layout that lets the window grow, then frees the box to fill its row+ if (show)+ {+ Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () =>+ {+ SizeToContent = SizeToContent.Manual;+ licenseBox.ClearValue(HeightProperty);+ });+ }+ else+ {+ licenseBox.Height = LicenseBoxHeight;+ SizeToContent = SizeToContent.Height;+ }+ }++ private void OnCopy(object sender, RoutedEventArgs e)+ {+ try+ {+ Clipboard.SetText(_report);+ Logger.Info(Label("AboutCopied"));+ }+ catch (System.Runtime.InteropServices.ExternalException ex)+ {+ Logger.Warn(ex, "About: the clipboard is held by another program");+ }+ }+}diff --git a/WaveDudeNext.WPF/MainWindow.Help.cs b/WaveDudeNext.WPF/MainWindow.Help.csnew file mode 100644index 0000000..2e96ead--- /dev/null+++ b/WaveDudeNext.WPF/MainWindow.Help.cs@@ -0,0 +1,32 @@+// SPDX-License-Identifier: GPL-3.0-or-later+// Copyright (C) 2026 Alexander Graef <[email protected]>+//+// This file is part of WaveDude Next, a 2D wave simulator.+//+// Based on the work of+// JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+// <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+// Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+// <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>+//+// WaveDude Next 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 3 of the License, or (at your option) any later+// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+// <https://www.gnu.org/licenses/>.+++using System.Windows.Input;+using WaveDudeNext.WPF.Help;++namespace WaveDudeNext.WPF;++public partial class MainWindow+{+ /// <summary>Help > About: the modal <see cref="AboutWindow"/> over this window.</summary>+ private void OnHelpAbout(object sender, ExecutedRoutedEventArgs e)+ {+ Logger.Debug("About dialog opened");+ new AboutWindow { Owner = this }.ShowDialog();+ }+}diff --git a/WaveDudeNext.WPF/MainWindow.xaml b/WaveDudeNext.WPF/MainWindow.xamlindex 1d34ccb..299d7ca 100644--- a/WaveDudeNext.WPF/MainWindow.xaml+++ b/WaveDudeNext.WPF/MainWindow.xaml@@ -183,6 +183,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<CommandBinding Command="{x:Static commands:ProjectCommands.MoveDown}" CanExecute="CanMoveDown" Executed="OnMoveDown" /><CommandBinding Command="{x:Static commands:ProjectCommands.ToggleEnabled}" CanExecute="CanToggleEnabled" Executed="OnToggleEnabled" /><CommandBinding Command="{x:Static commands:ProjectCommands.BrowseSceneImage}" Executed="OnBrowseSceneImage" />+ <CommandBinding Command="{x:Static commands:HelpCommands.About}" Executed="OnHelpAbout" /></Window.CommandBindings><!-- SaveAs has no default gesture -->@@ -294,7 +295,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file orItemContainerStyle="{StaticResource FrameMemoryMenuItemStyle}" /></MenuItem><MenuItem Header="{DynamicResource MenuHelp}">- <MenuItem Header="{DynamicResource MenuHelpAbout}" />+ <MenuItem Header="{DynamicResource MenuHelpAbout}" Command="{x:Static commands:HelpCommands.About}" AutomationProperties.AutomationId="MenuHelpAbout" /></MenuItem></Menu>diff --git a/WaveDudeNext.WPF/Strings/Strings.DE.xaml b/WaveDudeNext.WPF/Strings/Strings.DE.xamlindex 8f8d375..7c410cd 100644--- a/WaveDudeNext.WPF/Strings/Strings.DE.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.DE.xaml@@ -76,6 +76,35 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Hilfe</s:String><s:String x:Key="MenuHelpAbout">_Über WaveDude Next</s:String>+ <!-- Help > About -->+ <s:String x:Key="AboutTitle">Über WaveDude Next</s:String>+ <s:String x:Key="AboutVersionFormat">Version {0}</s:String>+ <s:String x:Key="AboutTagline">Ein 2D-Wellensimulator</s:String>+ <s:String x:Key="AboutCredits">Aufbauend auf der Arbeit von</s:String>+ <s:String x:Key="AboutLicense">Lizenz</s:String>+ <s:String x:Key="AboutLicenseNotice">WaveDude Next ist freie Software: Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder verändern, entweder gemäß Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren Version. Es wird OHNE JEDE GEWÄHRLEISTUNG verbreitet.</s:String>+ <s:String x:Key="AboutShowLicense">Lizenz_text anzeigen</s:String>+ <s:String x:Key="AboutHideLicense">Lizenz_text ausblenden</s:String>+ <s:String x:Key="AboutSystem">System</s:String>+ <s:String x:Key="AboutProductLine">Programm</s:String>+ <s:String x:Key="AboutRuntime">Laufzeit</s:String>+ <s:String x:Key="AboutOperatingSystem">Betriebssystem</s:String>+ <s:String x:Key="AboutProcessor">Prozessor</s:String>+ <s:String x:Key="AboutCores">logische Kerne</s:String>+ <s:String x:Key="AboutMemory">Arbeitsspeicher</s:String>+ <s:String x:Key="AboutMemoryFree">frei von</s:String>+ <s:String x:Key="AboutGpuSetting">Einstellung GPU (OpenCL)</s:String>+ <s:String x:Key="AboutOn">ein</s:String>+ <s:String x:Key="AboutOff">aus</s:String>+ <s:String x:Key="AboutOpenClDevices">OpenCL-Geräte</s:String>+ <s:String x:Key="AboutOpenClMissing">OpenCL ist nicht installiert</s:String>+ <s:String x:Key="AboutH264Encoders">H.264-Encoder</s:String>+ <s:String x:Key="AboutMediaFoundationMissing">Media Foundation ist nicht verfügbar</s:String>+ <s:String x:Key="AboutNone">keine</s:String>+ <s:String x:Key="AboutCopy">Systeminfo _kopieren</s:String>+ <s:String x:Key="TipAboutCopy">Die Systemzeilen in die Zwischenablage kopieren, für einen Fehlerbericht</s:String>+ <s:String x:Key="AboutCopied">Systeminformationen in die Zwischenablage kopiert</s:String>+ <s:String x:Key="AboutClose">Schließen</s:String><s:String x:Key="MenuProjectAddSource">_Quelle hinzufügen</s:String><s:String x:Key="MenuProjectAddProbe">_Sonde hinzufügen</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.EN.xaml b/WaveDudeNext.WPF/Strings/Strings.EN.xamlindex 72193cc..b9f5162 100644--- a/WaveDudeNext.WPF/Strings/Strings.EN.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.EN.xaml@@ -78,6 +78,35 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Help</s:String><s:String x:Key="MenuHelpAbout">_About WaveDude Next</s:String>+ <!-- Help > About -->+ <s:String x:Key="AboutTitle">About WaveDude Next</s:String>+ <s:String x:Key="AboutVersionFormat">Version {0}</s:String>+ <s:String x:Key="AboutTagline">A 2D wave simulator</s:String>+ <s:String x:Key="AboutCredits">Based on the work of</s:String>+ <s:String x:Key="AboutLicense">License</s:String>+ <s:String x:Key="AboutLicenseNotice">WaveDude Next 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 3 of the License, or (at your option) any later version. It is distributed WITHOUT ANY WARRANTY.</s:String>+ <s:String x:Key="AboutShowLicense">Show the license _text</s:String>+ <s:String x:Key="AboutHideLicense">Hide the license _text</s:String>+ <s:String x:Key="AboutSystem">System</s:String>+ <s:String x:Key="AboutProductLine">Program</s:String>+ <s:String x:Key="AboutRuntime">Runtime</s:String>+ <s:String x:Key="AboutOperatingSystem">Operating system</s:String>+ <s:String x:Key="AboutProcessor">Processor</s:String>+ <s:String x:Key="AboutCores">logical cores</s:String>+ <s:String x:Key="AboutMemory">Memory</s:String>+ <s:String x:Key="AboutMemoryFree">free of</s:String>+ <s:String x:Key="AboutGpuSetting">GPU (OpenCL) setting</s:String>+ <s:String x:Key="AboutOn">on</s:String>+ <s:String x:Key="AboutOff">off</s:String>+ <s:String x:Key="AboutOpenClDevices">OpenCL devices</s:String>+ <s:String x:Key="AboutOpenClMissing">OpenCL is not installed</s:String>+ <s:String x:Key="AboutH264Encoders">H.264 encoders</s:String>+ <s:String x:Key="AboutMediaFoundationMissing">Media Foundation is not available</s:String>+ <s:String x:Key="AboutNone">none</s:String>+ <s:String x:Key="AboutCopy">_Copy system info</s:String>+ <s:String x:Key="TipAboutCopy">Copy the system lines to the clipboard, for a bug report</s:String>+ <s:String x:Key="AboutCopied">System information copied to the clipboard</s:String>+ <s:String x:Key="AboutClose">Close</s:String><s:String x:Key="MenuProjectAddSource">Add _source</s:String><s:String x:Key="MenuProjectAddProbe">Add _probe</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.FR.xaml b/WaveDudeNext.WPF/Strings/Strings.FR.xamlindex 8d770c3..2cf29f5 100644--- a/WaveDudeNext.WPF/Strings/Strings.FR.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.FR.xaml@@ -76,6 +76,35 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Aide</s:String><s:String x:Key="MenuHelpAbout">À _propos de WaveDude Next</s:String>+ <!-- Help > About -->+ <s:String x:Key="AboutTitle">À propos de WaveDude Next</s:String>+ <s:String x:Key="AboutVersionFormat">Version {0}</s:String>+ <s:String x:Key="AboutTagline">Un simulateur d'ondes 2D</s:String>+ <s:String x:Key="AboutCredits">Fondé sur le travail de</s:String>+ <s:String x:Key="AboutLicense">Licence</s:String>+ <s:String x:Key="AboutLicenseNotice">WaveDude Next est un logiciel libre : vous pouvez le redistribuer et/ou le modifier selon les termes de la GNU General Public License telle que publiée par la Free Software Foundation, soit la version 3 de la licence, soit (à votre choix) toute version ultérieure. Il est distribué SANS AUCUNE GARANTIE.</s:String>+ <s:String x:Key="AboutShowLicense">Afficher le _texte de la licence</s:String>+ <s:String x:Key="AboutHideLicense">Masquer le _texte de la licence</s:String>+ <s:String x:Key="AboutSystem">Système</s:String>+ <s:String x:Key="AboutProductLine">Programme</s:String>+ <s:String x:Key="AboutRuntime">Environnement d'exécution</s:String>+ <s:String x:Key="AboutOperatingSystem">Système d'exploitation</s:String>+ <s:String x:Key="AboutProcessor">Processeur</s:String>+ <s:String x:Key="AboutCores">cœurs logiques</s:String>+ <s:String x:Key="AboutMemory">Mémoire</s:String>+ <s:String x:Key="AboutMemoryFree">libres sur</s:String>+ <s:String x:Key="AboutGpuSetting">Réglage GPU (OpenCL)</s:String>+ <s:String x:Key="AboutOn">activé</s:String>+ <s:String x:Key="AboutOff">désactivé</s:String>+ <s:String x:Key="AboutOpenClDevices">Périphériques OpenCL</s:String>+ <s:String x:Key="AboutOpenClMissing">OpenCL n'est pas installé</s:String>+ <s:String x:Key="AboutH264Encoders">Encodeurs H.264</s:String>+ <s:String x:Key="AboutMediaFoundationMissing">Media Foundation n'est pas disponible</s:String>+ <s:String x:Key="AboutNone">aucun</s:String>+ <s:String x:Key="AboutCopy">_Copier les infos système</s:String>+ <s:String x:Key="TipAboutCopy">Copier les lignes système dans le presse-papiers, pour un rapport de bogue</s:String>+ <s:String x:Key="AboutCopied">Informations système copiées dans le presse-papiers</s:String>+ <s:String x:Key="AboutClose">Fermer</s:String><s:String x:Key="MenuProjectAddSource">Ajouter une _source</s:String><s:String x:Key="MenuProjectAddProbe">Ajouter une s_onde</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.NL.xaml b/WaveDudeNext.WPF/Strings/Strings.NL.xamlindex dae681e..3fcf71e 100644--- a/WaveDudeNext.WPF/Strings/Strings.NL.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.NL.xaml@@ -76,6 +76,35 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Help</s:String><s:String x:Key="MenuHelpAbout">_Over WaveDude Next</s:String>+ <!-- Help > About -->+ <s:String x:Key="AboutTitle">Over WaveDude Next</s:String>+ <s:String x:Key="AboutVersionFormat">Versie {0}</s:String>+ <s:String x:Key="AboutTagline">Een 2D-golfsimulator</s:String>+ <s:String x:Key="AboutCredits">Gebaseerd op het werk van</s:String>+ <s:String x:Key="AboutLicense">Licentie</s:String>+ <s:String x:Key="AboutLicenseNotice">WaveDude Next is vrije software: u mag het herdistribueren en/of wijzigen onder de voorwaarden van de GNU General Public License zoals gepubliceerd door de Free Software Foundation, versie 3 van de licentie of (naar uw keuze) een latere versie. Het wordt verspreid ZONDER ENIGE GARANTIE.</s:String>+ <s:String x:Key="AboutShowLicense">Licentie_tekst tonen</s:String>+ <s:String x:Key="AboutHideLicense">Licentie_tekst verbergen</s:String>+ <s:String x:Key="AboutSystem">Systeem</s:String>+ <s:String x:Key="AboutProductLine">Programma</s:String>+ <s:String x:Key="AboutRuntime">Runtime</s:String>+ <s:String x:Key="AboutOperatingSystem">Besturingssysteem</s:String>+ <s:String x:Key="AboutProcessor">Processor</s:String>+ <s:String x:Key="AboutCores">logische kernen</s:String>+ <s:String x:Key="AboutMemory">Geheugen</s:String>+ <s:String x:Key="AboutMemoryFree">vrij van</s:String>+ <s:String x:Key="AboutGpuSetting">Instelling GPU (OpenCL)</s:String>+ <s:String x:Key="AboutOn">aan</s:String>+ <s:String x:Key="AboutOff">uit</s:String>+ <s:String x:Key="AboutOpenClDevices">OpenCL-apparaten</s:String>+ <s:String x:Key="AboutOpenClMissing">OpenCL is niet geïnstalleerd</s:String>+ <s:String x:Key="AboutH264Encoders">H.264-encoders</s:String>+ <s:String x:Key="AboutMediaFoundationMissing">Media Foundation is niet beschikbaar</s:String>+ <s:String x:Key="AboutNone">geen</s:String>+ <s:String x:Key="AboutCopy">Systeeminfo _kopiëren</s:String>+ <s:String x:Key="TipAboutCopy">De systeemregels naar het klembord kopiëren, voor een foutmelding</s:String>+ <s:String x:Key="AboutCopied">Systeeminformatie naar het klembord gekopieerd</s:String>+ <s:String x:Key="AboutClose">Sluiten</s:String><s:String x:Key="MenuProjectAddSource">_Bron toevoegen</s:String><s:String x:Key="MenuProjectAddProbe">_Sonde toevoegen</s:String>diff --git a/WaveDudeNext.WPF/Themes/Editors.xaml b/WaveDudeNext.WPF/Themes/Editors.xamlindex ab3870e..61853df 100644--- a/WaveDudeNext.WPF/Themes/Editors.xaml+++ b/WaveDudeNext.WPF/Themes/Editors.xaml@@ -380,6 +380,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<!-- property forms --><!-- a group header in the Properties pane: the name over a rule across the width, so the groups read apart(2026-10-15, after the Field and Intensity groups of the Display view were taken for one list) -->+ <!-- links (About): accent colour, underlined on hover and when focused by keyboard; the focus rectangle is WPF's own -->+ <Style TargetType="{x:Type Hyperlink}">+ <Setter Property="Foreground" Value="{DynamicResource Accent}" />+ <Setter Property="TextDecorations" Value="{x:Null}" />+ <Style.Triggers>+ <Trigger Property="IsMouseOver" Value="True">+ <Setter Property="TextDecorations" Value="Underline" />+ </Trigger>+ <Trigger Property="IsKeyboardFocused" Value="True">+ <Setter Property="TextDecorations" Value="Underline" />+ </Trigger>+ </Style.Triggers>+ </Style>+<Style x:Key="FormSection" TargetType="{x:Type Label}"><Setter Property="FontWeight" Value="SemiBold" /><Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />diff --git a/WaveDudeNext.WPF/WaveDudeNext.WPF.csproj b/WaveDudeNext.WPF/WaveDudeNext.WPF.csprojindex 2068051..bbb2bb6 100644--- a/WaveDudeNext.WPF/WaveDudeNext.WPF.csproj+++ b/WaveDudeNext.WPF/WaveDudeNext.WPF.csproj@@ -10,18 +10,22 @@<StartupObject>WaveDudeNext.WPF.Program</StartupObject><!-- executable icon (Explorer, taskbar); the window icon is the same file as a resource --><ApplicationIcon>App.ico</ApplicationIcon>- <!-- read by About and the file properties; the licence text is LICENSE.md, the header of every source file names it -->+ <!-- read by About and the file properties; the license text is LICENSE.md, the header of every source file names it --><Authors>Alexander Graef</Authors><Copyright>Copyright (C) 2026 Alexander Graef</Copyright><PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>- <!-- the .editorconfig code-style rules are build warnings too: a file without the licence header (IDE0073) -->+ <!-- the .editorconfig code-style rules are build warnings too: a file without the license header (IDE0073) --><EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild></PropertyGroup><ItemGroup><Resource Include="App.ico" />+ <Resource Include="App.png" /></ItemGroup>+ <!-- LICENSE.md becomes the embedded FlowDocument "License.xaml" that Help > About shows -->+ <Import Project="Build\LicenseDocument.targets" />+<ItemGroup><PackageReference Include="NLog" Version="6.2.1" /></ItemGroup>diff --git a/WaveDudeNext/WaveDudeNext.csproj b/WaveDudeNext/WaveDudeNext.csprojindex f661b82..c6fbab2 100644--- a/WaveDudeNext/WaveDudeNext.csproj+++ b/WaveDudeNext/WaveDudeNext.csproj@@ -11,11 +11,11 @@<Optimize>true</Optimize><!-- the MP4 writer copies a frame into a Media Foundation buffer through its raw pointer --><AllowUnsafeBlocks>true</AllowUnsafeBlocks>- <!-- read by About and the file properties; the licence text is LICENSE.md, the header of every source file names it -->+ <!-- read by About and the file properties; the license text is LICENSE.md, the header of every source file names it --><Authors>Alexander Graef</Authors><Copyright>Copyright (C) 2026 Alexander Graef</Copyright><PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>- <!-- the .editorconfig code-style rules are build warnings too: a file without the licence header (IDE0073) -->+ <!-- the .editorconfig code-style rules are build warnings too: a file without the license header (IDE0073) --><EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild></PropertyGroup>diff --git a/_tools/library_check/LibraryCheck.csproj b/_tools/library_check/LibraryCheck.csprojindex 5bf519b..945cb87 100644--- a/_tools/library_check/LibraryCheck.csproj+++ b/_tools/library_check/LibraryCheck.csproj@@ -10,7 +10,7 @@<ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><RootNamespace>LibraryCheck</RootNamespace>- <!-- the .editorconfig code-style rules are build warnings too: a file without the licence header (IDE0073) -->+ <!-- the .editorconfig code-style rules are build warnings too: a file without the license header (IDE0073) --><EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild></PropertyGroup>diff --git a/_tools/ui_check/AboutCheck.ps1 b/_tools/ui_check/AboutCheck.ps1new file mode 100644index 0000000..e2e20ab--- /dev/null+++ b/_tools/ui_check/AboutCheck.ps1@@ -0,0 +1,140 @@+# SPDX-License-Identifier: GPL-3.0-or-later+# Copyright (C) 2026 Alexander Graef <[email protected]>+#+# This file is part of WaveDude Next, a 2D wave simulator.+#+# Based on the work of+# JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026+# <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>+# Manuel (0x23, Diffraction Limited), author of WaveSimulator2D+# <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>+#+# WaveDude Next 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 3 of the License, or (at your option) any later+# version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or+# <https://www.gnu.org/licenses/>.++# Opens Help > About by keyboard (F10, Left to the Help header, Down, Enter) and checks the dialog (2026-10-15):+# it is a child of the main window in UI Automation, shows the version with the build's commit hash and the copyright+# line, names the two contributors with their links, puts the focus on Close, cycles with Tab through links, the+# license toggle, the document and the buttons, shows the license document on Space, carries the system report, gives+# the height of a resize (SetWindowPos) to the document, and closes on Esc. Keys are posted to the dialog's own window handle. See Common.ps1 for the rules (no mouse, no activation,+# no UIA patterns). Prints PASS/FAIL per check and exits with the failure count.+#+# powershell -ExecutionPolicy Bypass -File _tools\ui_check\AboutCheck.ps1 [-Exe <path>] [-Shot <png>] [-Trace]++param(+ [string]$Exe = (Join-Path $PSScriptRoot "..\..\WaveDudeNext.WPF\bin\Debug\net10.0-windows\WaveDudeNext.WPF.exe"),+ [string]$Shot = (Join-Path $env:TEMP "wavedude_about.png"), # the dialog with the license text shown, for the look+ [switch]$Trace+)++. (Join-Path $PSScriptRoot "Common.ps1")++# the About dialog: UI Automation lists an owned window under its owner, so it is a child of the main window+# (a popup menu, by contrast, is a top-level window of the process); $null while it is not open+function Dialog() {+ $c = New-Object System.Windows.Automation.PropertyCondition($A::AutomationIdProperty, "AboutWindow")+ $e = $script:win.FindFirst([System.Windows.Automation.TreeScope]::Children, $c)+ if ($e -ne $null) { return $e }+ $byProcess = New-Object System.Windows.Automation.PropertyCondition($A::ProcessIdProperty, $script:p.Id)+ foreach ($top in $A::RootElement.FindAll([System.Windows.Automation.TreeScope]::Children, $byProcess)) {+ if ($top.Current.AutomationId -eq "AboutWindow") { return $top }+ }+ return $null+}+function DFind([string]$id) {+ $c = New-Object System.Windows.Automation.PropertyCondition($A::AutomationIdProperty, $id)+ for ($i = 0; $i -lt 10; $i++) {+ $e = $script:dlg.FindFirst([System.Windows.Automation.TreeScope]::Descendants, $c)+ if ($e -ne $null) { return $e }+ Start-Sleep -Milliseconds 200+ }+ throw "element '$id' not found in the dialog"+}+function DHas([string]$id) { try { (DFind $id) -ne $null } catch { $false } }+function DFocusedId() {+ $focused = New-Object System.Windows.Automation.PropertyCondition($A::HasKeyboardFocusProperty, $true)+ $e = $script:dlg.FindFirst([System.Windows.Automation.TreeScope]::Descendants, $focused)+ if ($e -eq $null) { return "(none)" }+ return $e.Current.AutomationId+}+function DKey([int]$vk, [int]$settle = 80) { [Native]::Key($script:dlgHwnd, $vk); Start-Sleep -Milliseconds $settle }+function DValue([string]$id) { return (Pattern (DFind $id) "Value").Current.Value }+function DText([string]$id) { return (Pattern (DFind $id) "Text").DocumentRange.GetText(-1) }+function Step([string]$what, [int]$vk, [int]$settle) {+ Key $vk $settle+ if ($Trace) { " {0,-8} focus {1} foreground {2}" -f $what, (FocusedId), (Foreground) }+}++Start-App $Exe+try {+ FocusOn "PreviewPlay"+ Step "F10" 0x79 150 # the menu bar, File header+ Step "Left" $VK_LEFT 150 # wraps to the last header, Help+ Step "Down" 0x28 150 # opens Help on its first (only) entry+ Step "Enter" $VK_RETURN 400 # About+ $script:dlg = $null+ $null = WaitFor { $script:dlg = Dialog; $script:dlg -ne $null } 5000 100+ Check "Help > About by keyboard opens the dialog" ($script:dlg -ne $null)+ if ($script:dlg -eq $null) { throw "no dialog" }+ $script:dlgHwnd = [IntPtr]$script:dlg.Current.NativeWindowHandle+ Check "the dialog is titled" ($script:dlg.Current.Name -eq "About WaveDude Next") $script:dlg.Current.Name+ # a window Windows never activated has no focused element; a posted WM_SETFOCUS gives WPF its keyboard focus+ if ((DFocusedId) -eq "(none)") { [Native]::SetFocusMessage($script:dlgHwnd); Start-Sleep -Milliseconds 200 }++ # ------------------------------------------------------------ content+ $expectedHash = (& git -C (Join-Path $PSScriptRoot "..\..") rev-parse --short=7 HEAD).Trim()+ $version = (DFind "AboutVersion").Current.Name+ Check "the version line reads 'Version x.y.z (hash)' with the commit of the build" ($version -match "^Version \d+\.\d+\.\d+ \([0-9a-f]{7}\)$" -and $version -like "*($expectedHash)*") ("'{0}', HEAD {1}" -f $version, $expectedHash)+ Check "the product line" ((DFind "AboutProduct").Current.Name -eq "WaveDude Next") (DFind "AboutProduct").Current.Name+ Check "the copyright line" ((DFind "AboutCopyright").Current.Name -eq "Copyright (C) 2026 Alexander Graef") (DFind "AboutCopyright").Current.Name+ $vleggaar = (DFind "AboutCreditVleggaar").Current.Name+ $manuel = (DFind "AboutCreditManuel").Current.Name+ Check "the credits name Jeroen with his copyright and Manuel, as the source header does" (($vleggaar -like "JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026*") -and ($manuel -like "Manuel (0x23, Diffraction Limited), author of WaveSimulator2D*")) ("'{0}' / '{1}'" -f $vleggaar, $manuel)+ $links = @("AboutLinkHuygensYouTube", "AboutLinkHuygensSite", "AboutLinkDiffractionYouTube", "AboutLinkWaveSimulator2D", "AboutLinkGpl") | Where-Object { DHas $_ }+ Check "the five links exist" ($links.Count -eq 5) ("found " + $links.Count)+ $system = DValue "AboutSystemText"+ $lines = @($system -split "`r?`n")+ Check "the system report has its eight lines, naming the runtime and the OpenCL devices" ($lines.Count -eq 8 -and $system -like "*.NET*" -and $system -like "*OpenCL devices:*" -and $system -like "*H.264 encoders:*") ("{0} lines" -f $lines.Count)+ Check "the license text is hidden to begin with" (-not (DHas "AboutLicenseText"))++ # ------------------------------------------------------------ keyboard+ Check "the focus starts on Close" ((DFocusedId) -eq "AboutClose") (DFocusedId)+ $order = @()+ for ($i = 0; $i -lt 9; $i++) { DKey $VK_TAB 100; $order += (DFocusedId) }+ Check "Tab cycles links > license toggle > system text > Copy > Close" (($order -join ",") -eq "AboutLinkHuygensYouTube,AboutLinkHuygensSite,AboutLinkDiffractionYouTube,AboutLinkWaveSimulator2D,AboutLinkGpl,AboutLicenseToggle,AboutSystemText,AboutCopy,AboutClose") ($order -join ",")+ for ($i = 0; $i -lt 6; $i++) { DKey $VK_TAB 60 } # back to the license toggle+ Check "Tab reaches the license toggle" ((DFocusedId) -eq "AboutLicenseToggle") (DFocusedId)+ DKey $VK_SPACE 300+ $shown = DHas "AboutLicenseText"+ $license = if ($shown) { DText "AboutLicenseText" } else { "" }+ Check "Space shows the license as a document: the GPL from LICENSE.md, its Markdown gone" ($shown -and $license -like "*GNU GENERAL PUBLIC LICENSE*" -and $license -like "*Version 3, 29 June 2007*" -and $license -notlike "*`n#*" -and $license -notlike "*<https://fsf.org/>*") ("{0} characters" -f $license.Length)+ # resizable: 200 px more height go to the document, the buttons stay at the bottom+ # (the document viewer's own rectangle is its document's extent, so the elements below the box are measured)+ $system0 = (DFind "AboutSystemText").Current.BoundingRectangle+ $close0 = (DFind "AboutClose").Current.BoundingRectangle+ $w = [Native]::WindowWidth($script:dlgHwnd); $h = [Native]::WindowHeight($script:dlgHwnd)+ [Native]::Resize($script:dlgHwnd, $w, $h + 200); Start-Sleep -Milliseconds 400+ $h1 = [Native]::WindowHeight($script:dlgHwnd)+ $system1 = (DFind "AboutSystemText").Current.BoundingRectangle+ $close1 = (DFind "AboutClose").Current.BoundingRectangle+ Check "a taller window gives the height to the license document: the system block and Close move down with it" ($h1 -eq $h + 200 -and [math]::Abs($system1.Top - $system0.Top - 200) -lt 4 -and [math]::Abs($close1.Top - $close0.Top - 200) -lt 4) ("window {0} -> {1}, system top {2} -> {3}, Close top {4} -> {5}" -f $h, $h1, $system0.Top, $system1.Top, $close0.Top, $close1.Top)+ [Native]::Capture($script:dlgHwnd, $Shot)+ Write-Output "screenshot: $Shot"+ Write-Output ("system report:`n" + $system)+ [Native]::Resize($script:dlgHwnd, $w, $h); Start-Sleep -Milliseconds 300+ DKey $VK_SPACE 400+ Check "Space again hides it, and the window shrinks back to its content" ((-not (DHas "AboutLicenseText")) -and [Native]::WindowHeight($script:dlgHwnd) -lt $h) ("window {0}, was {1} with the document" -f [Native]::WindowHeight($script:dlgHwnd), $h)+ DKey $VK_ESCAPE 300+ $gone = WaitFor { (Dialog) -eq $null } 3000 100+ Check "Esc closes the dialog" $gone+ Check "the main window is still there" ($win.Current.Name -eq "WaveDude Next") $win.Current.Name+ Check "app never became the foreground window" ((Foreground) -ne "APP") (Foreground)+}+finally {+ Stop-App+}+Write-Output ("{0} failure(s)" -f $script:failures)+exit $script:failures