Avoid desktop flickering on WinXP at the cost of minor flickering on the main tabs. Seems LockWindowUpdate() should be used with caution. Fixes issue #1659.

This commit is contained in:
Ansgar Becker
2010-02-05 17:08:00 +00:00
parent c2a3dd02d2
commit 6c0fd612dc

View File

@ -8587,13 +8587,10 @@ begin
NewPageIndex := PageControlMain.ActivePageIndex; NewPageIndex := PageControlMain.ActivePageIndex;
if NewPageIndex >= PageIndex then if NewPageIndex >= PageIndex then
Dec(NewPageIndex); Dec(NewPageIndex);
// Avoid excessive flicker:
LockWindowUpdate(PageControlMain.Handle);
PageControlMain.Pages[PageIndex].Free; PageControlMain.Pages[PageIndex].Free;
QueryTabs.Delete(PageIndex-tabQuery.PageIndex); QueryTabs.Delete(PageIndex-tabQuery.PageIndex);
PageControlMain.ActivePageIndex := NewPageIndex; PageControlMain.ActivePageIndex := NewPageIndex;
FixQueryTabCloseButtons; FixQueryTabCloseButtons;
LockWindowUpdate(0);
PageControlMain.OnChange(PageControlMain); PageControlMain.OnChange(PageControlMain);
end; end;
@ -8662,7 +8659,6 @@ begin
// Avoid AV on Startup, when Mainform.OnResize is called once or twice implicitely. // Avoid AV on Startup, when Mainform.OnResize is called once or twice implicitely.
if not Assigned(btnAddTab) then if not Assigned(btnAddTab) then
Exit; Exit;
LockWindowUpdate(PageControlMain.Handle);
for PageIndex:=tabQuery.PageIndex+1 to PageControlMain.PageCount-1 do begin for PageIndex:=tabQuery.PageIndex+1 to PageControlMain.PageCount-1 do begin
VisiblePageIndex := PageIndex; VisiblePageIndex := PageIndex;
for i:=0 to PageControlMain.PageCount-1 do begin for i:=0 to PageControlMain.PageCount-1 do begin
@ -8683,8 +8679,6 @@ begin
Rect := PageControlMain.TabRect(VisiblePageIndex); Rect := PageControlMain.TabRect(VisiblePageIndex);
btnAddTab.Top := Rect.Top; btnAddTab.Top := Rect.Top;
btnAddTab.Left := Rect.Right + 5; btnAddTab.Left := Rect.Right + 5;
LockWindowUpdate(0);
end; end;