LCL: revert r56162, r56031, r55890 #9ac706fc7a (TabStop handling)

git-svn-id: trunk@56344 -
This commit is contained in:
ondrej 2017-11-10 08:19:00 +00:00
parent fe76598fe9
commit 41299ef7d0
8 changed files with 33 additions and 45 deletions

View File

@ -368,12 +368,6 @@ begin
SetInitialBounds(0, 0, CX, CY); SetInitialBounds(0, 0, CX, CY);
end; end;
procedure TCustomFloatSpinEditEx.GetTabOrderList(List: TFPList);
begin
// just the TCustomEditButton as container should be tabable, see issue #32335
// so no inherited adding of child controls
end;
function TCustomFloatSpinEditEx.GetLimitedValue(const AValue: Double): Double; function TCustomFloatSpinEditEx.GetLimitedValue(const AValue: Double): Double;
begin begin
Result := AValue; Result := AValue;

View File

@ -144,7 +144,6 @@ type
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default 100; property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default 100;
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
procedure GetTabOrderList(List: TFPList); override;
function GetLimitedValue(const AValue: Double): Double; virtual; function GetLimitedValue(const AValue: Double): Double; virtual;
function ValueToStr(const AValue: Double): String; virtual; function ValueToStr(const AValue: Double): String; virtual;
function StrToValue(const S: String): Double; virtual; function StrToValue(const S: String): Double; virtual;

View File

@ -793,7 +793,7 @@ type
function GetScrollOpposite: Boolean; function GetScrollOpposite: Boolean;
function GetTabIndex: Integer; function GetTabIndex: Integer;
function GetTabRectWithBorder: TRect; function GetTabRectWithBorder: TRect;
function GetTabStop: Boolean; override; function GetTabStop: Boolean;
procedure SetHotTrack(const AValue: Boolean); procedure SetHotTrack(const AValue: Boolean);
procedure SetImages(const AValue: TCustomImageList); procedure SetImages(const AValue: TCustomImageList);
procedure SetMultiLine(const AValue: Boolean); procedure SetMultiLine(const AValue: Boolean);
@ -805,7 +805,7 @@ type
procedure SetTabHeight(AValue: Smallint); procedure SetTabHeight(AValue: Smallint);
procedure SetTabPosition(AValue: TTabPosition); override; procedure SetTabPosition(AValue: TTabPosition); override;
procedure SetTabs(const AValue: TStrings); procedure SetTabs(const AValue: TStrings);
procedure SetTabStop(AValue: Boolean); override; procedure SetTabStop(const AValue: Boolean);
procedure SetTabWidth(AValue: Smallint); procedure SetTabWidth(AValue: Smallint);
protected protected
procedure SetOptions(const AValue: TCTabControlOptions); override; procedure SetOptions(const AValue: TCTabControlOptions); override;

View File

@ -1988,6 +1988,7 @@ type
procedure SetBorderWidth(Value: TBorderWidth); procedure SetBorderWidth(Value: TBorderWidth);
procedure SetParentWindow(const AValue: HWND); procedure SetParentWindow(const AValue: HWND);
procedure SetTabOrder(NewTabOrder: TTabOrder); procedure SetTabOrder(NewTabOrder: TTabOrder);
procedure SetTabStop(NewTabStop: Boolean);
procedure SetUseDockManager(const AValue: Boolean); procedure SetUseDockManager(const AValue: Boolean);
procedure UpdateTabOrder(NewTabOrder: TTabOrder); procedure UpdateTabOrder(NewTabOrder: TTabOrder);
procedure Insert(AControl: TControl); procedure Insert(AControl: TControl);
@ -2032,14 +2033,12 @@ type
WithThemeSpace: Boolean); override; WithThemeSpace: Boolean); override;
procedure GetPreferredSizeClientFrame(out aWidth, aHeight: integer); virtual; procedure GetPreferredSizeClientFrame(out aWidth, aHeight: integer); virtual;
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
function GetTabStop: Boolean; virtual;
function ChildClassAllowed(ChildClass: TClass): boolean; override; function ChildClassAllowed(ChildClass: TClass): boolean; override;
procedure PaintControls(DC: HDC; First: TControl); procedure PaintControls(DC: HDC; First: TControl);
procedure PaintHandler(var TheMessage: TLMPaint); procedure PaintHandler(var TheMessage: TLMPaint);
procedure PaintWindow(DC: HDC); virtual; procedure PaintWindow(DC: HDC); virtual;
procedure CreateBrush; virtual; procedure CreateBrush; virtual;
procedure ScaleControls(Multiplier, Divider: Integer); virtual; procedure ScaleControls(Multiplier, Divider: Integer); virtual;
procedure SetTabStop(NewTabStop: Boolean); virtual;
procedure ChangeScale(Multiplier, Divider: Integer); override; procedure ChangeScale(Multiplier, Divider: Integer); override;
protected protected
// messages // messages
@ -2189,7 +2188,7 @@ type
property Handle: HWND read GetHandle write SetHandle; property Handle: HWND read GetHandle write SetHandle;
property IsResizing: Boolean read GetIsResizing; property IsResizing: Boolean read GetIsResizing;
property TabOrder: TTabOrder read GetTabOrder write SetTabOrder default -1; property TabOrder: TTabOrder read GetTabOrder write SetTabOrder default -1;
property TabStop: Boolean read GetTabStop write SetTabStop default false; property TabStop: Boolean read FTabStop write SetTabStop default false;
property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore; property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore;
property OnAlignPosition: TAlignPositionEvent read FOnAlignPosition write FOnAlignPosition; property OnAlignPosition: TAlignPositionEvent read FOnAlignPosition write FOnAlignPosition;
property OnDockDrop: TDockDropEvent read FOnDockDrop write FOnDockDrop; property OnDockDrop: TDockDropEvent read FOnDockDrop write FOnDockDrop;

View File

@ -103,7 +103,6 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure GetTabOrderList(List: TFPList); override;
end; end;
{ TEditButton } { TEditButton }
@ -1075,7 +1074,6 @@ begin
inherited Create(AOwner); inherited Create(AOwner);
FButtonOnlyWhenFocused := False; FButtonOnlyWhenFocused := False;
FocusOnButtonClick := False; FocusOnButtonClick := False;
TabStop := True;
SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY); SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY);
@ -1093,12 +1091,6 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TCustomEditButton.GetTabOrderList(List: TFPList);
begin
// just the TCustomEditButton as container should be tabable, see issue #32335
// so no inherited adding of child controls
end;
{ TCustomControlFilterEdit } { TCustomControlFilterEdit }

View File

@ -118,6 +118,7 @@ type
function GetSelLength: Integer; function GetSelLength: Integer;
function GetSelStart: Integer; function GetSelStart: Integer;
function GetSelText: String; function GetSelText: String;
function GetTabStop: Boolean;
function GetTextHint: TTranslateString; function GetTextHint: TTranslateString;
procedure InternalOnBuddyClick(Sender: TObject); procedure InternalOnBuddyClick(Sender: TObject);
@ -170,6 +171,7 @@ type
procedure SetSelStart(AValue: Integer); procedure SetSelStart(AValue: Integer);
procedure SetSelText(AValue: String); procedure SetSelText(AValue: String);
procedure SetSpacing(const Value: integer); procedure SetSpacing(const Value: integer);
procedure SetTabStop(AValue: Boolean);
procedure SetTextHint(AValue: TTranslateString); procedure SetTextHint(AValue: TTranslateString);
protected protected
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer; procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
@ -231,14 +233,12 @@ type
function EditCanModify: Boolean; virtual; function EditCanModify: Boolean; virtual;
procedure GetSel(out _SelStart: Integer; out _SelStop: Integer); procedure GetSel(out _SelStart: Integer; out _SelStop: Integer);
function GetSpacing: Integer; virtual; function GetSpacing: Integer; virtual;
function GetTabStop: Boolean; override;
procedure SetSel(const _SelStart: Integer; _SelStop: Integer); procedure SetSel(const _SelStart: Integer; _SelStop: Integer);
procedure Loaded; override; procedure Loaded; override;
procedure Reset; virtual; procedure Reset; virtual;
procedure SetAutoSize(AValue: Boolean); override; procedure SetAutoSize(AValue: Boolean); override;
procedure SetColor(AValue: TColor); reintroduce; procedure SetColor(AValue: TColor); reintroduce;
procedure SetCursor(AValue: TCursor); override; procedure SetCursor(AValue: TCursor); override;
procedure SetTabStop(AValue: Boolean); override;
procedure ShouldAutoAdjust(var AWidth, AHeight: Boolean); override; procedure ShouldAutoAdjust(var AWidth, AHeight: Boolean); override;
property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True; property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True;
@ -407,10 +407,18 @@ implementation
function TGEEdit.PerformTab(ForwardTab: boolean): boolean; function TGEEdit.PerformTab(ForwardTab: boolean): boolean;
begin begin
if Assigned(Owner) and (Owner is TCustomAbstractGroupedEdit) then //if not Forward then inherited PerFormTab will set focus to the owning
Result := TCustomAbstractGroupedEdit(Owner).PerformTab(ForwardTab) //TCustomAbstractGroupedEdit, which immediately transfers the focus back to the TGEEdit
//so let TCustomAbstractGroupedEdit do the Performtab in this case
if ForwardTab then
Result := inherited PerformTab(ForwardTab)
else else
Result := False; begin
if Assigned(Owner) and (Owner is TCustomAbstractGroupedEdit) then
Result := TCustomAbstractGroupedEdit(Owner).PerformTab(ForwardTab)
else
Result := False;
end;
end; end;
{ TCustomAbstractGroupedEdit } { TCustomAbstractGroupedEdit }
@ -823,11 +831,6 @@ begin
FEdit.Cursor := AValue; FEdit.Cursor := AValue;
end; end;
procedure TCustomAbstractGroupedEdit.SetTabStop(AValue: Boolean);
begin
FEdit.TabStop := AValue;
end;
procedure TCustomAbstractGroupedEdit.ShouldAutoAdjust(var AWidth, procedure TCustomAbstractGroupedEdit.ShouldAutoAdjust(var AWidth,
AHeight: Boolean); AHeight: Boolean);
begin begin
@ -1110,6 +1113,11 @@ begin
if not (csLoading in ComponentState) then UpdateSpacing; if not (csLoading in ComponentState) then UpdateSpacing;
end; end;
procedure TCustomAbstractGroupedEdit.SetTabStop(AValue: Boolean);
begin
FEdit.TabStop := AValue;
end;
procedure TCustomAbstractGroupedEdit.SetTextHint(AValue: TTranslateString); procedure TCustomAbstractGroupedEdit.SetTextHint(AValue: TTranslateString);
begin begin
FEdit.TextHint := AValue; FEdit.TextHint := AValue;
@ -1167,6 +1175,7 @@ begin
FDirectInput := True; FDirectInput := True;
FIsReadOnly := False; FIsReadOnly := False;
TabStop := True; TabStop := True;
inherited TabStop := False;
FocusOnBuddyClick := False; FocusOnBuddyClick := False;
FSpacing := 0; FSpacing := 0;
SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY); SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY);

View File

@ -532,7 +532,7 @@ begin
FTabs.Assign(AValue); FTabs.Assign(AValue);
end; end;
procedure TTabControl.SetTabStop(AValue: Boolean); procedure TTabControl.SetTabStop(const AValue: Boolean);
begin begin
if Assigned(FTabs) then if Assigned(FTabs) then
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue; TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;

View File

@ -3909,11 +3909,6 @@ begin
end; end;
end; end;
function TWinControl.GetTabStop: Boolean;
begin
Result := FTabStop;
end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
function TWinControl.ChildClassAllowed(ChildClass: TClass): boolean; function TWinControl.ChildClassAllowed(ChildClass: TClass): boolean;
@ -4250,6 +4245,15 @@ begin
UpdateTabOrder(NewTabOrder); UpdateTabOrder(NewTabOrder);
end; end;
procedure TWinControl.SetTabStop(NewTabStop: Boolean);
begin
if FTabStop = NewTabStop then
Exit;
FTabStop := NewTabStop;
UpdateTabOrder(FTabOrder);
Perform(CM_TABSTOPCHANGED, 0, 0);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
TControl UpdateTabOrder TControl UpdateTabOrder
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
@ -4984,15 +4988,6 @@ begin
Controls[i].ChangeScale(Multiplier, Divider); Controls[i].ChangeScale(Multiplier, Divider);
end; end;
procedure TWinControl.SetTabStop(NewTabStop: Boolean);
begin
if FTabStop = NewTabStop then
Exit;
FTabStop := NewTabStop;
UpdateTabOrder(FTabOrder);
Perform(CM_TABSTOPCHANGED, 0, 0);
end;
procedure TWinControl.ChangeScale(Multiplier, Divider: Integer); procedure TWinControl.ChangeScale(Multiplier, Divider: Integer);
var var
i: Integer; i: Integer;