1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91:
| unit EventAnimate;
interface
uses Windows, Messages, SysUtils, Classes, Controls, ComCtrls;
type TEventAnimate = class(TAnimate) private FClick: TNotifyEvent; FMouseMove: TMouseMoveEvent; FMouseUp: TMouseEvent; FMouseDown: TMouseEvent; FMouseEnter: TNotifyEvent; FMouseLeave: TNotifyEvent; { Private-Deklarationen } protected { Protected-Deklarationen } procedure Click; override; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure MouseEnter(var M: TMessage); message cm_MouseEnter; procedure MouseLeave(var M: TMessage); message cm_MouseLeave; public { Public-Deklarationen } published { Published-Deklarationen } property OnClick: TNotifyEvent read FClick write FClick; property OnMouseMove: TMouseMoveEvent read FMouseMove write FMouseMove; property OnMouseDown: TMouseEvent read FMouseDown write FMouseDown; property OnMouseUp: TMouseEvent read FMouseUp write FMouseUp; property OnMouseEnter: TNotifyEvent read FMouseEnter write FMouseEnter; property OnMouseLeave: TNotifyEvent read FMouseLeave write FMouseLeave; end;
procedure Register;
implementation
procedure Register; begin RegisterComponents('Eigene', [TEventAnimate]); end;
{ TEventAnimate }
procedure TEventAnimate.Click; begin if Assigned(FClick) then FClick(self) end;
procedure TEventAnimate.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; if Assigned(FMouseDown) then FMouseDown(self,Button,Shift,x,y) end;
procedure TEventAnimate.MouseEnter; begin if assigned(FMouseEnter) then FMouseEnter(self); end;
procedure TEventAnimate.MouseLeave(var M: TMessage); begin if assigned(FMouseLeave) then FMouseLeave(self); end;
procedure TEventAnimate.MouseMove; begin inherited; if Assigned(FMouseMove) then FMouseMove(self,Shift,x,y) end;
procedure TEventAnimate.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; if Assigned(FMouseUp) then FMouseUp(self,Button,Shift,x,y) end;
end. |