Recent

Author Topic: A question about ptcmouse.  (Read 305 times)

TBMan

  • Sr. Member
  • ****
  • Posts: 276
A question about ptcmouse.
« on: October 02, 2025, 03:17:20 am »
I found that, when using PTCgraph and setting a viewport with anything other than x1 = 0 and y1=0 that the ptcmouse unit does not adjust its mousex, mousey for the possible viewport offset. I'd have to rebuild ptcmouse and even though I made a change to the pctmouse unit, the changes aren't reflected.

Ptcmouse has the following code:

Code: Pascal  [Select][+][-]
  1. procedure GetMouseState(var x, y, buttons: LongInt);
  2.  
  3. begin
  4.   GetMouseEvents;
  5.   x := MouseX;
  6.   y := MouseY;
  7.   buttons := MouseButtonState;
  8. end;                  
  9.  

and I want to rebuild it as:
Code: Pascal  [Select][+][-]
  1. procedure GetMouseState(var x, y, buttons: LongInt);
  2. var
  3.   v:viewsettings;
  4. begin
  5.   GetMouseEvents;
  6.   getviewsettings(v);
  7.   x := MouseX-v.x1;
  8.   y := MouseY-v.y1;
  9.   buttons := MouseButtonState;
  10. end;                  
  11.  

I could just save the ptcgraph unit code as a my_mouse unit, make my change and use it instead of ptcmouse.


So how can I rebuild pctmouse to reflect my change to its getmousestate procedure? Or is it better just to do my workaround? (Which I started to do already).



« Last Edit: October 02, 2025, 03:46:17 am by TBMan »

Thaddy

  • Hero Member
  • *****
  • Posts: 18306
  • Here stood a man who saw the Elbe and jumped it.
Re: A question about ptcmouse.
« Reply #1 on: October 02, 2025, 06:21:09 am »
if you copy the ptc units to your project directory they should take precedence over the precompiled ones.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

TBMan

  • Sr. Member
  • ****
  • Posts: 276
Re: A question about ptcmouse.
« Reply #2 on: October 02, 2025, 01:03:36 pm »
if you copy the ptc units to your project directory they should take precedence over the precompiled ones.

Thank you Thaddy.

 

TinyPortal © 2005-2018