Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-08

Mac OS X : Drag n Drop within TListBox not working correctly..

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi all,
If I
1. create a new application
2. Drop a TListBox on the form
3. Set DragMode on the Listbox to dmAutomatic.
4. Hook up events for OnDragOver and OnDragDrop

The events in step 4 never fire.

On the other hand The StartDrag and EngDrag events fire regard less of if the Mode is dmAutomatic or not. It has been a while since I did any DnD in Delphi, but I thought that StartDrag and EngDrag only fire if the DragMode is dmManual. Also the StartDrag and EngDrag event fire on click. NOT on mousedown and not after the mouse has moved a little. They both seem to fire immediately on clicking on an item in the ListBox. Any way you cook it, it does not seem to be working correctly.

Anyone else seeing this? Should I Mantis it?

Dominique Louis.

Reply by email

Hans-Peter Diettrich
to Unknown author
Show quoted text 7 lines
If I 1. create a new application 2. Drop a TListBox on the form 3. Set DragMode on the Listbox to dmAutomatic. 4. Hook up events for OnDragOver and OnDragDrop The events in step 4 never fire.

TWinControls are rarely draggable, in detail wrappers around system controls (depending on the widgetset), and forms (depending on the window manager). Their handling of the mouse messages (currently) has precedence, so that the dragmanager can not always work.

Example: marking text with the mouse in an edit control cannot be distinguished from D&D.

On the other hand The StartDrag and EngDrag events fire regard less of if the Mode is dmAutomatic or not. It has been a while since I did any DnD in Delphi, but I thought that StartDrag and EngDrag only fire if the DragMode is dmManual.

That wouldn't make sense. Remember that dmManual requires that you call BeginDrag in code - in *this* case bypassing some messages might be acceptable. Perhaps you confuse that with ManualDrag?

Also the StartDrag and EngDrag event fire on click. NOT on mousedown and not after the mouse has moved a little. They both seem to fire immediately on clicking on an item in the ListBox.

That's a matter of DragImmediate, which by default is True. IMO a stupid Delphi compatible default :-(

Any way you cook it, it does not seem to be working correctly.

The Delphi dragging model is crap :-(

Borland could not make drag-dock work in CLX (Qt), even worse with other widgetsets. You can not expect that dragging will work on non-Win32 platforms.

Anyone else seeing this? Should I Mantis it?

It's not a bug that could be fixed. You can put an feature request for Lazarus specific dragging support, different from the Delphi model. AFAIK this topic will be addressed in one of the future Lazarus versions.

DoDi

Reply by email