Recent

Author Topic: [SOLVED] Conflicting units over (T)Point  (Read 2769 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
[SOLVED] Conflicting units over (T)Point
« on: June 29, 2017, 02:26:30 pm »
hi All,
i have to use in a project the JwaWindows unit and also TPoint.
unfortunately as soon as I add the JwaWindows unit the point definition below does not work anymore.
the code is from another post and suits what i need in the project.

Code: Pascal  [Select][+][-]
  1. FDragStartPoint:=Point(Mouse.CursorPos.x-Left,Mouse.CursorPos.y-Top);
  2.  

please advise how this conflict can be solved.

thank you
« Last Edit: June 29, 2017, 05:48:09 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: Conflicting units over (T)Point
« Reply #1 on: June 29, 2017, 02:51:49 pm »
I used for now the below but I do not think is the best way to solve this.

Code: Pascal  [Select][+][-]
  1.   _DragStartX:= Mouse.CursorPos.x - Form1.Left;
  2.   _DragStartY:= Mouse.CursorPos.y - Form1.Top;  
  3.  
Lazarus 2.0.2 64b on Debian LXDE 10

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Conflicting units over (T)Point
« Reply #2 on: June 29, 2017, 03:05:55 pm »

Just prefix unitname. for the relevant identifiers, like

Code: Pascal  [Select][+][-]
  1.  
  2. :=windows.point(mouse....)

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Conflicting units over (T)Point
« Reply #3 on: June 29, 2017, 03:14:31 pm »
Move jwawindows to the start of the uses clauses. Units are avaluated from left to right, and if a declaration is repeated in a "later" unit it "wins" over the previous one. In your original uses clause, jwawindows was after Classes.

Or remove jwawindows altogether - it is not used anywhere (at least in this project).
« Last Edit: June 29, 2017, 03:32:54 pm by wp »

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: Conflicting units over (T)Point
« Reply #4 on: June 29, 2017, 05:47:52 pm »
Thank you.
I placed unit JwaWindows first and it worked.
Lazarus 2.0.2 64b on Debian LXDE 10

 

TinyPortal © 2005-2018