View Issue Details

IDProjectCategoryView StatusLast Update
0025870LazarusLCLpublic2014-03-17 16:39
ReporterMichael Van Canneyt Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformAllOSAll 
Product Version1.2.0 
Summary0025870: TCustomButton.Click is protected
DescriptionTCustomButton.Click is protected in the LCL.
In the VCL, TCustomButton.Click is public.

Seeing that TButton.Click just calls inherited, I think that the best solution is to make TCustomButton.Click public and remove the TButton.Click
Steps To Reproduce1. Drop button on form (Button1).
2. Create function:

Function TForm1.GetCustomButton : TCustomButton;

begin
  Result:=Button1;
end;

3. Create OnShow event:

Procedure TForm1.OnShow(Sender : TObject)
Var
  B : TCustomButton;
begin
  B:=GetCustomButton;
  if Assigned(B) then
    B.Click;
end;

Fails in LCL, works in Delphi
TagsNo tags attached.
Fixed in Revisionr44451
LazTarget-
WidgetsetGTK, GTK 2, Win32/Win64, WinCE, Carbon, Cocoa, QT, fpGUI, CustomDrawn
Attached Files

Activities

Juha Manninen

2014-03-16 23:48

developer   ~0073753

Done.
The same change was required for TCustomBitBtn and TTICustomButton but I don't see any problem with it.

Zeljan Rikalo

2014-03-17 07:47

developer   ~0073759

Shall we merge it to 1.2.2 ?

Juha Manninen

2014-03-17 08:32

developer   ~0073764

> Shall we merge it to 1.2.2 ?

I don't know. It is up to you.
This is somewhere between a bug fix and a feature.

Zeljan Rikalo

2014-03-17 11:22

developer   ~0073770

@Juha we must discuss such patches on mailing list (and other issues which I marked as possible merging). This is not feature (but changes interface section), but bug (delphi compatibile).
While agreement is that only bug fixes goes to stable fixes this should go there IMO. Please add it to the fixes by yourself.

Issue History

Date Modified Username Field Change
2014-03-16 11:13 Michael Van Canneyt New Issue
2014-03-16 23:45 Juha Manninen Assigned To => Juha Manninen
2014-03-16 23:45 Juha Manninen Status new => assigned
2014-03-16 23:48 Juha Manninen Fixed in Revision => r44451
2014-03-16 23:48 Juha Manninen Note Added: 0073753
2014-03-16 23:48 Juha Manninen Status assigned => resolved
2014-03-16 23:48 Juha Manninen Resolution open => fixed
2014-03-17 07:47 Zeljan Rikalo Note Added: 0073759
2014-03-17 08:32 Juha Manninen Note Added: 0073764
2014-03-17 11:22 Zeljan Rikalo Note Added: 0073770