haitao:
[delphi技术贴]关于application的HintWindow的认识和疑惑。。。
[阅读: 585] 2006-08-21 09:44:07
--那棵树有点大了。。。
application.FHintWindow是私有的而不是保护的,那么无法变通访问。。。。
with application do
begin
//关闭的差别?:
hidehint;
cancelhint;
showhint:=false;
//显示?
showhint:=true;
ActivateHint( mouse.CursorPos );
end;
FHintActive 的作用和意义?HideHint的时候,并没有修改它。。。
CancelHint的时候,把它改成false了。。。
FShowHint 的作用和意义?到底是即时显示和关闭hint,还是像界面控件的hint一样,只是允许显示hint与否?
HideHint、CancelHint的时候,并没有修改它。。。
莫非有一个hint窗体(FHintWindow)建立、显示、(暂时)隐藏、重新显示、彻底关闭(释放FHintWindow)的过程,
(暂时)隐藏不释放,是为了下次也是显示同一个hint时效率比较高?
到底如何判断当前application是否有hint正在被显示着呢??
procedure TApplication.SetShowHint(Value: Boolean);
begin
if FShowHint <> Value then
begin
FShowHint := Value;
if FShowHint then
begin
FHintWindow := HintWindowClass.Create(Self);
FHintWindow.Color := FHintColor;
end else
begin
FHintWindow.Free;
FHintWindow := nil;
end;
end;
end;
procedure TApplication.CancelHint;
begin
if FHintControl <> nil then
begin
HideHint;
FHintControl := nil;
FHintActive := False;
UnhookHintHooks;
StopHintTimer;
end;
end;
procedure TApplication.HideHint;
begin
if (FHintWindow <> nil) and FHintWindow.HandleAllocated and
IsWindowVisible(FHintWindow.Handle) then
ShowWindow(FHintWindow.Handle, SW_HIDE);
end;
procedure TApplication.ActivateHint(CursorPos: TPoint);
这个就太复杂了。。。。