Repository navigation
Add context menu command to convert standard buttons to wxStdDialogButtonSizer - #1889
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Navigation panel context-menu command that converts
wxButtonnodes using a standard dialog-button id into awxStdDialogButtonSizer.Closes #527.
Behaviour
wxStdDialogButtonSizeris 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".wxEVT_BUTTONhandlers and the default-button setting are transferred to the sizer.wxID_OK,wxID_YES,wxID_SAVE,wxID_APPLY,wxID_NO,wxID_CANCEL,wxID_CLOSE,wxID_HELP,wxID_CONTEXT_HELP.