cocoa: forcing redrawing of the hintwindow contents on caption change. See comments in the code for why this is needed

git-svn-id: trunk@58960 -
This commit is contained in:
dmitry 2018-09-12 03:19:50 +00:00
parent ac62bf6451
commit 71ed470870

View File

@ -145,6 +145,7 @@ type
public
published
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
end;
{ TCocoaWSScreen }
@ -250,6 +251,20 @@ begin
Result := TLCLIntfHandle(cnt);
end;
class procedure TCocoaWSHintWindow.SetText(const AWinControl: TWinControl;
const AText: String);
begin
TCocoaWSCustomForm.SetText(AWinControl, AText);
//todo: this is a workaround. For some reason, when moving a hint window
// from one control to another (of the same type), the contents
// of the hint window is not invalidated.
//
// Need to figure out why this is happening and resolve at the proper place.
// In the mean time - invalidating contents every time Caption is change
if (AWinControl.HandleAllocated) then
NSView(AWinControl.Handle).setNeedsDisplay_(true);
end;
{ TLCLWindowCallback }
function TLCLWindowCallback.CanActivate: Boolean;