RRUZ / vcl-styles-utils

Extend and improve the Delphi VCL Styles
https://theroadtodelphi.wordpress.com/
329 stars 115 forks source link

Problem with PageControl/TabSheet in Alexandria #300

Open luebbe opened 1 year ago

luebbe commented 1 year ago

In Alexandria there is a problem with tabsheets, when an imagelist is assigned to the pagecontrol. In the attached example you can see that one tabsheet has an icon and the other doesn't. Unfortunately the Alexandria default drawing routine still reserves the width of the icon on the left hand side of the tab (plus a lot of space between icon and text), but calculates the tab width so that the text will fit. This leads to the text wrapping on the tab or overwriting the right hand border of the tab (seems to depend on the chosen VCL-style).

grafik

Unfortunately Vcl.ComCtrls has its own TTabControlStyleHook which is registered in the TTabSheet class constructor. This leads to the effect that even though the vcl-styles-utils TSysStyleManager.RegisterSysStyleHook(WC_TABCONTROL, TSysTabControlStyleHook) is run, it is never called, because the Vcl.ComCtrls style hook takes precedence.

Is there a way to unregister the Vcl.ComCtrls style hook? My understanding isn't deep enough, I haven't found a solution for this problem.

PageControl.zip