I can easly add a MRF list to A TRibbon recent items list but how do you add
the same list to a ribbon item set as a dropdownbutton? The dropdown
item is ActionBars[2].Items[1].
var
ARecentFilesList: TStringList;
ACI: TActionClientItem;
if FileExists( ARecentFilesFilename ) then
begin
ARecentFilesList.LoadFromFile( ARecentFilesFilename );
for i := 0 to ARecentFilesList.Count - 1 do
begin
// add filename to Ribbon Recent Items
Ribbon1.AddRecentItem( ARecentFilesList.Strings[ i ] );
//add the file name to dropdown button collection
//add MostRecentFiles to ActionBars[2].Items[1]
//ACI := TActionClientItem.Create( );
//ACI.Caption := ARecentFilesList.Strings[ i ];
end;
end;
Thanks,
Bill
As with much of the actionbar controls, it is not as intuitive as you’d like. The basic structure on the ribbon is like this:
So your strategy then, is to get your hands on the TActionClient that represents the button you’d like to add your items to. On my simple test app, I grabbed the first control on the first group – your logic may need to be more advanced.
Note that I assign the caption of my menu item after I assigned the action – this is because the action replaces the caption (and other properties too) of the client it is associated with.