Line | |
---|
1 | unit Mouse;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TGetPositionEvent = function : TPoint of object;
|
---|
10 |
|
---|
11 | { TMouse }
|
---|
12 |
|
---|
13 | TMouse = class
|
---|
14 | private
|
---|
15 | FOnGetPosition: TGetPositionEvent;
|
---|
16 | public
|
---|
17 | function GetPosition: TPoint;
|
---|
18 | published
|
---|
19 | property OnGetPosition: TGetPositionEvent read FOnGetPosition write FOnGetPosition;
|
---|
20 | end;
|
---|
21 |
|
---|
22 | implementation
|
---|
23 |
|
---|
24 | { TMouse }
|
---|
25 |
|
---|
26 | function TMouse.GetPosition: TPoint;
|
---|
27 | begin
|
---|
28 | if Assigned(FOnGetPosition) then Result := FOnGetPosition
|
---|
29 | else Result := Point(0, 0);
|
---|
30 | end;
|
---|
31 |
|
---|
32 | end.
|
---|
33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.