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

White background #37

Closed Ludens1 closed 5 years ago

Ludens1 commented 5 years ago

The last buid produced unexpected effect: some menu and toolbar items are drawing on white background

Ludens1 commented 5 years ago

image

pyscripter commented 5 years ago

Please change this line of TB2Item.pas in TTBView.DrawItem and try again: FWindow.Perform(WM_ERASEBKGND, WPARAM(BmpDC), 0); To FWindow.Perform(WM_ERASEBKGND, WPARAM(BmpDC), LPARAM(BmpDC));

Ludens1 commented 5 years ago

@pyscripter, it works, thank you. Another way i found is to set DoubleBuffered=False in Form1 properties

Ludens1 commented 5 years ago

@pyscripter, I was wrong. Your patch doesn't solve the problem fully. Black bar appears when Item resized with Form

SilverpointDev commented 5 years ago

Can you try the latest?

Ludens1 commented 5 years ago

@SilverpointDev, thank you for your response. Just reapplied tb2k patch with its new version and installed the new build of sptbx. Look: 2018-11-20_223613

SilverpointDev commented 5 years ago

Can't reproduce (XE, XE2 and Tokyo). Can you post a simple project?

Ludens1 commented 5 years ago

Can you post a simple project?

Here it is: Project1.zip Please run it and try to resize the main form.

SilverpointDev commented 5 years ago

Thanks, can't reproduce (XE, XE2 and Tokyo) Tested with Aero, Classic theme, skins, VCL Styles Make sure you reinstall TB2K and SpTBXLib, apply TB2K patch. The newer TB2K patch is on the "TB2K Patch" repo folder.

Make sure this line in TTBView.DrawItem is changed: FWindow.Perform(WM_ERASEBKGND, WPARAM(BmpDC), 0); To FWindow.Perform(WM_ERASEBKGND, WPARAM(BmpDC), LPARAM(BmpDC)); // Robert: Pass BmpDC on LParam to support DoubleBuffered property

SilverpointDev commented 5 years ago

If I don't make the change on TTBView.DrawItem then I can reproduce the white background painting and the flickering. Make sure you rebuild TB2K

Ludens1 commented 5 years ago

Thanks and sorry. My mistake. I applied the patch incorrectly. I put the files from the TB2K Patch folder in the root tb2k folder. And it was necessary to put them in the tb2k/Source folder. It might be useful to point this out in the Readme. I did not pay attention to the fact that the patch was not actually applied, because it did not run it in a DOS window, but from under the file-manager. Also, in the old days it was impossible to compile tb2k under XE without applying the patch. Now it is possible. Thanks so much! Everything's fine now.

SilverpointDev commented 5 years ago

Sorry for the mess, I'll update MultiInstaller and upload the newer patch to the page and the repo.