LCL: return correct value from TPageControl.TabIndexAtClientPos also when TabVisible=False. Issue #21088

git-svn-id: trunk@34741 -
This commit is contained in:
juha 2012-01-15 10:37:00 +00:00
parent fd3ef18dd3
commit 43788346d6

View File

@ -307,9 +307,21 @@ end;
NoteBook1.ScreenToClient(Mouse.CursorPos));
------------------------------------------------------------------------------}
function TCustomTabControl.TabIndexAtClientPos(ClientPos: TPoint): integer;
var
i, VisiblePageInd: Integer;
begin
if HandleAllocated then
Result:=TWSCustomTabControlClass(WidgetSetClass).GetTabIndexAtPos(Self, ClientPos)
if HandleAllocated then begin
Result:=TWSCustomTabControlClass(WidgetSetClass).GetTabIndexAtPos(Self, ClientPos);
VisiblePageInd:=-1;
for i:=0 to PageCount-1 do begin
if Page[i].TabVisible then
Inc(VisiblePageInd)
else begin
if VisiblePageInd < Result then
Inc(Result);
end;
end;
end
else
Result:=-1;
end;