mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:39:12 +02:00
Cocoa/TabControl: TCocoaTabControl.updateVariousIndex() added
This commit is contained in:
parent
f7f153694c
commit
f3add49346
@ -58,8 +58,14 @@ type
|
|||||||
nextarr : NSButton;
|
nextarr : NSButton;
|
||||||
|
|
||||||
public
|
public
|
||||||
currentIndex : Integer; // index of the current tab shown
|
{ various indexes in fulltabs }
|
||||||
|
currentIndex : Integer; // index of the current tab
|
||||||
|
visibleLeftIndex: Integer; // index shown in TabView on the left
|
||||||
|
visibleRightIndex: Integer; // index shown in TabView on the right
|
||||||
|
leftKeepAmount: Integer; // left tab amount to keep, equals currentIndex-visibleLeftIndex
|
||||||
|
|
||||||
procedure attachAllTabs; message 'attachAllTabs';
|
procedure attachAllTabs; message 'attachAllTabs';
|
||||||
|
procedure updateVariousIndex; message 'updateVariousIndex';
|
||||||
|
|
||||||
public
|
public
|
||||||
callback: ITabControlCallback;
|
callback: ITabControlCallback;
|
||||||
@ -465,6 +471,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaTabControl.updateVariousIndex;
|
||||||
|
begin
|
||||||
|
if numberOfTabViewItems > 0 then begin
|
||||||
|
visibleLeftIndex:= fulltabs.indexOfObject( tabViewItemAtIndex(0) );
|
||||||
|
visibleRightIndex:= visibleLeftIndex + numberOfTabViewItems - 1;
|
||||||
|
leftKeepAmount:= currentIndex - visibleLeftIndex;
|
||||||
|
end else begin
|
||||||
|
visibleLeftIndex:= -1;
|
||||||
|
visibleRightIndex:= -1;
|
||||||
|
leftKeepAmount:= 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
class function TCocoaTabControl.alloc: id;
|
class function TCocoaTabControl.alloc: id;
|
||||||
begin
|
begin
|
||||||
Result := inherited alloc;
|
Result := inherited alloc;
|
||||||
|
Loading…
Reference in New Issue
Block a user