|
|
@@ -19,7 +19,7 @@ type |
|
|
|
TutlMouseButtons = set of TMouseButton; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
TutlWinControlEvent = class(TutlEventArgs) |
|
|
|
TutlWinControlEventArgs = class(TutlEventArgs) |
|
|
|
private |
|
|
|
fControl: TControl; |
|
|
|
fEventType: TutlEventType; |
|
|
@@ -36,7 +36,7 @@ type |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
TutlMouseEvent = class(TutlWinControlEvent) |
|
|
|
TutlMouseEventArgs = class(TutlWinControlEventArgs) |
|
|
|
private |
|
|
|
fButtons: TutlMouseButtons; |
|
|
|
fClientPos: TPoint; |
|
|
@@ -55,7 +55,7 @@ type |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
TutlMouseWheelEvent = class(TutlWinControlEvent) |
|
|
|
TutlMouseWheelEventArgs = class(TutlWinControlEventArgs) |
|
|
|
private |
|
|
|
fWheelDelta: Integer; |
|
|
|
fClientPos: TPoint; |
|
|
@@ -73,7 +73,7 @@ type |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
TutlKeyEvent = class(TutlWinControlEvent) |
|
|
|
TutlKeyEventArgs = class(TutlWinControlEventArgs) |
|
|
|
private |
|
|
|
fCharCode: WideChar; |
|
|
|
fKeyCode: Word; |
|
|
@@ -90,7 +90,7 @@ type |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
TutlWindowEvent = class(TutlWinControlEvent) |
|
|
|
TutlWindowEventArgs = class(TutlWinControlEventArgs) |
|
|
|
private |
|
|
|
fScreenRect: TRect; |
|
|
|
fClientWidth: Cardinal; |
|
|
@@ -192,34 +192,34 @@ type |
|
|
|
procedure HandlerDeactivate (Sender: TObject); |
|
|
|
|
|
|
|
protected |
|
|
|
procedure RecordEvent(const aEvent: IutlEventArgs); virtual; |
|
|
|
procedure RecordEvent(constref aEventArgs: IutlEventArgs); virtual; |
|
|
|
|
|
|
|
function CreateMouseEvent( |
|
|
|
function CreateMouseEventArgs( |
|
|
|
aSender: TObject; |
|
|
|
aType: TutlEventType; |
|
|
|
aButtons: TutlMouseButtons; |
|
|
|
aClientPos: TPoint): TutlMouseEvent; virtual; |
|
|
|
aClientPos: TPoint): TutlMouseEventArgs; virtual; |
|
|
|
|
|
|
|
function CreateMouseWheelEvent( |
|
|
|
function CreateMouseWheelEventArgs( |
|
|
|
aSender: TObject; |
|
|
|
aDelta: Integer; |
|
|
|
aClientPos: TPoint): TutlMouseWheelEvent; virtual; |
|
|
|
aClientPos: TPoint): TutlMouseWheelEventArgs; virtual; |
|
|
|
|
|
|
|
function CreateKeyEvent( |
|
|
|
function CreateKeyEventArgs( |
|
|
|
aSender: TObject; aType: TutlEventType; |
|
|
|
aKey: Word): TutlKeyEvent; virtual; |
|
|
|
aKey: Word): TutlKeyEventArgs; virtual; |
|
|
|
|
|
|
|
function CreateWindowEvent( |
|
|
|
function CreateWindowEventArgs( |
|
|
|
aSender: TObject; |
|
|
|
aType: TutlEventType): TutlWindowEvent; virtual; |
|
|
|
aType: TutlEventType): TutlWindowEventArgs; virtual; |
|
|
|
|
|
|
|
public |
|
|
|
property Keyboard: TKeyboardState read fKeyboard; |
|
|
|
property Mouse: TMouseState read fMouse; |
|
|
|
property Window: TWindowState read fWindow; |
|
|
|
|
|
|
|
procedure DispatchEvent(aEvent: IutlEventArgs); override; |
|
|
|
procedure AttachEvents(const aControl: TWinControl; const aTypes: TutlEventTypes); |
|
|
|
procedure DispatchEvent(constref aSender: TObject; constref aEventArgs: IutlEventArgs); |
|
|
|
procedure AttachEvents (const aControl: TWinControl; const aTypes: TutlEventTypes); |
|
|
|
end; |
|
|
|
|
|
|
|
implementation |
|
|
@@ -248,15 +248,9 @@ type |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlWinControlEvent//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlWinControlEventArgs//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
function TutlWinControlEvent.GetControl: TControl; |
|
|
|
begin |
|
|
|
result := (Sender as TControl); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
constructor TutlWinControlEvent.Create(const aControl: TControl; const aEventType: TutlEventType); |
|
|
|
constructor TutlWinControlEventArgs.Create(const aControl: TControl; const aEventType: TutlEventType); |
|
|
|
begin |
|
|
|
inherited Create; |
|
|
|
fControl := aControl; |
|
|
@@ -265,9 +259,9 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlMouseEvent///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlMouseEventArgs///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
constructor TutlMouseEvent.Create( |
|
|
|
constructor TutlMouseEventArgs.Create( |
|
|
|
const aSender: TControl; |
|
|
|
const aEventType: TutlEventType; |
|
|
|
const aButtons: TutlMouseButtons; |
|
|
@@ -280,9 +274,9 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlMouseWheelEvent//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlMouseWheelEventArgs//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
constructor TutlMouseWheelEvent.Create( |
|
|
|
constructor TutlMouseWheelEventArgs.Create( |
|
|
|
const aSender: TControl; |
|
|
|
const aWheelDelta: Integer; |
|
|
|
const aClientPos: TPoint); |
|
|
@@ -296,9 +290,9 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlKeyEvent/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlKeyEventArgs/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
constructor TutlKeyEvent.Create( |
|
|
|
constructor TutlKeyEventArgs.Create( |
|
|
|
const aSender: TControl; |
|
|
|
const aEventType: TutlEventType; |
|
|
|
const aCharCode: WideChar; |
|
|
@@ -310,9 +304,9 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlWindowEvent//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
//TutlWindowEventArgs//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
constructor TutlWindowEvent.Create( |
|
|
|
constructor TutlWindowEventArgs.Create( |
|
|
|
const aSender: TControl; |
|
|
|
const aEventType: TutlEventType; |
|
|
|
const aScreenRect: TRect; |
|
|
@@ -331,90 +325,90 @@ end; |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseDown(Sender: TObject; Button: TMouseButton; |
|
|
|
Shift: TShiftState; X, Y: Integer); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_DOWN, [ Button ], Point(X, Y))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_DOWN, [ Button ], Point(X, Y))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseUp(Sender: TObject; Button: TMouseButton; |
|
|
|
Shift: TShiftState; X, Y: Integer); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_UP, [Button], Point(X, Y))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_UP, [Button], Point(X, Y))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_MOVE, [], Point(X, Y))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_MOVE, [], Point(X, Y))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseEnter(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_ENTER, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_ENTER, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseLeave(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_LEAVE, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_LEAVE, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerClick(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_CLICK, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_CLICK, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerDblClick(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseEvent(Sender, EVENT_MOUSE_DBL_CLICK, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
DispatchEvent(self, CreateMouseEventArgs(Sender, EVENT_MOUSE_DBL_CLICK, [], TControl(Sender).ScreenToClient(Controls.Mouse.CursorPos))); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerMouseWheel(Sender: TObject; Shift: TShiftState; |
|
|
|
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateMouseWheelEvent(Sender, WheelDelta, MousePos)); |
|
|
|
DispatchEvent(self, CreateMouseWheelEventArgs(Sender, WheelDelta, MousePos)); |
|
|
|
Handled := false; |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateKeyEvent(Sender, EVENT_KEY_DOWN, Key)); |
|
|
|
DispatchEvent(self, CreateKeyEventArgs(Sender, EVENT_KEY_DOWN, Key)); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateKeyEvent(Sender, EVENT_KEY_UP, Key)); |
|
|
|
DispatchEvent(self, CreateKeyEventArgs(Sender, EVENT_KEY_UP, Key)); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerResize(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateWindowEvent(Sender, EVENT_WINDOW_RESIZE)); |
|
|
|
DispatchEvent(self, CreateWindowEventArgs(Sender, EVENT_WINDOW_RESIZE)); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerActivate(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateWindowEvent(Sender, EVENT_WINDOW_ACTIVATE)); |
|
|
|
DispatchEvent(self, CreateWindowEventArgs(Sender, EVENT_WINDOW_ACTIVATE)); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.HandlerDeactivate(Sender: TObject); |
|
|
|
begin |
|
|
|
DispatchEvent(CreateWindowEvent(Sender, EVENT_WINDOW_DEACTIVATE)); |
|
|
|
DispatchEvent(self, CreateWindowEventArgs(Sender, EVENT_WINDOW_DEACTIVATE)); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.RecordEvent(const aEvent: IutlEventArgs); |
|
|
|
procedure TutlWinControlEventManager.RecordEvent(constref aEventArgs: IutlEventArgs); |
|
|
|
var |
|
|
|
me: TutlMouseEvent; |
|
|
|
ke: TutlKeyEvent; |
|
|
|
we: TutlWindowEvent; |
|
|
|
mea: TutlMouseEventArgs; |
|
|
|
kea: TutlKeyEventArgs; |
|
|
|
wea: TutlWindowEventArgs; |
|
|
|
|
|
|
|
function GetPressedButtons: TutlMouseButtons; |
|
|
|
begin |
|
|
@@ -432,34 +426,34 @@ var |
|
|
|
end; |
|
|
|
|
|
|
|
begin |
|
|
|
if Supports(aEvent, TutlMouseEvent, me) then begin |
|
|
|
fMouse.ClientPos := me.ClientPos; |
|
|
|
fMouse.ScreenPos := me.ScreenPos; |
|
|
|
case me.EventType of |
|
|
|
if Supports(aEventArgs, TutlMouseEventArgs, mea) then begin |
|
|
|
fMouse.ClientPos := mea.ClientPos; |
|
|
|
fMouse.ScreenPos := mea.ScreenPos; |
|
|
|
case mea.EventType of |
|
|
|
EVENT_MOUSE_DOWN: |
|
|
|
fMouse.Buttons := fMouse.Buttons + me.Buttons; |
|
|
|
fMouse.Buttons := fMouse.Buttons + mea.Buttons; |
|
|
|
EVENT_MOUSE_UP: |
|
|
|
fMouse.Buttons := fMouse.Buttons - me.Buttons; |
|
|
|
fMouse.Buttons := fMouse.Buttons - mea.Buttons; |
|
|
|
EVENT_MOUSE_LEAVE: |
|
|
|
fMouse.Buttons := []; |
|
|
|
EVENT_MOUSE_ENTER: |
|
|
|
fMouse.Buttons := GetPressedButtons; |
|
|
|
end; |
|
|
|
|
|
|
|
end else if Supports(aEvent, TutlKeyEvent, ke) then begin |
|
|
|
case ke.EventType of |
|
|
|
end else if Supports(aEventArgs, TutlKeyEventArgs, kea) then begin |
|
|
|
case kea.EventType of |
|
|
|
EVENT_KEY_DOWN, |
|
|
|
EVENT_KEY_REPEAT: begin |
|
|
|
fKeyboard.KeyState[ke.KeyCode and $FF] := true; |
|
|
|
case ke.KeyCode of |
|
|
|
fKeyboard.KeyState[kea.KeyCode and $FF] := true; |
|
|
|
case kea.KeyCode of |
|
|
|
VK_SHIFT: Include(fKeyboard.Modifiers, ssShift); |
|
|
|
VK_MENU: Include(fKeyboard.Modifiers, ssAlt); |
|
|
|
VK_CONTROL: Include(fKeyboard.Modifiers, ssCtrl); |
|
|
|
end; |
|
|
|
end; |
|
|
|
EVENT_KEY_UP: begin |
|
|
|
fKeyboard.KeyState[ke.KeyCode and $FF] := false; |
|
|
|
case ke.KeyCode of |
|
|
|
fKeyboard.KeyState[kea.KeyCode and $FF] := false; |
|
|
|
case kea.KeyCode of |
|
|
|
VK_SHIFT: Exclude(fKeyboard.Modifiers, ssShift); |
|
|
|
VK_MENU: Exclude(fKeyboard.Modifiers, ssAlt); |
|
|
|
VK_CONTROL: Exclude(fKeyboard.Modifiers, ssCtrl); |
|
|
@@ -470,26 +464,26 @@ begin |
|
|
|
then include(fKeyboard.Modifiers, ssAltGr) |
|
|
|
else exclude(fKeyboard.Modifiers, ssAltGr); |
|
|
|
|
|
|
|
end else if Supports(aEvent, TutlWindowEvent, we) then begin |
|
|
|
case we.EventType of |
|
|
|
end else if Supports(aEventArgs, TutlWindowEventArgs, wea) then begin |
|
|
|
case wea.EventType of |
|
|
|
EVENT_WINDOW_ACTIVATE: |
|
|
|
fWindow.Active := true; |
|
|
|
EVENT_WINDOW_DEACTIVATE: |
|
|
|
fWindow.Active := false; |
|
|
|
EVENT_WINDOW_RESIZE: begin |
|
|
|
fWindow.ScreenRect := we.ScreenRect; |
|
|
|
fWindow.ClientWidth := we.ClientWidth; |
|
|
|
fWindow.ClientHeight := we.ClientHeight; |
|
|
|
fWindow.ScreenRect := wea.ScreenRect; |
|
|
|
fWindow.ClientWidth := wea.ClientWidth; |
|
|
|
fWindow.ClientHeight := wea.ClientHeight; |
|
|
|
end; |
|
|
|
end; |
|
|
|
end; |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
function TutlWinControlEventManager.CreateMouseEvent(aSender: TObject; aType: TutlEventType; |
|
|
|
aButtons: TutlMouseButtons; aClientPos: TPoint): TutlMouseEvent; |
|
|
|
function TutlWinControlEventManager.CreateMouseEventArgs(aSender: TObject; aType: TutlEventType; |
|
|
|
aButtons: TutlMouseButtons; aClientPos: TPoint): TutlMouseEventArgs; |
|
|
|
begin |
|
|
|
result := TutlMouseEvent.Create( |
|
|
|
result := TutlMouseEventArgs.Create( |
|
|
|
(aSender as TControl), |
|
|
|
aType, |
|
|
|
aButtons, |
|
|
@@ -497,21 +491,21 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
function TutlWinControlEventManager.CreateMouseWheelEvent(aSender: TObject; aDelta: Integer; |
|
|
|
aClientPos: TPoint): TutlMouseWheelEvent; |
|
|
|
function TutlWinControlEventManager.CreateMouseWheelEventArgs(aSender: TObject; aDelta: Integer; |
|
|
|
aClientPos: TPoint): TutlMouseWheelEventArgs; |
|
|
|
begin |
|
|
|
result := TutlMouseWheelEvent.Create( |
|
|
|
result := TutlMouseWheelEventArgs.Create( |
|
|
|
(aSender as TControl), |
|
|
|
aDelta, |
|
|
|
aClientPos); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
function TutlWinControlEventManager.CreateKeyEvent(aSender: TObject; aType: TutlEventType; aKey: Word): TutlKeyEvent; |
|
|
|
function TutlWinControlEventManager.CreateKeyEventArgs(aSender: TObject; aType: TutlEventType; aKey: Word): TutlKeyEventArgs; |
|
|
|
begin |
|
|
|
if (aType = EVENT_KEY_DOWN) and fKeyboard.KeyState[aKey and $FF] then |
|
|
|
aType := EVENT_KEY_REPEAT; |
|
|
|
result := TutlKeyEvent.Create( |
|
|
|
result := TutlKeyEventArgs.Create( |
|
|
|
(aSender as TControl), |
|
|
|
aType, |
|
|
|
VKCodeToCharCode(aKey, fKeyboard.Modifiers), |
|
|
@@ -519,7 +513,7 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
function TutlWinControlEventManager.CreateWindowEvent(aSender: TObject; aType: TutlEventType): TutlWindowEvent; |
|
|
|
function TutlWinControlEventManager.CreateWindowEventArgs(aSender: TObject; aType: TutlEventType): TutlWindowEventArgs; |
|
|
|
var |
|
|
|
p0, p1: TPoint; |
|
|
|
begin |
|
|
@@ -527,7 +521,7 @@ begin |
|
|
|
p0 := ClientToScreen(Point(0, 0)); |
|
|
|
p1 := ClientToScreen(Point(Width, Height)); |
|
|
|
end; |
|
|
|
result := TutlWindowEvent.Create( |
|
|
|
result := TutlWindowEventArgs.Create( |
|
|
|
(aSender as TControl), |
|
|
|
aType, |
|
|
|
Rect(p0.x, p0.y, p1.x, p1.y), |
|
|
@@ -536,10 +530,10 @@ begin |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|
procedure TutlWinControlEventManager.DispatchEvent(aEvent: IutlEventArgs); |
|
|
|
procedure TutlWinControlEventManager.DispatchEvent(constref aSender: TObject; constref aEventArgs: IutlEventArgs); |
|
|
|
begin |
|
|
|
RecordEvent(aEvent); |
|
|
|
inherited DispatchEvent(aEvent); |
|
|
|
RecordEvent(aEventArgs); |
|
|
|
inherited DispatchEvent(aSender, aEventArgs); |
|
|
|
end; |
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
|