Fixed: SelectLast used the active group to start
This commit is contained in:
parent
7c3d746844
commit
da24dfd4d0
@ -2656,12 +2656,26 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function TX2CustomMenuBar.SelectLast: TX2CustomMenuBarItem;
|
function TX2CustomMenuBar.SelectLast: TX2CustomMenuBarItem;
|
||||||
|
var
|
||||||
|
startGroup: TX2MenuBarGroup;
|
||||||
|
startItem: TX2CustomMenuBarItem;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
if Groups.Count = 0 then
|
||||||
|
Exit;
|
||||||
|
|
||||||
if AllowInteraction then
|
if AllowInteraction then
|
||||||
begin
|
begin
|
||||||
Result := Iterate(FindEnabledItem, mbdUp);
|
{ Start from the last item in the last group }
|
||||||
|
startGroup := Groups[Pred(Groups.Count)];
|
||||||
|
|
||||||
|
if startGroup.Items.Count > 0 then
|
||||||
|
startItem := startGroup.Items[Pred(startGroup.Items.Count)]
|
||||||
|
else
|
||||||
|
startItem := startGroup;
|
||||||
|
|
||||||
|
Result := Iterate(FindEnabledItem, mbdUp, nil, startItem);
|
||||||
if Assigned(Result) then
|
if Assigned(Result) then
|
||||||
SelectedItem := Result;
|
SelectedItem := Result;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user