Link to home
Start Free TrialLog in
Avatar of zebada
zebada

asked on

Using TFont in TComponent

I have a component derived from TGraphicControl and one of the published properties is of type TFont like this:

    FGridFont: TFont;
    procedure SetGridFont(const Value: TFont);
    property GridFont: TFont read FGridFont write SetGridFont;

procedure Txxx.SetGridFont(const Value: TFont);
begin
  FGridFont.Assign(Value);
  Invalidate;
end;

FGridFont is created in the component's constructor and freed in the destructor.

When I change the font using the ellipses in the object inspector the Invalidate is invoked and my component is repainted with the new font settings.

If, however, I expand the TFont properties in the object inspector and change individual font settings then the Invalidate is NOT invoked and my component is not repainted.

How can I get it to repaint in the second scenario?

Paul
ASKER CERTIFIED SOLUTION
Avatar of TOndrej
TOndrej

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial