function addBtn(const caption, img: String; large: boolean = true; toolbutton: boolean = false): TTMSFNCRibbonToolBarButton;
begin
result := tb.AddButton;
with result do
begin
BitmapContainer := bmpContainer;
Bitmaps.AddBitmapName('icons8_' + img + '18px.png');
// Toolbuttons have no caption but fixed size e.g. alignment, font attributes
if toolbutton then
begin
result.Width := btnw;
result.height := btnh;
end
else
begin
// all other buttons
Text := caption;
AutoBitmapSize := true;
LargeLayoutBitmaps.AddBitmapName('icons8' + img + '_36px.png');
LargeLayoutAutoBitmapSize := true;
if large then
begin
Layout := bblLarge;
MinimumLayout := bblLarge;
end
else
begin
Layout := bblLabel;
MaximumLayout := bblLabel;
end;
result.font.size := rb.font.size;
result.font.name := rb.font.name;
end;
end;
end;
procedure addSection(index: integer; const caption: String);
begin
tb := rbPageControl.PageContainers[index].AddToolBar(caption);
tb.font.name := rb.font.name;
tb.font.size := rb.font.size;
end;
...
addPage('Datei').ShortCutHint := 'D';
addPage('Start').ShortCutHint := 'P';
// rbPageControl.PageContainers[1].OnClick := PatientPageClick;
addPage('Management').ShortCutHint := 'M';
addPage('Dokument').ShortCutHint := 'T';
addPage('Formatierung').ShortCutHint := 'F';
addPage('Administration').ShortCutHint := 'A';
addPage('Hilfe').ShortCutHint := 'H';
addSection(0, '');
btn := addBtn('Info-Zentrum', 'Info');
btn := addBtn('Abmelden', 'Logout_Rounded_Left', false);
btn := addBtn('Beenden', 'Shutdown', false);
addSection(0, '');
btn := addBtn('Über EMIL', 'About');
...
Also, I assigned the biotmap container to the page controller but this did not change anything. In VCL this code works well. Is there any other difference I have to take care of?
Thanks
Michael