mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 08:00:51 +01:00
LCL: Fix keyboard navigation in RadioGroup with disabled items (issue #33386, patch by Serge Anvarov).
git-svn-id: trunk@57483 -
This commit is contained in:
parent
f33cec8ed8
commit
f001209442
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user