Jump to content

UniTreeNode - Font


picyka

Recommended Posts

class function TMenuUtils.GetNodeByFrame(Menu : TUniTreeMenu; Frame: String): TUniTreeNode;
begin
  Result := nil;
  var Node := Menu.Items.GetFirstNode;
  while Node <> nil do
  begin
    if (Node.AttachedMenuItem <> nil)
      and (SameText(Node.AttachedMenuItem.Hint,Frame)) then
    begin
      Result := Node;
      Exit;
    end;
    Node := Node.GetNext;
  end;
end;
procedure TMainForm.UniComboBoxMenuSelect(Sender: TObject);
begin
  if Self.UniComboBoxMenu.ItemIndex = -1 then Exit;

  var lMenuItem := TMenuUtils.GetMenu(String(UniComboBoxMenu.Items.Objects[Self.UniComboBoxMenu.ItemIndex]));

  if Assigned(lMenuItem) then
  begin
    try
      TFrameUtils.ShowFrame(lMenuItem, Self.UniPCMain, nil);
      var lNode := TMenuUtils.GetNodeByFrame(Self.uniTreeMenu, lMenuItem.Recurso);
      if lNode <> nil then
      begin
        lNode.Font.Style := [TFontStyle.fsBold];
        lNode.Parent.Expand(True);
      end;
    finally
      UniComboBoxMenu.Text := '';
    end;
  end;
end;

Can I change the node font to bold?

lNode.Font.Style := [TFontStyle.fsBold];

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...