Merged revision(s) 55890 #9ac706fc7a, 55892 #240f1fb4dd from trunk:

LCL: TCustomEditButton: Fixed TDateEdit.SelectNext. Issue #32335
........
LCL: TTabControl: Fixed AV on creating control. Issue #32455.
........

git-svn-id: branches/fixes_1_8@55899 -
This commit is contained in:
maxim 2017-09-22 23:09:00 +00:00
parent e69fa339ea
commit d9f1dd6721
6 changed files with 49 additions and 28 deletions

View File

@ -502,8 +502,6 @@ 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 }
@ -628,7 +626,7 @@ type
property TabIndex;
property TabOrder;
property TabPosition;
property TabStop;
property TabStop default true;
property TabWidth;
property Visible;
property OnChange;
@ -798,7 +796,7 @@ type
function GetScrollOpposite: Boolean;
function GetTabIndex: Integer;
function GetTabRectWithBorder: TRect;
function GetTabStop: Boolean;
function GetTabStop: Boolean; override;
procedure SetHotTrack(const AValue: Boolean);
procedure SetImages(const AValue: TCustomImageList);
procedure SetMultiLine(const AValue: Boolean);
@ -810,7 +808,7 @@ type
procedure SetTabHeight(AValue: Smallint);
procedure SetTabPosition(AValue: TTabPosition); override;
procedure SetTabs(const AValue: TStrings);
procedure SetTabStop(const AValue: Boolean);
procedure SetTabStop(AValue: Boolean); override;
procedure SetTabWidth(AValue: Smallint);
protected
procedure SetOptions(const AValue: TCTabControlOptions); override;
@ -820,6 +818,7 @@ 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;
@ -866,7 +865,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: Boolean read GetTabStop write SetTabStop default true; // workaround, see #30305
property TabStop default true;
property TabWidth: Smallint read FTabWidth write SetTabWidth default 0;
//
property Align;

View File

@ -1984,7 +1984,6 @@ 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);
@ -2029,12 +2028,14 @@ 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
@ -2181,7 +2182,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 FTabStop write SetTabStop default false;
property TabStop: Boolean read GetTabStop 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;

View File

@ -103,6 +103,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure GetTabOrderList(List: TFPList); override;
end;
{ TEditButton }
@ -1077,6 +1078,7 @@ begin
inherited Create(AOwner);
FButtonOnlyWhenFocused := False;
FocusOnButtonClick := False;
TabStop := True;
SetInitialBounds(0, 0, GetControlClassDefaultSize.CX, GetControlClassDefaultSize.CY);
@ -1094,6 +1096,12 @@ 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 }

View File

@ -120,7 +120,6 @@ 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
@ -175,7 +174,6 @@ 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;
@ -237,12 +235,14 @@ 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;
@ -847,6 +847,11 @@ begin
FEdit.Cursor := AValue;
end;
procedure TCustomAbstractGroupedEdit.SetTabStop(AValue: Boolean);
begin
FEdit.TabStop := AValue;
end;
procedure TCustomAbstractGroupedEdit.ShouldAutoAdjust(var AWidth,
AHeight: Boolean);
begin
@ -1129,11 +1134,6 @@ 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;

View File

@ -532,9 +532,10 @@ begin
FTabs.Assign(AValue);
end;
procedure TTabControl.SetTabStop(const AValue: Boolean);
procedure TTabControl.SetTabStop(AValue: Boolean);
begin
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;
if Assigned(FTabs) then
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := AValue;
end;
procedure TTabControl.SetTabWidth(AValue: Smallint);
@ -604,6 +605,14 @@ 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
@ -754,8 +763,7 @@ begin
FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := @ImageListChange;
FTabs := CreateTabNoteBookStrings;
TWinControl(Self).TabStop := False; // workaround, see #30305
TTabControlNoteBookStrings(FTabs).NoteBook.TabStop := True;
TabStop := True;
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
BorderWidth:=0;

View File

@ -3901,6 +3901,11 @@ begin
end;
end;
function TWinControl.GetTabStop: Boolean;
begin
Result := FTabStop;
end;
{-------------------------------------------------------------------------------
function TWinControl.ChildClassAllowed(ChildClass: TClass): boolean;
@ -4237,15 +4242,6 @@ 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
------------------------------------------------------------------------------}
@ -4980,6 +4976,15 @@ 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;