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

Drag and drop misses some comments and tests #386

Open
tinchodias opened this issue Jan 13, 2024 · 7 comments
Open

Drag and drop misses some comments and tests #386

tinchodias opened this issue Jan 13, 2024 · 7 comments

Comments

@tinchodias
Copy link
Collaborator

@Enzo-Demeulenaere asked about this topic in the mailing list, and I realized this is missing: We should write class comments in the hierarchy of drag and drop events.

The BlMouseProcessor>>#handleMouseMove: method is who takes into account whether the drag start was consumed and acts in consequence.

A simple example the shows a key sentence to handle drag and drop:

space := BlSpace new.
element :=
	BlElement new
		background: Color purple;
		yourself.
space root addChild: element.
space show.

element addEventHandler: (BlEventHandler
	on: BlDragStartEvent
	do: [ :evt |
		evt traceCr.
		evt consumed: true " <--- THIS IS KEY " ]).
element addEventHandler: (BlEventHandler
	on: BlDragEvent
	do: [ :evt | evt traceCr ]).
element addEventHandler: (BlEventHandler
	on: BlDragEndEvent
	do: [ :evt | evt traceCr ])
@tinchodias
Copy link
Collaborator Author

An example that uses drag&drop is: BlFlowLayoutCompositionSmokeTest floatingCells

Double click on a rectangle inserts a BlElementSelection, which is a class in the package 'Bloc-DevTool' that allows move and resize.

@Ducasse
Copy link
Contributor

Ducasse commented Jan 13, 2024

BTW we should check the status of Bloc-DevTool because may we should add some elements to Bloc by default.

@Ducasse
Copy link
Contributor

Ducasse commented Jan 13, 2024

Thinking about the example I asked myself

  • what is the difference between BlDragEvent and BlBaseEvent
  • why this is the responsibility of the user to mark the event as consumed. May be in case of reject of drag?
  • why we do not have to mark the BlDragEvent as consumed then.

S

@tinchodias
Copy link
Collaborator Author

tinchodias commented Jan 15, 2024 via email

@tinchodias
Copy link
Collaborator Author

An example that uses drag&drop is: BlFlowLayoutCompositionSmokeTest floatingCells

Double click on a rectangle inserts a BlElementSelection, which is a class in the package 'Bloc-DevTool' that allows move and resize.

I should have sent a capture of the example:

Screen.Recording.2024-01-16.at.12.43.55.mov

@Ducasse
Copy link
Contributor

Ducasse commented Jan 17, 2024

It would be nice to check the halos developed by alain and decide which ones we keep but use them :)

@tinchodias
Copy link
Collaborator Author

Drag and Drop is being discussed in #649

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

No branches or pull requests

2 participants