Skip to content

Use cafPdmUiButton instead of bool in PdmField#13670

Merged
magnesj merged 2 commits intodevfrom
pdm-pushbutton-to-dynamic-button
Mar 3, 2026
Merged

Use cafPdmUiButton instead of bool in PdmField#13670
magnesj merged 2 commits intodevfrom
pdm-pushbutton-to-dynamic-button

Conversation

@magnesj
Copy link
Copy Markdown
Member

@magnesj magnesj commented Mar 1, 2026

  • Extract multi-line/control-flow lambdas to named on*Clicked() methods
    in RimFlowCharacteristicsPlot, RimGeoMechCase, RimStatisticsContourMap
  • Fix build errors: remove dead defineEditorAttribute override in
    RimGeoMechCase, add missing cafPdmUiButton.h include, fix tooltip API
    usage in RimStatisticsContourMap
  • Update RimWellPathFracture to use base-class-provided create buttons
  • Add lambda line-count guideline to docs/agents/coding-style.md

Refactors PDM push buttons from boolean fields to use the `addNewButton` API with direct lambda callbacks.

This change enforces a new coding guideline to extract complex or multi-line lambdas to dedicated `on*Clicked()` methods, improving code readability and maintainability.

- Replaces `PdmField` button fields with `PdmUiOrdering::addNewButton` calls.
- Extracts multi-line/control-flow lambdas into named methods in `RimFlowCharacteristicsPlot`, `RimGeoMechCase`, and `RimStatisticsContourMap`.
- Removes obsolete `defineEditorAttribute` overrides and `fieldChangedByUi` logic for these buttons.
- Updates `RimWellPathFracture` to utilize base class-provided button creation.
- Adds new lambda line-count guideline to the coding style documentation.
- Includes minor build fixes, such as adding `cafPdmUiButton.h` and correcting tooltip API usage.
@magnesj magnesj force-pushed the pdm-pushbutton-to-dynamic-button branch from 3df22f2 to a6d5c76 Compare March 2, 2026 10:36
@magnesj magnesj requested a review from kriben March 2, 2026 10:36
@magnesj magnesj merged commit 61a69ba into dev Mar 3, 2026
17 checks passed
@magnesj magnesj deleted the pdm-pushbutton-to-dynamic-button branch March 3, 2026 07:54
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.

2 participants