SilverpointDev / sptbxlib

SpTBXLib is an expansion package for TB2K Delphi components that adds multiple features including support for styles and custom skins.
https://www.silverpointdevelopment.com
Other
73 stars 33 forks source link

SpTBXTabSet rendering glitches when SpTBX skin is enabled #54

Closed charlesw closed 3 years ago

charlesw commented 4 years ago

Steps to reproduce:

  1. Add SpTBXTabSet with two tabs to a form
  2. Set the SpTBX skin to "Office 2007 Blue"
  3. Run app and switch between tabs, note that all tabs disappear until refreshed by moving mouse

Note that a Delphi example demonstrating the bug can be found here: https://github.com/charlesw/sptbxlib (see delphi project in Demos/SpTBXTabSetBug)

Other things to note:

charlesw commented 4 years ago

I've had a bit more of a look into this appears to be occurring as Toolbar that renders the tabs will only render the tabs that intersect with the current clipping rectangle. While this makes sense something changed since 2.4.8 (the last version we used) which means that when the active tab is changed the inactive ones aren't rendered resulting in blank background being displayed in their place.

I've managed to work around the issue by forcing a full invalidation when the active tab changes by calling TSpTBXTabToolbar.InvalidateNC rather than using View.InvalidatePosition & SetWinPos in TSpTBXTabToolbar.SetActiveTabIndex. According to the comments in the code this may cause flicker though we haven't noticed any in our specific circumstance.

SilverpointDev commented 4 years ago

Can't reproduce, tried your demo and it works fine. Can you try to reproduce it with TSpTBXStatusBar?

charlesw commented 4 years ago

No I've only noticed it on the tabset. If you can't reproduce all I can think is it might be some interaction with vcl, we use Rad Studio 10.2.3, though it is odd that past releases were fine. Unfortunately I don't currently have access to 10.3 series so can't test it in that.

On Tue, 21 Jan 2020, 01:50 SilverpointDev, notifications@github.com wrote:

Can't reproduce, tried your demo and it works fine. Can you try to reproduce it with TSpTBXStatusBar?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SilverpointDev/sptbxlib/issues/54?email_source=notifications&email_token=AAB7HSBBQ7HTMI5TD46EOG3Q6W25FA5CNFSM4JTQDYHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJM4F7Y#issuecomment-576307967, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB7HSATTCS3F26N4ZED46LQ6W25FANCNFSM4JTQDYHA .

SilverpointDev commented 4 years ago

I have tested it with 10.2.3 Are you sure you applied the latest patch to TB2K?

charlesw commented 4 years ago

Yes the latest version of the patch was applied to TB2K 2.2.2.

Just to be clear this is the kind of glitches I'm seeing: image

I've also updated my forked repo\demo to reflect the latest code and can confirm it still occurs.

SilverpointDev commented 4 years ago

Can't reproduce it on your demo. Can you try this, change the following methods:

procedure TSpTBXTabToolbarView.BeginUpdate;
begin
  inherited;
end;

procedure TSpTBXTabToolbarView.EndUpdate;
begin
  inherited;
  if (FUpdating = 0) and (Owner is TSpTBXTabToolbar) then
    TSpTBXTabToolbar(Owner).InvalidateNC;
end;
charlesw commented 4 years ago

Tried the change you suggested and it doesn't work, neither is BeginUpdate or EndUpdate ever called (in the demo)

SilverpointDev commented 3 years ago

Fixed in latest commit