LCL: fixed ButtonPanel last visible button detection logic, bug #19210

git-svn-id: trunk@31383 -
This commit is contained in:
maxim 2011-06-25 13:08:19 +00:00
parent 481b0956e0
commit 3526858f4e

View File

@ -338,7 +338,7 @@ begin
if not (AControl is TPanelBitBtn) then exit(false); if not (AControl is TPanelBitBtn) then exit(false);
for i:=low(FButtons) to pred(high(FButtons)) do for i:=low(FButtons) to pred(high(FButtons)) do
if (FButtons[i]<>nil) and FButtons[i].IsControlVisible if (FButtons[i]<>nil) and FButtons[i].IsControlVisible
and (FButtons[i].Tag>AControl.Tag) then and (FButtons[i].TabOrder>TPanelBitBtn(AControl).TabOrder) then
exit(false); // there is a higher one exit(false); // there is a higher one
Result:=true; Result:=true;
end; end;
@ -554,7 +554,7 @@ begin
Exit(True) Exit(True)
else if (AControl1 is TPanelBitBtn) and (not (AControl2 is TPanelBitBtn)) then else if (AControl1 is TPanelBitBtn) and (not (AControl2 is TPanelBitBtn)) then
Exit(False); Exit(False);
// sort for tag // sort for taborder
Result := TWinControl(AControl2).TabOrder > TWinControl(AControl1).TabOrder; Result := TWinControl(AControl2).TabOrder > TWinControl(AControl1).TabOrder;
end; end;