Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Styles/Control Hooks    [ Add a report in this area ]  
Report #:  105770   Status: Open
Change visibility specifier in all style hook classes
Project:  Delphi Build #:  16.0.4504.48759
Version:    16.4 Submitted By:   Dalija Prasnikar
Report Type:  Basic functionality failure Date Reported:  5/21/2012 4:56:35 AM
Severity:    Serious / Highly visible problem Last Updated: 5/22/2012 3:43:41 AM
Platform:    All versions Internal Tracking #:   28405
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Please change visibility specifiers from strict private to strict protected. Strict private makes it imposible to create custom style hooks that would sligthy alter behavior of existing classes.

Steps to Reproduce:
If I want to override painting procedure of TButtonStyleHook I cannot access its private fields that are needed to recreate proper behavior.
Currently the only way to do so is to copy-paste whole TButtonStyleHook class. Same thing applies to all style hook classes.

TMyButtonStyleHook = class(TButtonStyleHook)
strict protected
  procedure Paint(Canvas: TCanvas); override;
end;

protected TMyButtonStyleHook. procedure Paint(Canvas: TCanvas);
begin
   if FPressed  then  // FPressed is not available
  ...

end;
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 5/22/2012 6:12:28 AM -
This report was opened with valid Internal Tracking Number.
Thanks.

Rodrigo Ruz at 8/10/2012 11:34:56 AM -
Dalija  I faced the same issue in the past as workaround you can use a class helper, try the sample located in this link http://code.google.com/p/vcl-styles-utils/source/browse/trunk/Common/Vcl.Styles.Fixes.pas

Server Response from: ETNACODE01