mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 07:58:07 +02:00
Merged revision(s) 56344 #41299ef7d0, 56350 #1afbcdb13b, 56353 #c3f41244e0 from trunk:
LCL: revert r56162, r56031, r55890 #9ac706fc7a (TabStop handling) ........ LCL: revert r55892 #240f1fb4dd ........ Revert r56181 #c5637ad72a (Fix firing an OnChange and setting Modified when setting Text inside OnChange and new Text = old Text. Issue #0032602.) It causes a regression. ........ git-svn-id: branches/fixes_1_8@56409 -
This commit is contained in:
parent
85a0dce834
commit
92528bf6f4
@ -352,12 +352,6 @@ begin
|
||||
SetInitialBounds(0, 0, CX, CY);
|
||||
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;
|
||||
begin
|
||||
Result := AValue;
|
||||
|
@ -141,7 +141,6 @@ type
|
||||
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default 100;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure GetTabOrderList(List: TFPList); override;
|
||||
function GetLimitedValue(const AValue: Double): Double; virtual;
|
||||
function ValueToStr(const AValue: Double): String; virtual;
|
||||
function StrToValue(const S: String): Double; virtual;
|
||||
|
@ -502,6 +502,8 @@ type
|
||||
property TabHeight: Smallint read FTabHeight write SetTabHeight default 0;
|
||||
property TabPosition: TTabPosition read FTabPosition write SetTabPosition default tpTop;
|
||||
property TabWidth: Smallint read FTabWidth write SetTabWidth default 0;
|
||||
published
|
||||
property TabStop default true;
|
||||
end;
|
||||
|
||||
{ TTabSheet }
|
||||
@ -626,7 +628,7 @@ type
|
||||
property TabIndex;
|
||||
property TabOrder;
|
||||
property TabPosition;
|
||||
property TabStop default true;
|
||||
property TabStop;
|
||||
property TabWidth;
|
||||
property Visible;
|
||||
property OnChange;
|
||||
@ -796,7 +798,7 @@ type
|
||||
function GetScrollOpposite: Boolean;
|
||||
function GetTabIndex: Integer;
|
||||
function GetTabRectWithBorder: TRect;
|
||||
function GetTabStop: Boolean; override;
|
||||
function GetTabStop: Boolean;
|
||||
procedure SetHotTrack(const AValue: Boolean);
|
||||
procedure SetImages(const AValue: TCustomImageList);
|
||||
procedure SetMultiLine(const AValue: Boolean);
|
||||
@ -808,7 +810,7 @@ type
|
||||
procedure SetTabHeight(AValue: Smallint);
|
||||
procedure SetTabPosition(AValue: TTabPosition); override;
|
||||
procedure SetTabs(const AValue: TStrings);
|
||||
procedure SetTabStop(AValue: Boolean); override;
|
||||
procedure SetTabStop(const AValue: Boolean);
|
||||
procedure SetTabWidth(AValue: Smallint);
|
||||
protected
|
||||
procedure SetOptions(const AValue: TCTabControlOptions); override;
|
||||
@ -818,7 +820,6 @@ type
|
||||
procedure Change; override;
|
||||
procedure CreateWnd; override;
|
||||
procedure DestroyHandle; override;
|
||||
procedure GetTabOrderList(List: TFPList); override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
procedure SetDragMode(Value: TDragMode); override;
|
||||
procedure SetTabIndex(Value: Integer); virtual;
|
||||
@ -865,7 +866,7 @@ type
|
||||
property TabHeight: Smallint read FTabHeight write SetTabHeight 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 TabWidth: Smallint read FTabWidth write SetTabWidth default 0;
|
||||
//
|
||||
property Align;
|
||||
|
@ -1984,6 +1984,7 @@ type
|
||||
procedure SetBorderWidth(Value: TBorderWidth);
|
||||
procedure SetParentWindow(const AValue: HWND);
|
||||
procedure SetTabOrder(NewTabOrder: TTabOrder);
|
||||
procedure SetTabStop(NewTabStop: Boolean);
|
||||
procedure SetUseDockManager(const AValue: Boolean);
|
||||
procedure UpdateTabOrder(NewTabOrder: TTabOrder);
|
||||
procedure Insert(AControl: TControl);
|
||||
@ -2028,14 +2029,12 @@ type
|
||||
WithThemeSpace: Boolean); override;
|
||||
procedure GetPreferredSizeClientFrame(out aWidth, aHeight: integer); virtual;
|
||||
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
||||
function GetTabStop: Boolean; virtual;
|
||||
function ChildClassAllowed(ChildClass: TClass): boolean; override;
|
||||
procedure PaintControls(DC: HDC; First: TControl);
|
||||
procedure PaintHandler(var TheMessage: TLMPaint);
|
||||
procedure PaintWindow(DC: HDC); virtual;
|
||||
procedure CreateBrush; virtual;
|
||||
procedure ScaleControls(Multiplier, Divider: Integer); virtual;
|
||||
procedure SetTabStop(NewTabStop: Boolean); virtual;
|
||||
procedure ChangeScale(Multiplier, Divider: Integer); override;
|
||||
protected
|
||||
// messages
|
||||
@ -2182,7 +2181,7 @@ type
|
||||
property Handle: HWND read GetHandle write SetHandle;
|
||||
property IsResizing: Boolean read GetIsResizing;
|
||||
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 OnAlignPosition: TAlignPositionEvent read FOnAlignPosition write FOnAlignPosition;
|
||||
property OnDockDrop: TDockDropEvent read FOnDockDrop write FOnDockDrop;
|
||||
|
@ -103,7 +103,6 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure GetTabOrderList(List: TFPList); override;
|
||||
end;
|
||||
|
||||
{ TEditButton }
|
||||
@ -1078,7 +1077,6 @@ begin
|
||||
inherited Create(AOwner);
|
||||
FButtonOnlyWhenFocused := False;
|
||||
FocusOnButtonClick := False;
|
||||
TabStop := True;
|
||||
|
||||
SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY);
|
||||
|
||||
@ -1096,12 +1094,6 @@ begin
|
||||
inherited Destroy;
|
||||
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 }
|
||||
|
||||
|
@ -120,6 +120,7 @@ type
|
||||
function GetSelLength: Integer;
|
||||
function GetSelStart: Integer;
|
||||
function GetSelText: String;
|
||||
function GetTabStop: Boolean;
|
||||
function GetTextHint: TTranslateString;
|
||||
function GetTextHintFontColor: TColor; //Remove in 1.9
|
||||
function GetTextHintFontStyle: TFontStyles; //Remove in 1.9
|
||||
@ -174,6 +175,7 @@ type
|
||||
procedure SetSelStart(AValue: Integer);
|
||||
procedure SetSelText(AValue: String);
|
||||
procedure SetSpacing(const Value: integer);
|
||||
procedure SetTabStop(AValue: Boolean);
|
||||
procedure SetTextHint(AValue: TTranslateString);
|
||||
protected
|
||||
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
|
||||
@ -235,14 +237,12 @@ type
|
||||
function EditCanModify: Boolean; virtual;
|
||||
procedure GetSel(out _SelStart: Integer; out _SelStop: Integer);
|
||||
function GetSpacing: Integer; virtual;
|
||||
function GetTabStop: Boolean; override;
|
||||
procedure SetSel(const _SelStart: Integer; _SelStop: Integer);
|
||||
procedure Loaded; override;
|
||||
procedure Reset; virtual;
|
||||
procedure SetAutoSize(AValue: Boolean); override;
|
||||
procedure SetColor(AValue: TColor); reintroduce;
|
||||
procedure SetCursor(AValue: TCursor); override;
|
||||
procedure SetTabStop(AValue: Boolean); override;
|
||||
procedure ShouldAutoAdjust(var AWidth, AHeight: Boolean); override;
|
||||
|
||||
property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True;
|
||||
@ -413,10 +413,18 @@ implementation
|
||||
|
||||
function TGEEdit.PerformTab(ForwardTab: boolean): boolean;
|
||||
begin
|
||||
if Assigned(Owner) and (Owner is TCustomAbstractGroupedEdit) then
|
||||
Result := TCustomAbstractGroupedEdit(Owner).PerformTab(ForwardTab)
|
||||
//if not Forward then inherited PerFormTab will set focus to the owning
|
||||
//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
|
||||
Result := False;
|
||||
begin
|
||||
if Assigned(Owner) and (Owner is TCustomAbstractGroupedEdit) then
|
||||
Result := TCustomAbstractGroupedEdit(Owner).PerformTab(ForwardTab)
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TCustomAbstractGroupedEdit }
|
||||
@ -839,11 +847,6 @@ begin
|
||||
FEdit.Cursor := AValue;
|
||||
end;
|
||||
|
||||
procedure TCustomAbstractGroupedEdit.SetTabStop(AValue: Boolean);
|
||||
begin
|
||||
FEdit.TabStop := AValue;
|
||||
end;
|
||||
|
||||
procedure TCustomAbstractGroupedEdit.ShouldAutoAdjust(var AWidth,
|
||||
AHeight: Boolean);
|
||||
begin
|
||||
@ -1126,6 +1129,11 @@ begin
|
||||
if not (csLoading in ComponentState) then UpdateSpacing;
|
||||
end;
|
||||
|
||||
procedure TCustomAbstractGroupedEdit.SetTabStop(AValue: Boolean);
|
||||
begin
|
||||
FEdit.TabStop := AValue;
|
||||
end;
|
||||
|
||||
procedure TCustomAbstractGroupedEdit.SetTextHint(AValue: TTranslateString);
|
||||
begin
|
||||
FEdit.TextHint := AValue;
|
||||
@ -1183,6 +1191,7 @@ begin
|
||||
FDirectInput := True;
|
||||
FIsReadOnly := False;
|
||||
TabStop := True;
|
||||
inherited TabStop := False;
|
||||
FocusOnBuddyClick := False;
|
||||
FSpacing := 0;
|
||||
SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY);
|
||||
|
@ -81,7 +81,7 @@ begin
|
||||
BorderStyle := bsSingle;
|
||||
FAutoSelect := True;
|
||||
FAutoSelected := False;
|
||||
FTextChangedByRealSetTextCounter := 0;
|
||||
FTextChangedByRealSetText := False;
|
||||
AutoSize := True;
|
||||
// Accessibility
|
||||
AccessibleRole := larTextEditorSingleline;
|
||||
@ -548,11 +548,10 @@ begin
|
||||
if (FEmulatedTextHintStatus=thsShowing) and (AValue<>'') then
|
||||
HideEmulatedTextHint;
|
||||
|
||||
Inc(FTextChangedByRealSetTextCounter);
|
||||
FTextChangedByRealSetText := True;
|
||||
Modified := False;
|
||||
inherited RealSetText(AValue);
|
||||
Dec(FTextChangedByRealSetTextCounter);
|
||||
if (FTextChangedByRealSetTextCounter < 0) then FTextChangedByRealSetTextCounter := 0;
|
||||
FTextChangedByRealSetText := False;
|
||||
|
||||
if (FEmulatedTextHintStatus=thsHidden) and CanShowEmulatedTextHint then
|
||||
ShowEmulatedTextHint;
|
||||
@ -602,7 +601,7 @@ begin
|
||||
begin
|
||||
if ([csLoading,csDestroying]*ComponentState=[]) then
|
||||
begin
|
||||
if (FTextChangedByRealSetTextCounter = 0) then
|
||||
if not FTextChangedByRealSetText then
|
||||
Modified := True;
|
||||
Change;
|
||||
end;
|
||||
|
@ -532,10 +532,9 @@ begin
|
||||
FTabs.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TTabControl.SetTabStop(AValue: Boolean);
|
||||
procedure TTabControl.SetTabStop(const AValue: Boolean);
|
||||
begin
|
||||
if Assigned(FTabs) then
|
||||
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;
|
||||
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;
|
||||
end;
|
||||
|
||||
procedure TTabControl.SetTabWidth(AValue: Smallint);
|
||||
@ -605,14 +604,6 @@ begin
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
procedure TTabControl.GetTabOrderList(List: TFPList);
|
||||
begin
|
||||
// just the TTabControlNoteBookStrings not the container should be tabable, see issue #32455
|
||||
List.Remove(Self);
|
||||
if Assigned(FTabs) then
|
||||
List.Add(TTabControlNoteBookStrings(FTabs).NoteBook);
|
||||
end;
|
||||
|
||||
procedure TTabControl.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
@ -763,7 +754,8 @@ begin
|
||||
FImageChangeLink := TChangeLink.Create;
|
||||
FImageChangeLink.OnChange := @ImageListChange;
|
||||
FTabs := CreateTabNoteBookStrings;
|
||||
TabStop := True;
|
||||
TWinControl(Self).TabStop := False; // workaround, see #30305
|
||||
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := True;
|
||||
with GetControlClassDefaultSize do
|
||||
SetInitialBounds(0, 0, CX, CY);
|
||||
BorderWidth:=0;
|
||||
|
@ -3901,11 +3901,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TWinControl.GetTabStop: Boolean;
|
||||
begin
|
||||
Result := FTabStop;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function TWinControl.ChildClassAllowed(ChildClass: TClass): boolean;
|
||||
|
||||
@ -4242,6 +4237,15 @@ begin
|
||||
UpdateTabOrder(NewTabOrder);
|
||||
end;
|
||||
|
||||
procedure TWinControl.SetTabStop(NewTabStop: Boolean);
|
||||
begin
|
||||
if FTabStop = NewTabStop then
|
||||
Exit;
|
||||
FTabStop := NewTabStop;
|
||||
UpdateTabOrder(FTabOrder);
|
||||
Perform(CM_TABSTOPCHANGED, 0, 0);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TControl UpdateTabOrder
|
||||
------------------------------------------------------------------------------}
|
||||
@ -4976,15 +4980,6 @@ begin
|
||||
Controls[i].ChangeScale(Multiplier, Divider);
|
||||
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);
|
||||
var
|
||||
i: Integer;
|
||||
@ -8269,11 +8264,7 @@ begin
|
||||
begin
|
||||
WSSetText(AValue);
|
||||
InvalidatePreferredSize;
|
||||
//don't call inherited (=TControl.)RealSetText(AValue) since it can issue a
|
||||
//second OnChange if RealSetText is called from within OnChange (#0032602)
|
||||
//instead just update FCaption.
|
||||
//WSSetText already makes sure an OnChange will be performed
|
||||
FCaption := AValue;
|
||||
inherited RealSetText(AValue);
|
||||
AdjustSize;
|
||||
end
|
||||
else inherited RealSetText(AValue);
|
||||
|
@ -727,7 +727,7 @@ type
|
||||
FOnChange: TNotifyEvent;
|
||||
FSelLength: integer;
|
||||
FSelStart: integer;
|
||||
FTextChangedByRealSetTextCounter: Integer;
|
||||
FTextChangedByRealSetText: Boolean;
|
||||
FTextHint: TTranslateString;
|
||||
function GetTextHintFontColor: TColor; //Remove in 1.9
|
||||
function GetTextHintFontStyle: TFontStyles; //Remove in 1.9
|
||||
|
Loading…
Reference in New Issue
Block a user