Skip to content

Take the WinForms shell from PlatformHeads.WindowsForms - #966

Merged
SimonCropp merged 1 commit into
mainfrom
platformheads-forms
Oct 22, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
platformheads-forms

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

ViewerForm and BuildMonitor's MonitorForm each did what a form pumped by the app's own loop has to, and each had fixes the other lacked. PlatformHeads 0.3.0 has one copy, HeadForm in PlatformHeads.WindowsForms, made from both, which BuildMonitor took in SimonCropp/BuildMonitor#61. This is layer 3, after the kernel in #959.

What changes

  • ViewerForm derives from HeadForm. Its placement and its rules, the first size scaled to the display, closing as a request, Raise, Parked and the modal frame timer go to the base, about 340 lines. Frame keeps its name and hands the base its ModalFrame; the scroll bar still enters and leaves the modal loop itself. The tests that held those rules call WindowFit.
  • FormsViewerWindow copies through FormsClipboard, and ViewerApp hands its setup to FormsApp.
  • The five pins name 0.3.0. The package pins already did; the workflow's uses: and the CMake module's GIT_TAG were still at 0.2.0.

The loop idles

FormsViewerWindow waited a fixed frame after every present, so a viewer left open woke sixty times a second with nothing to do, and ten times hidden or minimised. It now implements Wait with HeadForm.WaitForFrame, which idles on the message queue and the loop's wake together, and ViewerProgram calls it after each present with a LoopWake:

  • Every change of state sets the wake, and so does every window command, which changes none: MessageHandler's directly, OwnerLink's through the new Commanded. So an arrival, or a focus from the tray, is drawn at once.
  • The idle is a frame at most while a spinner is up, since it turns only as the canvas repaints, and while a copy waits to be offered the clipboard again.
  • The native heads wait inside their present and answer Wait at once, so they pace themselves as before.

FrameWaitTests goes with the wait it tested.

Checked

  • Release suite: 3,746 tests, 41 skipped, none failed once the three package snapshots were accepted.
  • The WinForms head's 189 tests, run in Debug, the scroll bar's modal frame tests among them. Their reflection helper now looks in base classes, since the timer is HeadForm's.
  • Packaging.Tests 20/20. The one change on record is PlatformHeads.WindowsForms.dll beside each Windows head: two in the bundle, two in the tray, one in the Windows tool package.

The idling has not been tried by hand, only by the tests.

ViewerForm and BuildMonitor's MonitorForm each did what a form pumped by
the app's own loop has to, and each had fixes the other lacked.
PlatformHeads 0.3.0 has one copy, HeadForm, made from both, which
BuildMonitor took in SimonCropp/BuildMonitor#61, and this takes it:

- ViewerForm derives from HeadForm. Its placement and its rules, the
  first size scaled to the display, closing as a request, Raise, Parked
  and the modal frame timer go to the base. Frame keeps its name and
  hands the base its ModalFrame; the scroll bar still enters and leaves
  the modal loop itself. The tests that held those rules call WindowFit.
- FormsViewerWindow copies through FormsClipboard, and ViewerApp hands
  its setup to FormsApp.

And the loop idles. FormsViewerWindow waited a fixed frame after every
present, so a viewer left open woke sixty times a second with nothing to
do, and ten hidden or minimised. It now implements Wait with HeadForm's
WaitForFrame, which idles on the message queue and the loop's wake
together, and ViewerProgram calls it after each present with a
LoopWake. Every change of state sets the wake, and so does every window
command, which changes none: MessageHandler's directly, OwnerLink's
through Commanded. The idle is a frame at most while a spinner is up,
since it turns only as the canvas repaints, and while a copy waits to be
offered the clipboard again. The native heads wait inside their present
and answer Wait at once, so they pace themselves as before.

The five pins name 0.3.0. The package pins already did; the workflow's
and the CMake module's were still at 0.2.0.

The packages carry PlatformHeads.WindowsForms.dll beside each Windows
head, the one change to the entries Packaging.Tests has on record.
@SimonCropp
SimonCropp merged commit 44f3323 into main Oct 22, 2026
20 checks passed
@SimonCropp
SimonCropp deleted the platformheads-forms branch October 22, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant