mouseeventi.inc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Function TPTCMouseEvent.GetType : TPTCEventType;
  18. Begin
  19. Result := PTCMouseEvent;
  20. End;
  21. Constructor TPTCMouseEvent.Create(AX, AY, ADeltaX, ADeltaY : Integer; AButtonState : TPTCMouseButtonState);
  22. Begin
  23. FX := AX;
  24. FY := AY;
  25. FDeltaX := ADeltaX;
  26. FDeltaY := ADeltaY;
  27. FButtonState := AButtonState;
  28. End;
  29. Constructor TPTCMouseButtonEvent.Create(AX, AY, ADeltaX, ADeltaY : Integer; AButtonState : TPTCMouseButtonState; APress : Boolean; AButton : TPTCMouseButton);
  30. Begin
  31. If APress Xor (AButton In AButtonState) Then
  32. Raise TPTCError.Create('Invalid ButtonState');
  33. Inherited Create(AX, AY, ADeltaX, ADeltaY, AButtonState);
  34. FPress := APress;
  35. FButton := AButton;
  36. End;
  37. Function TPTCMouseButtonEvent.GetRelease : Boolean;
  38. Begin
  39. Result := Not FPress;
  40. End;