TInspectorPanels->Items change font settings

Hello,

I tried to change the font settings of TInspectorItems at runtime. The TInspectorPanel->Style is set to psProperties

When I put the following code in the OnItemClick event of the InspectorBar, the code is executed but nothing happens:

void __fastcall TForm1::InspectorBar1ItemClick(TObject *Sender,
      TInspectorPanel *AInspectorPanel, TInspectorItem *AInspectorItem)
{
AInspectorItem->FontValue->Color = clBlack;
AInspectorItem->FontValue->Style = AInspectorItem->FontValue->Style << fsBold;
}

How can I change the font setting of an item at runtime?

Regards

The setting for InspectorItem.FontValue apply to the FontValue of the item, i.e. the edited value when the PropertyType of the item is chosen. The FontValue doesn't apply to the label of the item.The font of the item label is global per InspectorPanel and is set with InspectorPanel.CaptionFont.

Ok, thx. but the font of the value doesn't change either

I cannot see this here.

Test for a panel with psProperties style and one item with ptFont property type:

 inspectorbar1.Panels[0].Items[0].FontValue.Name := 'COURIER NEW';

this code changes the value to display with Courier New font.

Doesn't work here when set in ItemClick event handler:
void __fastcall TForm1::InspectorBar1ItemClick(TObject *Sender,
      TInspectorPanel *AInspectorPanel, TInspectorItem *AInspectorItem)
{
  AInspectorItem->FontValue->Name = "COURIER NEW";
}

InspectorBar version= 1.8.0.0

I retested this with the latest version v1.8.1.1 with the code:


procedure TForm4.FormCreate(Sender: TObject);
begin
  inspectorbar1.Panels.Add;
  inspectorbar1.Panels[0].style := psProperties;

  inspectorbar1.Panels[0].Items.Add;
  inspectorbar1.Panels[0].Items[0].PropertyType := ptFont;
  inspectorbar1.Panels[0].Items[0].Caption := 'Font';

end;

procedure TForm4.InspectorBar1ItemClick(Sender: TObject;
  AInspectorPanel: TInspectorPanel; AInspectorItem: TInspectorItem);
begin
  AInspectorItem.FontValue.Name := 'Courier New';
end;

and I cannot see a problem. Clicking the item changes both the display of the font name (property value) as the font itself with which it is displayed. The item caption remains displayed in the inspectorpanel font (which is by design)

Don't know. Isn't working here, but I don't mind as I am using an Icon now to mark an item as selected.

This was just what I observed when trying to change the item font.

If you say it's ok, then fine...

Have a nice WE
Regards