Recent

Author Topic: Lazarus Release 2.0.10  (Read 14704 times)

Birger52

  • Full Member
  • ***
  • Posts: 222
Re: Lazarus Release 2.0.10
« Reply #60 on: July 23, 2020, 07:32:52 pm »
DragDrop issue.
Had a project in 2.0.8 with Drag/Drop operations, that ended up functioning great.
Now With 2.0.10 I need to do something similar (with the same user created controls) - and it doesn't function at all.
So fetched my old project recompiled - and it doesn't function any longer, either.

Seems the call to BeginDrag, that should Initiate the dragging with either the dragged control or a TDragObject actually uses the Form as a drag object.
The Source parameter of DragOver (and probably DragDrop) events, is the form.
Can't test Drop, as a drop will never be accepted, when the Source is the form.

Lazarus 2.0.10 FPC 3.2.0
Win7 64bit
Playing and learning - strictly for my own pleasure.

Birger52

  • Full Member
  • ***
  • Posts: 222
Re: Lazarus Release 2.0.10
« Reply #61 on: July 23, 2020, 09:25:02 pm »
Ans it doesn't seem to be the only problem with DragDrop in Lazarus 2.0.10 FPC 3.2.0
Apparently TControl no longer has a FDragCursor variable - see image...
I tried  commenting out the first line; seems a little overkill to ask for the same value instead of just setting it (- unless the comparison is a lot faster than than simply assigning a value, I don't know)...
But it - not surprisingly - simply causes the error to move to line 3409...
Lazarus 2.0.10 FPC 3.2.0
Win7 64bit
Playing and learning - strictly for my own pleasure.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6447
    • wiki
Re: Lazarus Release 2.0.10
« Reply #62 on: July 23, 2020, 10:01:01 pm »
"cannot access memory at adders 0x164"

Any value that low (below the sizeOf(TControl) ) means that "self" is nil.
Check the callstack

Birger52

  • Full Member
  • ***
  • Posts: 222
Re: Lazarus Release 2.0.10
« Reply #63 on: July 24, 2020, 12:03:38 pm »
OK - thx
Lazarus 2.0.10 FPC 3.2.0
Win7 64bit
Playing and learning - strictly for my own pleasure.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3807
  • I like bugs.
Re: Lazarus Release 2.0.10
« Reply #64 on: July 24, 2020, 12:55:13 pm »
@Birger52, if that really is a regression bug introduced between Lazarus 2.0.8 and 2.0.10, we should find the guilty revision.
Can you please study it from the fixes_2_0 SVN branch.
I cannot see any revisions directly dealing with DragDrop.
 https://wiki.freepascal.org/Lazarus_2.0_fixes_branch#Fixes_for_2.0.10_.28merged.29
Mostly Lazarus trunk on Manjaro Linux.

Birger52

  • Full Member
  • ***
  • Posts: 222
Re: Lazarus Release 2.0.10
« Reply #65 on: July 24, 2020, 04:15:11 pm »
I have no idea what you're asking.

All I can do is to determine, that things were functioning in 2.0.8 - and they don't in 2.0.10.
Imagine there may be a million places, things can go wrong.

But I can give you some details.

Control ClipCont is derived from TPanel. Basically a userdrawn panel of a TStringList, with a scrollbar, determining which texts to draw.
Starting drag is done like this:
Code: Pascal  [Select][+][-]
  1. procedure TmyStripPlayForm.SetDragStart(aX,aY:integer); // called at mousedown
  2. begin
  3.   mdX := aX;
  4.   mdY := aY;
  5. end;
  6.  
  7. procedure TmyStripPlayForm.ClipContMouseMove(Sender:TObject;Shift:TShiftState;X,Y:Integer);
  8. begin
  9.   if (ssLeft in Shift) and (mdX > -1) and (mdY > -1) then begin
  10.     if Abs(mdX - X) + Abs(mdY - Y) > 5 then begin
  11.       DragCtrl := ClipCont;
  12.       DragCtrl.BeginDrag(true);
  13.     end;
  14.   end;
  15. end;
  16.  

The use of DragCtrl is nescessary, as Source in DragOver is otherwise the form containing the panels - which is not usefull, and it wasn't like that in 2.0.8 - it was the actual control starting the drag.
DragCtrl is a public var in the Form class.

Following the start of the Drag operation, DragOver is called on the same control that starts the Drag.

Code: Pascal  [Select][+][-]
  1. procedure TmyStripPlayForm.ClipContDragOver(Sender,Source:TObject;X,Y:Integer;State:TDragState;var Accept:Boolean);
  2. var
  3.   dtTyp : byte = dtNone;
  4.   crCur : TCursor;
  5. begin    // Drag over text-Listen af clips
  6. {
  7.   if ((Source = ClipCont) and (ClipCont.SelectedIndex <> ClipCont.DropIndex)) or
  8.      ((Source = ClipImgCont.HeaderLabel) and (ClipImgCont.Selected <> ClipCont.DropIndex)) then
  9.     dtTyp := dtMove or dtExch
  10.   else if (Source = AutoImgCont.HeaderLabel) or (Source = HistoryListCont.HeaderLabel) then
  11.     dtTyp := dtCopy;
  12. }
  13.   if ((DragCtrl = ClipCont) and (ClipCont.SelectedIndex <> ClipCont.DropIndex)) or
  14.      ((DragCtrl = ClipImgCont) and (ClipImgCont.Selected <> ClipCont.DropIndex)) then
  15.     dtTyp := dtMove or dtExch
  16.   else if (DragCtrl = AutoImgCont) or (DragCtrl = HistoryListCont) then
  17.     dtTyp := dtCopy;
  18.   crCur := GetDragCursor(dtTyp);
  19.   TDragControl(DragCtrl).DragCursor := crCur;
  20.   Accept := crCur <> crNoDrop;
  21. end;
  22.  
where
Code: Pascal  [Select][+][-]
  1.   TDragControl = class(TControl)
  2.   published
  3.     property DragCursor;
  4.   end;
  5.  
{commented out code is the code that functioned in 2.0.8.}
The line that causes the problem is here line 19:
DragCtrl is no longer set, for some reason. (and it was Source in the original 2.0.8, and it did not give any runtime errors).
I have debugged MouseMove, and DragCtrl IS set as it should be.
I have tried to debug DragOver - and at least the first time, DragOver is called, DragCtrl IS set, and pointing to the Control that initiate the dragging.
My programming do nothing to unset DragCtrl - except when ending the drag, when it is set to nil.
If the drag has been ended, DragOver should not be called. (Debugging, execution doesn't get to where it is set to nil.)
And besides - Once the drag is initiated, it is the drag Manager that controls what is happening, and no code of mine - except DragOver and DragDrop event handlers - should be called.

Lazarus 2.0.10 FPC 3.2.0
Win7 64bit
Playing and learning - strictly for my own pleasure.

hieroliu

  • Newbie
  • Posts: 1
Re: Lazarus Release 2.0.10
« Reply #66 on: July 26, 2020, 06:56:43 am »
Lazarus release package based on FPC3.2, this is an exciting time! 8)

We all know that the team has paid a lot and worked hard!

But found a problem, this release package cannot compile the IDE environment of sparta_dockedformeditor.

PascalDragon

  • Hero Member
  • *****
  • Posts: 1922
  • Compiler Developer
Re: Lazarus Release 2.0.10
« Reply #67 on: July 26, 2020, 10:51:09 pm »
But found a problem, this release package cannot compile the IDE environment of sparta_dockedformeditor.

See here for a solution. We should really pin that thread or at least its solution...

MSGEndoDoc

  • New Member
  • *
  • Posts: 11
Re: Lazarus Release 2.0.10
« Reply #68 on: July 27, 2020, 08:59:31 am »
Please help
Having trouble rebuilding Lazarus 2.0.10 after installing new components,  with the following compile error on the IDE rebuild. 

     Warning: svn not in path
     Warning: Recompiling chmreader, checksum changed for C:\lazarus\components\sparta\generics\lib\x86_64-win64\generics.collections.ppu
     chmreader.pas(80,12) Fatal: Can't find unit chmreader used by ChmLangRef

The file chmreader.pas is tn the "C:\lazarus\fpc\3.2.0\source\packages\chm\src" directory. 

How to fix this. 

Cheers,

Martin
 
Martin

PascalDragon

  • Hero Member
  • *****
  • Posts: 1922
  • Compiler Developer
Re: Lazarus Release 2.0.10
« Reply #69 on: July 27, 2020, 09:06:50 am »
Please see my post directly above yours.

MSGEndoDoc

  • New Member
  • *
  • Posts: 11
Re: Lazarus Release 2.0.10
« Reply #70 on: July 27, 2020, 09:19:27 am »
I just worked out myself it was the Sparta_dockedformeditor.   The installation is working well without it. 
Martin

 

TinyPortal © 2005-2018