Commit Graph

1 Commits

Author SHA1 Message Date
cproudlock
1d044cbbdf PrinterInstallerMap: add map wizard page (TBitmapImage hotspots)
Implements the click-to-select site map UI on a custom Inno wizard page,
replacing the blocked Edge .bat-download flow.

- New record fields MapLeft, MapTop on PrinterDataArray; QueryPrinters
  pulls them from the api_printers.asp JSON via the existing
  JsonGetString helper.
- BuildMapPage creates a custom wizard page (CreateCustomPage), places a
  stretched background TBitmapImage with the bundled site map BMP, then
  overlays one TBitmapImage per printer with a non-empty mapleft+maptop.
  Each hotspot is a 14x14 square with its own OnClick.
- MapHotspotClick toggles PrinterSelectionPage.Values[I] for the linked
  printer and swaps the hotspot bitmap (gray<->lime) to reflect the new
  state. Two shared TBitmaps are pre-rendered once via TCanvas.
- PrinterSelectionPage is re-anchored to PrinterMapPage.ID so the
  selections from the map flow into the existing checkbox page where the
  user can review and adjust.
- ShouldSkipPage skips the map page when no printers have map coords,
  preserving legacy behaviour if api_printers.asp is not yet extended or
  if the database has no coordinates set.
- Bundled sitemap2025-dark.bmp (880x680, ~1.7 MB) was scaled down from
  shopdb's sitemap2025-dark.png via PIL (Inno's TBitmap.LoadFromFile is
  BMP-only).

Untested. Needs Inno Setup 6.x compile on Windows + the api_printers.asp
extension to return mapleft, maptop. README documents the privileges
model (admin required, supportuser at UAC) and the Inno class-subset
gotchas verified during design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 07:43:54 -04:00