Skip to content

Modernize and harden Delphi VCL Inspector — DPI, painting, lifecycle, docs, example - #3

Open
erdesigns-eu wants to merge 8 commits into
mainfrom
modernize-and-audit-delphi-inspector-component
Open

Modernize and harden Delphi VCL Inspector — DPI, painting, lifecycle, docs, example#3
erdesigns-eu wants to merge 8 commits into
mainfrom
modernize-and-audit-delphi-inspector-component

Conversation

@erdesigns-eu

Copy link
Copy Markdown
Owner

Motivation

  • Bring the inspector unit up to modern Delphi expectations while preserving its lightweight VCL nature, public API intent, Variant-based values, and VCL Styles support.
  • Fix correctness and robustness issues around collection copying, editor lifecycle, focus/keyboard handling, painting, and edge-case geometry.
  • Improve DPI/per-monitor behavior so the control preserves the 96‑DPI defaults while scaling correctly under higher DPIs.
  • Provide XML IntelliSense documentation for public classes, events and properties and add a minimal example and repo hygiene files to aid adoption.

Description

  • Added XML IntelliSense comments to public classes, collections, option classes, events and key properties/methods and preserved existing public API names and semantics.
  • Hardened collection and Assign implementations with self-assignment guards, proper deep-copy semantics, and consistent OnChange notifications, and fixed several Assign code paths to call inherited where appropriate.
  • Improved editor and selection lifecycle by adding DeactivateEditor, safe IsItemOwned checks, making Enter/Escape behavior explicit for the inline editor, deactivating editors when items are removed or control is disabled, and making property value writes safe using VarSameValue and DisplayText conversion for Null/Empty variants.
  • Made painting, layout and editor/button geometry DPI-aware using a Scale helper based on CurrentPPI, guarded bitmap/set-size calls with Max(1, ...) to avoid invalid dimensions, respected disabled text colors, and fixed gutter/splitter hit testing and splitter drag math for scaled coordinates.
  • Reduced unnecessary redraws by respecting BeginUpdate/EndUpdate, avoiding updates while deferred, and removing redundant double scroll updates; also improved scroll range clamping with Max(0, ...).
  • Added a small code-only example (examples/InspectorDemo) demonstrating categories, collapsed category, editable and edit-button properties, event handlers and a style selector; added a succinct professional README.md and a Delphi .gitignore.

Testing

  • Static repository assertions and heuristics were run successfully, including presence of System.Variants usage, XML comment patterns, and scaled geometry tokens (Scale(PropertyOptions.Height)) in Inspector.pas.
  • Repository validation checks passed: git -c core.whitespace=cr-at-eol diff --check, git check-ignore for example artifacts, and automated whitespace/line ending checks; these succeeded in this environment.
  • Build/runtime validation using the Delphi compiler (dcc32) was not available in the environment and therefore was not executed; manual Delphi compile-and-test is required on Windows to validate VCL Styles rendering, runtime DPI/per-monitor behavior, and editor interactions.
  • A commit containing the changes was produced; automated checks performed here succeeded, while platform-specific runtime tests remain manual.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant