mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:39:14 +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;
|
function DialogChar(var Message: TLMKey): boolean; override;
|
||||||
procedure InternalSetPageIndex(AValue: Integer); // No OnChange
|
procedure InternalSetPageIndex(AValue: Integer); // No OnChange
|
||||||
procedure ShowControl(APage: TControl); override;
|
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;
|
procedure UpdateTabProperties; virtual;
|
||||||
class function GetControlClassDefaultSize: TSize; override;
|
class function GetControlClassDefaultSize: TSize; override;
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
@ -482,10 +486,6 @@ type
|
|||||||
function GetCapabilities: TNoteBookCapabilities; virtual;
|
function GetCapabilities: TNoteBookCapabilities; virtual;
|
||||||
function TabToPageIndex(AIndex: integer): integer;
|
function TabToPageIndex(AIndex: integer): integer;
|
||||||
function PageToTabIndex(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
|
public
|
||||||
procedure DoCloseTabClicked(APage: TCustomPage); virtual;
|
procedure DoCloseTabClicked(APage: TCustomPage); virtual;
|
||||||
property Images: TCustomImageList read FImages write SetImages;
|
property Images: TCustomImageList read FImages write SetImages;
|
||||||
@ -589,6 +589,10 @@ type
|
|||||||
GoForward, CheckTabVisible: Boolean): TTabSheet;
|
GoForward, CheckTabVisible: Boolean): TTabSheet;
|
||||||
procedure SelectNextPage(GoForward: Boolean);
|
procedure SelectNextPage(GoForward: Boolean);
|
||||||
procedure SelectNextPage(GoForward: Boolean; CheckTabVisible: 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;
|
function AddTabSheet: TTabSheet;
|
||||||
property ActivePageIndex: Integer read GetActivePageIndex
|
property ActivePageIndex: Integer read GetActivePageIndex
|
||||||
write SetActivePageIndex;
|
write SetActivePageIndex;
|
||||||
@ -839,8 +843,6 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function IndexOfTabAt(X, Y: Integer): Integer; override;
|
function IndexOfTabAt(X, Y: Integer): Integer; override;
|
||||||
function IndexOfTabAt(P: TPoint): 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 GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||||
function GetImageIndex(ATabIndex: Integer): Integer; override;
|
function GetImageIndex(ATabIndex: Integer): Integer; override;
|
||||||
function IndexOfTabWithCaption(const TabCaption: string): Integer;
|
function IndexOfTabWithCaption(const TabCaption: string): Integer;
|
||||||
|
@ -455,57 +455,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
function TCustomTabControl.TabToPageIndex(AIndex: integer): integer;
|
||||||
var
|
var
|
||||||
I: integer;
|
I: integer;
|
||||||
@ -979,6 +928,57 @@ begin
|
|||||||
inherited ShowControl(APage);
|
inherited ShowControl(APage);
|
||||||
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;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
method TCustomTabControl UpdateTabProperties
|
method TCustomTabControl UpdateTabProperties
|
||||||
Params: none
|
Params: none
|
||||||
|
@ -165,6 +165,26 @@ begin
|
|||||||
if NextPage<>nil then ActivePage:=NextPage;
|
if NextPage<>nil then ActivePage:=NextPage;
|
||||||
end;
|
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
|
// Convenience routine, to make the TPageControl more intuitive to use
|
||||||
// A Lazarus addition
|
// A Lazarus addition
|
||||||
function TPageControl.AddTabSheet: TTabSheet;
|
function TPageControl.AddTabSheet: TTabSheet;
|
||||||
|
@ -790,16 +790,6 @@ begin
|
|||||||
Result:=TTabControlStrings(FTabs).IndexOfTabAt(P.x, P.y);
|
Result:=TTabControlStrings(FTabs).IndexOfTabAt(P.x, P.y);
|
||||||
end;
|
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;
|
function TTabControl.GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||||
begin
|
begin
|
||||||
Result:=TTabControlStrings(FTabs).GetHitTestInfoAt(X,Y);
|
Result:=TTabControlStrings(FTabs).GetHitTestInfoAt(X,Y);
|
||||||
|
Loading…
Reference in New Issue
Block a user