Skip to content

Add context menu command to convert standard buttons to wxStdDialogButtonSizer - #1889

Merged
Randalphwa merged 1 commit into
mainfrom
issue-527-std-button-sizer
Oct 8, 2026
Merged

Randalphwa merged 1 commit into
mainfrom
issue-527-std-button-sizer

Conversation

@Randalphwa

@Randalphwa Randalphwa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a Navigation panel context-menu command that converts wxButton nodes using a standard dialog-button id into a wxStdDialogButtonSizer.

Closes #527.

Behaviour

  • No sizer yet — converts all matching sibling buttons at once. The new wxStdDialogButtonSizer is appended to the end of the form's sizer so it appears at the bottom of the form (not inserted in place). The menu reads "Convert all standard buttons to wxStdDialogButtonSizer" when more than one standard sibling exists, otherwise "Convert to wxStdDialogButtonSizer".
  • Sizer already exists — the command is hidden when the clicked button's type is already present; otherwise it reads "Add to wxStdDialogButtonSizer" and moves just that button into the existing sizer.
  • Per-button wxEVT_BUTTON handlers and the default-button setting are transferred to the sizer.
  • Supported ids: wxID_OK, wxID_YES, wxID_SAVE, wxID_APPLY, wxID_NO, wxID_CANCEL, wxID_CLOSE, wxID_HELP, wxID_CONTEXT_HELP.
  • Duplicate detection uses the sizer's mutually-exclusive groups (OK/Yes/Save, Cancel/Close, Help/ContextHelp) rather than literal same-id, since the generator emits only the first of each group.

…ttonSizer

Adds a Navigation panel context-menu command that converts wxButton nodes
using a standard dialog-button id (wxID_OK, wxID_YES, wxID_SAVE, wxID_APPLY,
wxID_NO, wxID_CANCEL, wxID_CLOSE, wxID_HELP, wxID_CONTEXT_HELP) into a
wxStdDialogButtonSizer.

- No sizer yet: converts all matching sibling buttons and appends the new
  sizer to the end of the form's sizer so it appears at the bottom.
- Sizer already exists: adds a single button to it; the command is hidden
  when the button's type is already present.
- Transfers per-button click handlers and the default-button setting.
- Duplicate detection uses the mutually-exclusive groups (OK/Yes/Save,
  Cancel/Close, Help/ContextHelp) since the sizer can hold only one each.
- Moves selection to a node that survives the command and suppresses
  sub-action select events so undo does not re-select a removed node
  (fixes an Undo crash).

Also includes code-review cleanups to the same files: remove dead
m_child/m_tool_name/m_isPasteAllowed state, fix CreateSizerParent's form
walk, and correct include comments.

Closes #527
@Randalphwa
Randalphwa marked this pull request as ready for review October 8, 2026 03:25
@Randalphwa
Randalphwa merged commit b3d4f83 into main Oct 8, 2026
7 checks passed
@Randalphwa
Randalphwa deleted the issue-527-std-button-sizer branch October 8, 2026 03:25
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.

If button has a standard id, context menu should have option to convert to wxStdDialogButtonSizer

1 participant