IDE: replace TabIndexAtClientPos with IndexOfPageAt to hide compiler warnings, after r53950 #f723ac55cd

git-svn-id: trunk@53953 -
This commit is contained in:
michl 2017-01-15 22:40:10 +00:00
parent 684c92d6d4
commit 26c080e5a4
5 changed files with 12 additions and 12 deletions

View File

@ -5874,7 +5874,7 @@ begin
// insert as last
ADockObject.DropOnControl:=DockSite.Pages;
end else begin
TabIndex:=DockSite.Pages.TabIndexAtClientPos(p);
TabIndex:=DockSite.Pages.IndexOfPageAt(p);
if TabIndex>=0 then begin
// insert in front of an existing
ADockObject.DropOnControl:=DockSite.Pages.Page[TabIndex];
@ -6248,7 +6248,7 @@ var
Site: TAnchorDockHostSite;
begin
inherited MouseDown(Button, Shift, X, Y);
ATabIndex := TabIndexAtClientPos(Point(X,Y));
ATabIndex := IndexOfPageAt(X, Y);
if (Button = mbLeft) and DockMaster.AllowDragging and (ATabIndex >= 0) then
begin
APage:=Page[ATabIndex];

View File

@ -125,7 +125,7 @@ function TExtendedNotebook.TabIndexForDrag(x, y: Integer): Integer;
var
TabPos: TRect;
begin
Result := TabIndexAtClientPos(Point(X,Y));
Result := IndexOfPageAt(X, Y);
if Result < 0 then begin
TabPos := TabRect(PageCount-1);
// Check empty space after last tab
@ -158,7 +158,7 @@ Begin
// On GTK2 if BeginDrag is called before PageChanging, the GTK notebook no longer works
FMouseWaitForDrag := True;
if FMouseDownIndex < 0 then
FMouseDownIndex := TabIndexAtClientPos(Point(X,Y));
FMouseDownIndex := IndexOfPageAt(X, Y);
FMouseDownX := X;
FMouseDownY := Y;
FTriggerDragX := GetSystemMetrics(SM_CXDRAG);
@ -198,7 +198,7 @@ Begin
else
if Message.NMHdr^.code = TCN_SELCHANGING then Begin
if (fTabDragMode = dmAutomatic) and (not FMouseWaitForDrag) then
FMouseDownIndex := TabIndexAtClientPos(ScreenToClient(Mouse.CursorPos));
FMouseDownIndex := IndexOfPageAt(ScreenToClient(Mouse.CursorPos));
{$IFDEF ExtNBookDebug}debugln(['TExtendedNotebook.CNNotify: FMouseWaitForDrag=', FMouseWaitForDrag, ' Idx=',FMouseDownIndex]);{$ENDIF}
end;
inherited CNNotify(Message);

View File

@ -389,7 +389,7 @@ var
begin
if (Button = mbMiddle) then
begin
TabIndex := ResultsNoteBook.TabIndexAtClientPos(Point(X,Y));
TabIndex := ResultsNoteBook.IndexOfPageAt(Point(X,Y));
if TabIndex >= 0 then
ResultsNoteBookClosetabclicked(ResultsNoteBook.Page[TabIndex]);
end;

View File

@ -6581,7 +6581,7 @@ begin
// Get the tab that was clicked
if PopM.PopupComponent is TPageControl then begin
PageCtrl:=TPageControl(PopM.PopupComponent);
PageI:=PageCtrl.TabIndexAtClientPos(PageCtrl.ScreenToClient(PopM.PopupPoint));
PageI:=PageCtrl.IndexOfPageAt(PageCtrl.ScreenToClient(PopM.PopupPoint));
if (PageI>=0) and (PageI<PageCtrl.PageCount) then
PageIndex := PageI // Todo: This should be in MouseDown / or both, whichever is first
else
@ -6808,7 +6808,7 @@ var
ASrcEdit: TSourceEditor;
begin
if (PageCount=0) or (HintInfo=nil) then exit;
TabIndex:=FNoteBook.TabIndexAtClientPos(FNotebook.ScreenToClient(Mouse.CursorPos));
TabIndex:=FNoteBook.IndexOfPageAt(FNotebook.ScreenToClient(Mouse.CursorPos));
if TabIndex<0 then exit;
ASrcEdit:=FindSourceEditorWithPageIndex(TabIndex);
if ASrcEdit=nil then exit;
@ -8416,7 +8416,7 @@ var
begin
if (Button = mbMiddle) then
begin
TabIndex:=FNotebook.TabIndexAtClientPos(Point(X,Y));
TabIndex:=FNotebook.IndexOfPageAt(X, Y);
if TabIndex>=0 then
CloseClicked(NoteBookPage[TabIndex],
(GetKeyState(VK_CONTROL) < 0) and EditorOpts.CtrlMiddleTabClickClosesOthers);
@ -8424,7 +8424,7 @@ begin
if (Button = mbRight) then
begin
//select on right click
TabIndex:=FNotebook.TabIndexAtClientPos(Point(X,Y));
TabIndex:=FNotebook.IndexOfPageAt(X, Y);
if TabIndex>=0 then
FNotebook.ActivePageIndex := TabIndex;
end;
@ -8437,7 +8437,7 @@ var
begin
if (Button = mbRight) then
begin
TabIndex:=FNotebook.TabIndexAtClientPos(Point(X,Y));
TabIndex:=FNotebook.IndexOfPageAt(X, Y);
if TabIndex>=0 then
begin
TabPopUpMenu.PopupComponent := FNotebook;

View File

@ -367,7 +367,7 @@ end;
function TTabControlNoteBookStrings.IndexOfTabAt(X, Y: Integer): Integer;
begin
Result:=FNoteBook.TabIndexAtClientPos(Point(X, Y));
Result:=FNoteBook.IndexOfPageAt(X, Y);
end;
{ TTabControl }