From 1ec8bb030f36322fd7768ab5cde4648de883f627 Mon Sep 17 00:00:00 2001 From: Zeus Date: Tue, 5 Nov 2024 21:41:21 +0100 Subject: [PATCH] https://github.com/MagicFoundation/Alcinoe/issues/361 --- Source/Alcinoe.FMX.Edit.pas | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Source/Alcinoe.FMX.Edit.pas b/Source/Alcinoe.FMX.Edit.pas index 402e83c64..e1516ba71 100644 --- a/Source/Alcinoe.FMX.Edit.pas +++ b/Source/Alcinoe.FMX.Edit.pas @@ -513,6 +513,11 @@ TALWinEditView = class(TALWinNativeView) procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; procedure WMChar(var Message: TWMChar); message WM_CHAR; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + procedure WMPaste(var Message: TWMPaste); message WM_PASTE; + procedure WMCut(var Message: TWMCut); message WM_CUT; + procedure WMClear(var Message: TWMClear); message WM_CLEAR; + procedure WMUndo(var Message: TWMUndo); message WM_UNDO; procedure WMTextColor(var Message: WinApi.Messages.TMessage); message CN_CTLCOLOREDIT; procedure WMPaint(var Message: TWMPaint); message WM_PAINT; protected @@ -3115,6 +3120,46 @@ procedure TALWinEditView.WMChar(var Message: TWMChar); fEditControl.DoChange; end; +{**********************************************************} +procedure TALWinEditView.WMSetText(var Message: TWMSetText); +begin + inherited; + invalidate; + fEditControl.DoChange; +end; + +{******************************************************} +procedure TALWinEditView.WMPaste(var Message: TWMPaste); +begin + inherited; + invalidate; + fEditControl.DoChange; +end; + +{**************************************************} +procedure TALWinEditView.WMCut(var Message: TWMCut); +begin + inherited; + invalidate; + fEditControl.DoChange; +end; + +{******************************************************} +procedure TALWinEditView.WMClear(var Message: TWMClear); +begin + inherited; + invalidate; + fEditControl.DoChange; +end; + +{****************************************************} +procedure TALWinEditView.WMUndo(var Message: TWMUndo); +begin + inherited; + invalidate; + fEditControl.DoChange; +end; + {**************************************************************************} procedure TALWinEditView.WMTextColor(var Message: WinApi.Messages.TMessage); begin @@ -4215,7 +4260,11 @@ constructor TALBaseEdit.Create(AOwner: TComponent); fBufSupportingTextDrawable := ALNullDrawable; //fBufSupportingTextDrawableRect //-- + {$IF defined(MSWindows) or defined(ALMacOS)} + FocusOnMouseDown := True; + {$ELSE} FocusOnMouseUp := True; + {$ENDIF} Cursor := crIBeam; CanFocus := True; //--