Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caption of PngBitBtn does not appear when runtime themes are enabled

I made simple project with one PngBitBtn and then compiled it with following configuration:

  1. runtime themes are disabled
    • Debug mode - OK
    • Release mode - OK
  2. runtime themes are enabled
    • Debug mode - OK
    • Release mode - there is no caption on PngBitBtn

The only way to show caption correctly is turn off optimization. Is it possible to solve this problem without turning off optimization?

Thank you in advance, Tim

Tested on Delphi XE3, XE6. Platform: win32. PNGComponents version: newest from embarcadero CodeCentral.

print screen:

Print Screen

like image 990
Tim Avatar asked Dec 05 '14 15:12

Tim


1 Answers

Simply a bug!

To fix it, insert the following line at line 326 in PngBitBtn.pas method TPngBitBtnStyleHook.DrawButton:

  Offset := TPoint.Create(0, 0);

The code in that area should now look like this:

  if not (Control is TPngBitBtn) then
  begin
    inherited;
    Exit;
  end;
  Offset := TPoint.Create(0, 0);
  DrawRect := Control.ClientRect;
like image 131
Uwe Raabe Avatar answered Nov 30 '22 23:11

Uwe Raabe