LCL: TTabControl: TabStop handling workaround. Issue #30305

git-svn-id: trunk@52742 -
This commit is contained in:
ondrej 2016-07-24 07:03:09 +00:00
parent ac2fa94876
commit 74ee0f9c52
2 changed files with 15 additions and 3 deletions

View File

@ -788,6 +788,7 @@ type
function GetTabHeight: Smallint;
function GetTabIndex: Integer;
function GetTabRectWithBorder: TRect;
function GetTabStop: Boolean;
function GetTabWidth: Smallint;
procedure SetHotTrack(const AValue: Boolean);
procedure SetImages(const AValue: TCustomImageList);
@ -800,6 +801,7 @@ type
procedure SetTabHeight(const AValue: Smallint);
procedure SetTabPosition(AValue: TTabPosition); override;
procedure SetTabs(const AValue: TStrings);
procedure SetTabStop(const AValue: Boolean);
procedure SetTabWidth(const AValue: Smallint);
protected
procedure AddRemovePageHandle(APage: TCustomPage); override;
@ -853,7 +855,7 @@ type
property TabWidth: Smallint read GetTabWidth write SetTabWidth default 0;
property TabIndex: Integer read GetTabIndex write SetTabIndex default -1;
property Tabs: TStrings read FTabs write SetTabs;
property TabStop default True;
property TabStop: Boolean read GetTabStop write SetTabStop default true; // workaround, see #30305
//
property Align;
property Anchors;

View File

@ -505,6 +505,11 @@ begin
FTabs.Assign(AValue);
end;
procedure TTabControl.SetTabStop(const AValue: Boolean);
begin
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;
end;
procedure TTabControl.SetTabWidth(const AValue: Smallint);
begin
TTabControlStrings(FTabs).TabWidth:=AValue;
@ -680,6 +685,11 @@ begin
end;
end;
function TTabControl.GetTabStop: Boolean;
begin
Result := TTabControlNoteBookStrings(FTabs).NoteBook.TabStop;
end;
procedure TTabControl.AdjustClientRect(var ARect: TRect);
begin
AdjustDisplayRect(ARect);
@ -700,8 +710,8 @@ begin
FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := @ImageListChange;
FTabs := CreateTabNoteBookStrings;
//Set FTab's internal NoteBook.TabStop to False, otherwise TTabControl can always be tabbed into (Issue #0021332)
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := False;
TWinControl(Self).TabStop := False; // workaround, see #30305
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := True;
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
BorderWidth:=0;