@@ -360,6 +360,7 @@ TformTrayslate = class(TForm)
360360 FPopupRecentPair: TComponent;
361361 FRawTranslate: string;
362362 FSettingsPage: integer;
363+ FTranslateTarget: TWinControl;
363364
364365 // Non sorted combo named languages
365366 FLanguages: TStringList;
@@ -594,6 +595,7 @@ TformTrayslate = class(TForm)
594595 property LastDarkMode: boolean read FLastDarkMode write FLastDarkMode;
595596 property CustomPoFile: string read FCustomPoFile write FCustomPoFile;
596597 property RawTranslate: string read FRawTranslate write FRawTranslate;
598+ property TranslateTarget:TWinControl read FTranslateTarget;
597599 property MouseHook: TGlobalMouseHook read FMouseHook write FMouseHook;
598600 property KeyHook: TGlobalKeyboardHook read FKeyHook write FKeyHook;
599601 property HotKeyApp: THotKeyData read FHotKeyApp write FHotKeyApp;
@@ -3932,6 +3934,7 @@ function TformTrayslate.TranslateThread(ATrans: TTranslate; AText: string; AMemo
39323934 Th := TTranslateThread.Create(ATrans, False);
39333935 FTranslateThread := Th;
39343936 FActiveThreads.Add(Th);
3937+ FTranslateTarget := AMemo;
39353938 UpdateTranslateButtonState;
39363939 Screen.Cursor := crAppStart;
39373940 TimerAnimate.Enabled := True;
@@ -3989,6 +3992,8 @@ procedure TformTrayslate.ThreadDone(Sender: TObject);
39893992
39903993 if not Visible and (not Assigned(formPopupTrayslate) or not formPopupTrayslate.Visible) then
39913994 ShowCustomHint(TrayIcon.Hint);
3995+
3996+ FTranslateTarget := nil ;
39923997end ;
39933998
39943999procedure TformTrayslate.CancelTranslate ;
@@ -4000,6 +4005,7 @@ procedure TformTrayslate.CancelTranslate;
40004005 FTranslateThread := nil ;
40014006 end ;
40024007 FCancelled := True;
4008+ FTranslateTarget := nil ;
40034009 finally
40044010 UpdateTranslateButtonState;
40054011 TimerAnimate.Enabled := False;
0 commit comments