procedure TMenuBar.GetChildren(Proc: TGetChildProc;
Root: TComponent);
begin
end;
procedure TMenuBar.SetMenu(const Value: TMainMenu);
var
i: Integer;
Button: TToolButton;
begin
if FMenu = Value then
exit;
if Assigned(FMenu) then
for i := ButtonCount - 1do
wnto 0do
Buttons.Free;
FMenu := Value;
if not Assigned(FMenu) then
exit;
for i := ButtonCount to FMenu.Items.Count - 1do
begin
Button := TToolButton.Create(Self);
try
Button.AutoSize := True;
Button.Grouped := True;
Button.Parent := Self;
Buttons.MenuItem := FMenu.Items;
except
Button.Free;
raise;
end;
end;
{ Copy attributes from each menu item }
for i := 0 to FMenu.Items.Count - 1do
Buttons.MenuItem := FMenu.Items;
end;