Commit f0012094 authored by wp's avatar wp
Browse files

LCL: Fix keyboard navigation in RadioGroup with disabled items (issue #33386,...

LCL: Fix keyboard navigation in RadioGroup with disabled items (issue #33386, patch by Serge Anvarov).

git-svn-id: trunk@57483 -
parent f33cec8e
......@@ -278,13 +278,16 @@ procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
StepSize := HorzDiff * Rows + VertDiff;
WrapOffSet := HorzDiff;
end;
NewIndex := ItemIndex + StepSize;
if (NewIndex>=Count) or (NewIndex<0) then begin
NewIndex := (NewIndex + WrapOffSet + BlockSize) mod BlockSize;
// Keep moving in the same direction until in valid range
while NewIndex>=Count do
NewIndex := (NewIndex + StepSize) mod BlockSize;
end;
NewIndex := ItemIndex;
repeat
Inc(NewIndex, StepSize);
if (NewIndex >= Count) or (NewIndex < 0) then begin
NewIndex := (NewIndex + WrapOffSet + BlockSize) mod BlockSize;
// Keep moving in the same direction until in valid range
while NewIndex >= Count do
NewIndex := (NewIndex + StepSize) mod BlockSize;
end;
until (NewIndex = ItemIndex) or TRadioButton(FButtonList[NewIndex]).Enabled;
ItemIndex := NewIndex;
TRadioButton(FButtonList[ItemIndex]).SetFocus;
Key := 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment