- skip forms which does not share application taskbar item from TApplication.UpdateVisible (bug #0013042)
- don't perform any visual actions when we change ShowInTaskBar property in the design time

git-svn-id: trunk@18445 -
This commit is contained in:
paul 2009-01-26 03:41:21 +00:00
parent 799d3a721f
commit cf4f433100
2 changed files with 13 additions and 4 deletions

View File

@ -825,22 +825,31 @@ end;
------------------------------------------------------------------------------}
procedure TApplication.UpdateVisible;
function UseAppTaskbarItem(AForm: TCustomForm): Boolean; inline;
begin
Result := (AForm = MainForm) or (AForm.ShowInTaskBar in [stNever, stDefault]);
end;
function HasVisibleForms: Boolean;
var
i: integer;
AForm: TCustomForm;
begin
Result := False;
for i := 0 to Screen.CustomFormCount - 1 do
if Screen.CustomForms[i].Visible and (Screen.CustomForms[i].Parent = nil) then
begin
AForm := Screen.CustomForms[i];
if AForm.Visible and (AForm.Parent = nil) and UseAppTaskbarItem(AForm) then
begin
Result := True;
break;
end;
end;
end;
begin
// if there are visible forms then application task bar item must be visible too
// else hide it
// if there are visible forms wich shares application taskbar item then application
// task bar item must be visible too else hide it
WidgetSet.AppSetVisible(HasVisibleForms);
end;

View File

@ -1418,7 +1418,7 @@ procedure TCustomForm.SetShowInTaskbar(Value: TShowInTaskbar);
begin
if Value = FShowInTaskbar then exit;
FShowInTaskbar := Value;
if HandleAllocated then
if not (csDesigning in ComponentState) and HandleAllocated then
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
end;