...
procedure TNxPropertyItems.AddItem(Parent, Item: TNxPropertyItem; Position: TAddPosition);
...
(1867) Item.Font.Assign(TNxCustomInspector(FOwner).Font);
(1868) Item.ValueFont.Assign(Item.Font);
The existence of these lines seem like a bug to me. The issue here for me, is that TNxProperyItems.AddChild internally calls TNxPropertyItems.AddItem, which then resets any changes made to the object's item.font or item.font.style prior to adding the object to the control. This isn't such a big deal when you're calling AddChild since it returns the object and you can easily modify it after adding it, but in the case of calling AddItem directly it's super annoying since you're forced to use it to assign the parent/child relationship of the item in the treeview but then can't directly manipulate the object after its added and it overwrites any font changes made prior to adding. Well not without doing something similar to below...
Here's code I used to test how adding items to the control worked.
procedure AddItem(ni: TNextInspector; strName: string); var pi, ci: TNxPropertyItem; begin // Add parent item pi := ni.Items.AddChild(nil, TNxTextItem, strName); pi.Caption := strName; pi.Expanded := False; // Add child item ci := TNxMemoItem.Create(ni); ci.ReadOnly := True; ci.Value := strName; ni.Items.AddItem(pi, ci); ci.Free; ci := pi.GetFirstChild; ci.ValueFont.Style := []; end;
Am I missing something here? Is there a better way?
Thanks.