mouseeventd.inc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2006 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Type
  18. {todo TPTCMouseCursor = (PTCMouseCursorDefault,
  19. PTCMouseCursorAlwaysVisible,
  20. PTCMouseCursorAlwaysInvisible);}
  21. TPTCMouseButton = (PTCMouseButton1, { left mouse button }
  22. PTCMouseButton2, { right mouse button }
  23. PTCMouseButton3, { middle mouse button }
  24. PTCMouseButton4,
  25. PTCMouseButton5);
  26. TPTCMouseButtonState = Set Of TPTCMouseButton;
  27. TPTCMouseEvent = Class(TPTCEvent)
  28. Private
  29. FX, FY : Integer;
  30. FDeltaX, FDeltaY : Integer;
  31. FButtonState : TPTCMouseButtonState;
  32. Protected
  33. Function GetType : TPTCEventType; Override;
  34. Public
  35. Constructor Create(AX, AY, ADeltaX, ADeltaY : Integer; AButtonState : TPTCMouseButtonState);
  36. Property X : Integer Read FX;
  37. Property Y : Integer Read FY;
  38. Property DeltaX : Integer Read FDeltaX;
  39. Property DeltaY : Integer Read FDeltaY;
  40. Property ButtonState : TPTCMouseButtonState Read FButtonState;
  41. End;
  42. TPTCMouseButtonEvent = Class(TPTCMouseEvent)
  43. Private
  44. FPress : Boolean;
  45. FButton : TPTCMouseButton;
  46. Function GetRelease : Boolean;
  47. Public
  48. Constructor Create(AX, AY, ADeltaX, ADeltaY : Integer; AButtonState : TPTCMouseButtonState; APress : Boolean; AButton : TPTCMouseButton);
  49. Property Press : Boolean Read FPress;
  50. Property Release : Boolean Read GetRelease;
  51. Property Button : TPTCMouseButton Read FButton;
  52. End;