Alexey-T / ATFlatControls

Controls for Delphi/Lazarus, used in CudaText: ATTabs, ATButton, ATListbox, ATScrollbar, ATStatusbar, ATGroups, ATGauge
Other
101 stars 29 forks source link

Drag/drop from other controls not working #74

Closed petko closed 3 years ago

petko commented 3 years ago

I've just discovered an issue. It is no longer possible to drag items from other controls to the ATTabs control. We use that to allow users to automatically switch between tabs when dragging other items from our UI.

I think that the dragging is disabled here (my tests show that it works in 2021.03.05, but not since 2021.04.01): https://github.com/Alexey-T/ATFlatControls/commit/b3ebae4774b2604c720a35964236bbc12214c39e

Is is possible to enabled it again?

Alexey-T commented 3 years ago

Added new prop (turn it to True), see the patch linked above. OK?

petko commented 3 years ago

It works with this new property. However in https://github.com/Alexey-T/ATFlatControls/commit/b3ebae4774b2604c720a35964236bbc12214c39e you state that it fixes something. What does it fix and should I be aware of it when using this new property?

petko commented 3 years ago

Sorry, I was too quick to tell that is was fixed. While the cursor shows that you can drag now, the OnDrag event of the tabs control is still not fired..

Alexey-T commented 3 years ago

However in b3ebae4 you state that it fixes something. What does it fix and

some internal behaviour of CudaText.

should I be aware of it when using this new property?

no.

the OnDrag event of the tabs control is still not fired..

are you sure??? I checked in debugger, - with demo_groups demo (it was updated minute ago). when I drop TTreeNode on tabs, the IDE debugger shows that this block works

procedure TATTabs.DragDrop(Source: TObject; X, Y: integer);
begin
  if not (Source is TATTabs) then
  begin
    inherited;
    exit;
  end;

this block calls inherited! it calls TControl.OnDragDrop

petko commented 3 years ago

I am talking about OnDragOver event that is not working. OnDragDrop works.

Alexey-T commented 3 years ago

Now I fixed this too, pls check.

petko commented 3 years ago

I can confirm that both work now. Thank you very much!