{{ message }}
Export selection and slight update to right-click operation#1226
Open
dustinhartlyn wants to merge 16 commits into
Open
Export selection and slight update to right-click operation#1226dustinhartlyn wants to merge 16 commits into
dustinhartlyn wants to merge 16 commits into
Conversation
On windows 10 the open/save dialogue box has an minor error, and I believe I fixed it. When "Open" is selected from the menu, the title of the dialogue box says "SolveSpace - Save File" and the entered file name is "united". My fix correctly titles the dialoged box, and leaves the address bar blank when a file is being opened because "united" is only needed as a default name when a file being saved. I found that class FileDialogImplWin32 from guiwin.cpp contains two if statements for "isSaveDialog". This is redundant. I removed the first where the title was originally set, but not working. I then set the title in the second if statement and moved the 'if isEmpty'' to this section.
replaced tabs with spaces
…mouse position directly. Simplified MouseScroll in mouse.cpp to point to this function instead of altering zoom directly. Also pointed zoom commpand from keyboard and menu to ZoomToMouse so that it works avoids different behavior.
Created ZoomToMouse function in graphicswin.cpp which referances the …
Adition: Menu option (linked to spacebar) which alternates between last selected tool and mouse.
…curve in the process of being placed. It will also reselect the latest tool, but unselect the tool if no cure is in the process of being drawn. Acomplished by using UndoUndo function which undoes the action registered after the operation is canceled, but does not add it to the redo stack so that Redo will not add the curve that was removed by the cancel operation. CancelPending is the main function added to facilitate any trigure that cancels the current action in process. UndoUndo was altered to not store the undone action if false is passed in as an aurgument. AlternateTool was also updated to work more efficently with CancelPending. Last a specific command was added to the MenuEdit function for the escape key.
Integrate continual use of tools until unselect, and cancel drawing action without placing it First I found it annoying to click on the same tool each time I wanted to draw a shape. My alteration reselects the tool after it is used. For example this allows the user to draw rectangles continuously after only selecting the tool once. Second I find it really useful to switch between the mouse and the most recently selected tool with a hotkey. Esc still clears the selected tool, and hotkeys switch between tools as expected. ClearPending() is used to process through tools - such as drawing the first point of a rectangle, and then placing the second point. I altered the function to store the original tool command and reactivate it when the ClearPending has reached the end of its command chain. Since all the tools funnel through this function, the one change works for all without any additional change. However I realized that it might not always be desired to reactivate a tool, so I altered the Toolbar[] array which stores all the tools. I added the 'keep_active' bool which allows authors to specify which tools should be reactivated (1) and which should be unselected after a single use (0). To accomplish the flip-flop between the last selected tool and the mouse I added the AlternateTool() which is called by the Command::ALTERNATE_TOOL case. Canceling a pending action will undo it and not add to redo memory
Member
Contributor
Author
|
I believe you have already accepted the pull request for the window fix and the fix for the zoom. I am still new to Git so I am sorry if my pull request was messy. The referenced pull request contains the cancel-operation behavior and to switch to tools being used until canceled. I can look into separating the cancel behavior out but right now I am getting into the task of adding line offsets / contours so it might not be immediate. |
Member
93215ea to
bc2bca8
Compare
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.

I have continued to update my fork. As noted in pull request #1224, tools stay active until canceled. A cancel operation (escape, spacebar or right-click) Will first cancel any current drawing action, if none it will unselect the selected tool. This update allows right click to unselect a tool before brining up right-click menu.
The second addition is an option to export only the currently selected lines (File->Export 2d Selection). I find this valuable because I often want to export only a portion of my design to a dxf. I know its possible to move those lines to a specific layer(s), but I think it tedious to move lines from group to group depending on what I am exporting. I find the flow much better when I can simply select what I want and export it regardless of groups.
As before, I offer these alterations only because I appreciate what others have done for this repository. Not offended if they are rejected because I intend to keep developing my fork in the ways I think best.