Skip to content
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

Refactor MouseEvent and MouseEventEventArgs to simplify #3029

Closed
5 of 12 tasks
tig opened this issue Dec 4, 2023 · 2 comments · Fixed by #3797
Closed
5 of 12 tasks

Refactor MouseEvent and MouseEventEventArgs to simplify #3029

tig opened this issue Dec 4, 2023 · 2 comments · Fixed by #3797
Assignees
Labels
v2 For discussions, issues, etc... relavant for v2
Milestone

Comments

@tig
Copy link
Collaborator

tig commented Dec 4, 2023

Similar in spirit, but somewhat less scope, than #2927

  • New/OnMouseEvent now uses just MouseEvent.
  • New/OnMouseClicked now uses just MouseEvent.
  • Better document/rename OfX/OfY
  • Move mouse stuff out of Responder and into View so Responder can be nuked
  • Add a docs/mouse.md
  • Beef-up/refactor mouse unit tests
  • Build MouseBindings per #Command is too tightly coupled with KeyBindings #3778
  • Merge MouseEvent and MouseEventEventArgs into a single class.
  • Engineer something that removes the need for Responder.IsOverridden which breaks all rules of OO design.
  • Ensure all library code uses consistent naming/usage
  • Ensure all Scenario code uses best practices related to new design.
  • Ensure all API documentation is awesome
@tig tig added the v2 For discussions, issues, etc... relavant for v2 label Dec 4, 2023
tig added a commit to tig/Terminal.Gui that referenced this issue Apr 4, 2024
- Started MouseEventEventArgs -> MouseEvent transition - for OnMouseEvent. Partially fixes gui-cs#3029.
- Refactored Appliation.OnMouseEvent and View.OnMouseEvent to match design guidelines.
- Re-impleented highlight, enabling extensibility (see Border).
- Beefed up unit tests
@tig
Copy link
Collaborator Author

tig commented Apr 4, 2024

Partially fixed in #3372.

@dodexahedron
Copy link
Collaborator

dodexahedron commented May 8, 2024

BTW:

For adherence to the dotnet design guidelines for events, all EventArgs classes should end in "EventArgs" and should not be mixed use classes outside of events themselves (Key, for example, is used both ways - I have a stashed change somewhere that's probably way obsolete by now that fixed that).

Inheriting from EventArgs also used to be recommended, but is now just a soft suggestion.

Here's one of the best of the various documents about guidelines for events:

https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-publish-events-that-conform-to-net-framework-guidelines

@tig tig moved this to 📋 v2 BETA Backlog in Terminal.Gui V2 Beta May 12, 2024
@tig tig added this to the V2 Beta milestone May 25, 2024
@tig tig moved this to 📋 Approved - Need Owner in Terminal.Gui V2 Initial Release Jul 11, 2024
@tig tig mentioned this issue Sep 22, 2024
37 tasks
@tig tig self-assigned this Oct 7, 2024
@tig tig closed this as completed in #3797 Oct 15, 2024
tig added a commit that referenced this issue Oct 15, 2024
Fixes #3029 - Refactors `MouseEvent` and APIs to simplify and make consistent
@github-project-automation github-project-automation bot moved this from 📋 Approved - Need Owner to ✅ Done in Terminal.Gui V2 Initial Release Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 For discussions, issues, etc... relavant for v2
Projects
Status: ✅ Done
Status: 📋 Approved - Need Owner
Development

Successfully merging a pull request may close this issue.

2 participants