-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controls: refactor interactivity management system #4053
Merged
Conversation
This file contains 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
to facilitate experimentation related to alternate control interaction systems #3186
Previously it was confusing because panning by a mouse delta pixels needs to be done by panning the axis limits that number of pixels in the OPPOSITE direction
Create a new static class to wrap shared logic between old and new interaction controllers
I'm getting close to merging this. The new behavior is demonstrated in the "custom mouse behavior" demo app. The code shows the general style of how the new API can be used. ScottPlot/src/ScottPlot5/ScottPlot5 Demos/ScottPlot5 WinForms Demo/Demos/CustomMouseActions.cs Lines 11 to 88 in 1bd1400
|
Merged
swharden
added a commit
to ByteSore/ScottPlot
that referenced
this pull request
Jul 21, 2024
required by all plot controls after ScottPlot#4053
This was referenced Jul 21, 2024
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.
This PR explores alternative strategies for customizing user interactivity in graphical environments.
Primary Goals
Architecture
User inputs are structs that inherit
IUserInput
and contain any properties that may be unique to that type of input (e.g.,LeftMouseDown
has a stores aPixel
andDateTime
)User input actions are classes that contain logic for when and how to respond to user inputs, including whether to refresh the plot or stop processing further actions (e.g.,
LeftClickDragPan
engages only afterLeftMouseDown
happens andMouseMove
moved by more than 5 pixels, preventing other actions from being processed untilLeftMouseUp
occurs)Plot controls have a
UserInputProcessor
that they pass user inputs into, and it holds a collection of user input actions that decide if and how to respond to the events. Users can remove actions (like double-click benchmark), add custom actions (like holding theA
key while left-click-dragging will only pan diagonally), and even pass custom input types through (like three-finger-drag).Rules to Implement
Items are checked only when implemented and unit tests are in place
IPlotControl
that can simulate user inputs for testingMultiAxisLimits
to replaceMultiAxisLimitManager