View Issue Details

IDProjectCategoryView StatusLast Update
0036685LazarusLCLpublic2020-02-26 19:33
ReportererrnoAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSwindowsOS Version10
Product Version2.1 (SVN)Product Build62621 
Target VersionFixed in Version 
Summary0036685: Drag and drop wrong behaviour .
DescriptionDrag and drop :
The components derived from TCustomAbstractGroupedEdit accept by default every components draged over
them , even if a OnDragOver event handler is not defined . Wich is anoying .
this concerns at least TDirectoryEdit , TFileNameEdit , TTimeEdit , TCalcEdit .
Steps To Reproduce-Activate the drag and drop for a component Tbutton
-drag this component over a TDirectoryEdit for example .
Additional InformationPatch added .
TagsNo tags attached.
Fixed in Revisionr62630
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • dragover.patch (640 bytes)
    Index: lcl/groupededit.pp
    ===================================================================
    --- lcl/groupededit.pp	(r�vision 62621)
    +++ lcl/groupededit.pp	(copie de travail)
    @@ -950,7 +950,12 @@
     procedure TCustomAbstractGroupedEdit.EditDragOver(Source: TObject; X, Y: Integer;
       State: TDragState; var Accept: Boolean);
     begin
    -  if Assigned(FOnEditDragOver) then FOnEditDragOver(Self, Source, X, Y, State, Accept);
    +  Accept:=false;
    +  if Assigned(FOnEditDragOver) then
    +    begin
    +    Accept:=true;
    +    FOnEditDragOver(Self, Source, X, Y, State, Accept);
    +    end;
     end;
     
     procedure TCustomAbstractGroupedEdit.EditEditingDone;
    
    dragover.patch (640 bytes)
  • DirectEditdragover.zip (109,814 bytes)

Activities

errno

2020-02-09 04:07

reporter  

dragover.patch (640 bytes)
Index: lcl/groupededit.pp
===================================================================
--- lcl/groupededit.pp	(r�vision 62621)
+++ lcl/groupededit.pp	(copie de travail)
@@ -950,7 +950,12 @@
 procedure TCustomAbstractGroupedEdit.EditDragOver(Source: TObject; X, Y: Integer;
   State: TDragState; var Accept: Boolean);
 begin
-  if Assigned(FOnEditDragOver) then FOnEditDragOver(Self, Source, X, Y, State, Accept);
+  Accept:=false;
+  if Assigned(FOnEditDragOver) then
+    begin
+    Accept:=true;
+    FOnEditDragOver(Self, Source, X, Y, State, Accept);
+    end;
 end;
 
 procedure TCustomAbstractGroupedEdit.EditEditingDone;
dragover.patch (640 bytes)

errno

2020-02-14 02:04

reporter   ~0121091

Added sample project , if you want test .You can drag button1.

DirectEditdragover.zip (109,814 bytes)

Juha Manninen

2020-02-14 10:39

developer   ~0121094

Applied. Thanks.
I also optimized/simplified a little.

BTW, the demo app did not compile on Linux. Unit name did not match file name in a case sensitive file system.

Issue History

Date Modified Username Field Change
2020-02-09 04:07 errno New Issue
2020-02-09 04:07 errno File Added: dragover.patch
2020-02-14 02:04 errno File Added: DirectEditdragover.zip
2020-02-14 02:04 errno Note Added: 0121091
2020-02-14 10:36 Juha Manninen Assigned To => Juha Manninen
2020-02-14 10:36 Juha Manninen Status new => assigned
2020-02-14 10:39 Juha Manninen Status assigned => resolved
2020-02-14 10:39 Juha Manninen Resolution open => fixed
2020-02-14 10:39 Juha Manninen Fixed in Revision => r62630
2020-02-14 10:39 Juha Manninen LazTarget => -
2020-02-14 10:39 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-02-14 10:39 Juha Manninen Note Added: 0121094
2020-02-26 19:33 errno Status resolved => closed