mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 21:48:19 +02:00
LCL: TCustomTabControl: cleaning up, making only needed methods visible for derivative
git-svn-id: trunk@53980 -
This commit is contained in:
parent
f6d8f1a0df
commit
95a697d5a2
@ -441,6 +441,10 @@ type
|
||||
function DialogChar(var Message: TLMKey): boolean; override;
|
||||
procedure InternalSetPageIndex(AValue: Integer); // No OnChange
|
||||
procedure ShowControl(APage: TControl); override;
|
||||
function IndexOfTabAt(X, Y: Integer): Integer; virtual; overload;
|
||||
function IndexOfTabAt(P: TPoint): Integer; virtual; overload;
|
||||
function IndexOfPageAt(X, Y: Integer): Integer; virtual; overload;
|
||||
function IndexOfPageAt(P: TPoint): Integer; virtual; overload;
|
||||
procedure UpdateTabProperties; virtual;
|
||||
class function GetControlClassDefaultSize: TSize; override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
@ -482,10 +486,6 @@ type
|
||||
function GetCapabilities: TNoteBookCapabilities; virtual;
|
||||
function TabToPageIndex(AIndex: integer): integer;
|
||||
function PageToTabIndex(AIndex: integer): integer;
|
||||
function IndexOfTabAt(X, Y: Integer): Integer; virtual; overload;
|
||||
function IndexOfTabAt(P: TPoint): Integer; virtual; overload;
|
||||
function IndexOfPageAt(X, Y: Integer): Integer; virtual; overload;
|
||||
function IndexOfPageAt(P: TPoint): Integer; virtual; overload;
|
||||
public
|
||||
procedure DoCloseTabClicked(APage: TCustomPage); virtual;
|
||||
property Images: TCustomImageList read FImages write SetImages;
|
||||
@ -589,6 +589,10 @@ type
|
||||
GoForward, CheckTabVisible: Boolean): TTabSheet;
|
||||
procedure SelectNextPage(GoForward: Boolean);
|
||||
procedure SelectNextPage(GoForward: Boolean; CheckTabVisible: Boolean);
|
||||
function IndexOfTabAt(X, Y: Integer): Integer; override;
|
||||
function IndexOfTabAt(P: TPoint): Integer; override;
|
||||
function IndexOfPageAt(X, Y: Integer): Integer; override;
|
||||
function IndexOfPageAt(P: TPoint): Integer; override;
|
||||
function AddTabSheet: TTabSheet;
|
||||
property ActivePageIndex: Integer read GetActivePageIndex
|
||||
write SetActivePageIndex;
|
||||
@ -839,8 +843,6 @@ type
|
||||
destructor Destroy; override;
|
||||
function IndexOfTabAt(X, Y: Integer): Integer; override;
|
||||
function IndexOfTabAt(P: TPoint): Integer; override;
|
||||
function IndexOfPageAt(X, Y: Integer): Integer; override;
|
||||
function IndexOfPageAt(P: TPoint): Integer; override;
|
||||
function GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||
function GetImageIndex(ATabIndex: Integer): Integer; override;
|
||||
function IndexOfTabWithCaption(const TabCaption: string): Integer;
|
||||
|
@ -455,57 +455,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfTabAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the visible tab at the client position.
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfTabAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result := IndexOfTabAt(Point(X, Y));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfTabAt(P: TPoint): Integer;
|
||||
|
||||
Returns the index of the visible tab at the client position.
|
||||
For example:
|
||||
Index:=NoteBook1.IndexOfTabAt(
|
||||
NoteBook1.ScreenToClient(Mouse.CursorPos));
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfTabAt(P: TPoint): Integer;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
Result := TWSCustomTabControlClass(WidgetSetClass).GetTabIndexAtPos(Self, P)
|
||||
else
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the page at the client position.
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result := IndexOfPageAt(Point(X, Y));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the page at the client position.
|
||||
For example:
|
||||
Index:=NoteBook1.IndexOfPageAt(
|
||||
NoteBook1.ScreenToClient(Mouse.CursorPos));
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfPageAt(P: TPoint): Integer;
|
||||
begin
|
||||
Result := IndexOfTabAt(P);
|
||||
if Result <> -1 then
|
||||
Result := TabToPageIndex(Result);
|
||||
end;
|
||||
|
||||
function TCustomTabControl.TabToPageIndex(AIndex: integer): integer;
|
||||
var
|
||||
I: integer;
|
||||
@ -979,6 +928,57 @@ begin
|
||||
inherited ShowControl(APage);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfTabAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the visible tab at the client position.
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfTabAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result := IndexOfTabAt(Point(X, Y));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfTabAt(P: TPoint): Integer;
|
||||
|
||||
Returns the index of the visible tab at the client position.
|
||||
For example:
|
||||
Index:=NoteBook1.IndexOfTabAt(
|
||||
NoteBook1.ScreenToClient(Mouse.CursorPos));
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfTabAt(P: TPoint): Integer;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
Result := TWSCustomTabControlClass(WidgetSetClass).GetTabIndexAtPos(Self, P)
|
||||
else
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the page at the client position.
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result := IndexOfPageAt(Point(X, Y));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
|
||||
Returns the index of the page at the client position.
|
||||
For example:
|
||||
Index:=NoteBook1.IndexOfPageAt(
|
||||
NoteBook1.ScreenToClient(Mouse.CursorPos));
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.IndexOfPageAt(P: TPoint): Integer;
|
||||
begin
|
||||
Result := IndexOfTabAt(P);
|
||||
if Result <> -1 then
|
||||
Result := TabToPageIndex(Result);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
method TCustomTabControl UpdateTabProperties
|
||||
Params: none
|
||||
|
@ -165,6 +165,26 @@ begin
|
||||
if NextPage<>nil then ActivePage:=NextPage;
|
||||
end;
|
||||
|
||||
function TPageControl.IndexOfTabAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result:=inherited IndexOfTabAt(X, Y);
|
||||
end;
|
||||
|
||||
function TPageControl.IndexOfTabAt(P: TPoint): Integer;
|
||||
begin
|
||||
Result:=inherited IndexOfTabAt(P);
|
||||
end;
|
||||
|
||||
function TPageControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result:=inherited IndexOfPageAt(X, Y);
|
||||
end;
|
||||
|
||||
function TPageControl.IndexOfPageAt(P: TPoint): Integer;
|
||||
begin
|
||||
Result:=inherited IndexOfPageAt(P);
|
||||
end;
|
||||
|
||||
// Convenience routine, to make the TPageControl more intuitive to use
|
||||
// A Lazarus addition
|
||||
function TPageControl.AddTabSheet: TTabSheet;
|
||||
|
@ -790,16 +790,6 @@ begin
|
||||
Result:=TTabControlStrings(FTabs).IndexOfTabAt(P.x, P.y);
|
||||
end;
|
||||
|
||||
function TTabControl.IndexOfPageAt(X, Y: Integer): Integer;
|
||||
begin
|
||||
Result:=TTabControlStrings(FTabs).IndexOfTabAt(X,Y);
|
||||
end;
|
||||
|
||||
function TTabControl.IndexOfPageAt(P: TPoint): Integer;
|
||||
begin
|
||||
Result:=TTabControlStrings(FTabs).IndexOfTabAt(P.x, P.y);
|
||||
end;
|
||||
|
||||
function TTabControl.GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||
begin
|
||||
Result:=TTabControlStrings(FTabs).GetHitTestInfoAt(X,Y);
|
||||
|
Loading…
Reference in New Issue
Block a user