Skip to content

Conversation

@CalDymos
Copy link
Contributor

@CalDymos CalDymos commented Feb 2, 2026

Summary

This PR adds support for explicit gadget IDs & explicit window IDs in the PureBasic Form Designer property field, using the syntax:

  • ID13310=13310 or Gadget1=1008 (variable=explicit numeric ID)

The generated code will keep the variable name as-is, while the enumeration constant gets the explicit assignment:

Enumeration FormGadget
  #ID13310=13310
EndEnumeration

Motivation

Some projects require stable, predefined numeric IDs (e.g. compatibility with existing code, external bindings etc.). Until now, the Form Designer only supported automatic IDs (#PB_Any) or non-explicit enumeration constants, making it hard to keep IDs deterministic across edits/saves.

Behavior / Rules

The property field variable may contain Name=Number to define an explicit mapping.
Code generation outputs #Name=Number in Enumeration FormGadget / FormWindow.
Gadget/window creation uses #Name or Name for Procedure Open...
Backward compatible / non-breaking: If a property value contains no =, the Form Designer behaves exactly as before (same parsing, same code generation).

…citId

- Add explicitId to FormGadgets/FormWindow structure (declare.pb)
- Parse "#NAME=NNN" gadget/window IDs on load and map FormGadget/FormWindow enumeration values (opensave.pb)
- Generate fixed enum assignments while keeping gadget/window calls as "#NAME" (codeviewer.pb)
- Preserve and edit "NAME=NNN" in property grid; split/commit into variable + explicitId (mainevents.pb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant