[Lazarus] OI / App crash - components with published interfaces

2018-02-17 Thread Andreas Frieß via Lazarus
I have an appcrash when i use components with interfaces in the 
published part. See also Bug 32919. I have now simpilied the problem and 
isolated from Lazarus itself.


The component is on https://github.com/afriess/LazarusBug0032919 in 
OITestBasic, together with the testproject shown here.


Somethigs goes wrong , if call free for the Form ( SIGSEGV ). A sencond 
issue is, i did not see the value of the property ObjectHasInterface in 
the OI.  But i see the value if i click on the Combobox.


My Question:

Did i miss something in the definition of the Components ?

 definition components ---

type
  // define the Interface
  ITestInterface =  interface
  function OnlyDummy: integer;
    end;

  { TIntfComp }
  TIntfComp = class(TComponent)
  private
    FObjectHasInterface: ITestInterface;
    function GetObjectHasInterface: ITestInterface;
    procedure SetObjectHasInterface(AValue: ITestInterface);
  published
    property ObjectHasInterface: ITestInterface read 
GetObjectHasInterface write SetObjectHasInterface;

  end;

  { TCompHasIntf }
  TCompHasIntf = class(TComponent, ITestInterface)
  public
    function OnlyDummy: integer;
  end;

- test programm 

    DUT := TObjectInspectorDlg.Create(nil);
    DUT.Caption:= 'My ObjectInspector';

    // create the PropertyEditorHook (the interface to the properties)
    ThePropertyEditorHook:=TPropertyEditorHook.Create(DUT);
    DUT.PropertyEditorHook:=ThePropertyEditorHook;

    // Create components
    ATestForm :=  TForm.Create(nil);
    ATestForm.Name:= 'Main';

    ATestIntf := TIntfComp.Create(ATestForm);   // This componnets 
can hold a component with interface

    ATestIntf.Name := 'ATestIntf';
    ATestHasIntf := TCompHasIntf.Create(ATestForm); // This component 
has an Interface

    ATestHasIntf.Name:= 'ATestHasIntf';
    ATestIntf.ObjectHasInterface := ATestHasIntf;
    ATestIntf.GetParentComponent;
    ThePropertyEditorHook.LookupRoot:=ATestForm;

    PerList:=TPersistentSelectionList.Create;
    PerList.Add(ATestForm);
    DUT.Selection:=PerList;
    PerList.Free;

    DUT.Show;

...

  if DUT <> nil then begin
    ATestForm.Free;   // <- Appcrash
    FreeAndNil(DUT);
  end;
--- End --


-- Stack 

#0 fpc_intf_decr_ref at :0
#1 fpc_finalize at :0
#2 ?? at :0
#3 SYSTEM_$$_SETVARIANTMANAGER$TVARIANTMANAGER at :0
#4 ?? at :0
#5 DESTROY(0x3aa8868, 0x0) at include\control.inc:5146
#6 DESTROY(0x3aa8868, 0x0) at include\wincontrol.inc:6626
#7 DESTROY(0x3aa8868, 0x0) at include\customcontrol.inc:40
#8 DESTROY(0x3aa8868, 0x0) at include\scrollingwincontrol.inc:316
#9 DESTROY(0x3aa8868, 0x1) at include\customform.inc:212
#10 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#11 FREEUSEDOBJECTS(0x3ad46f8) at uoitest.pas:161
#12 BUFREECLICK(0x3ad46f8, 0x3ad5878) at uoitest.pas:139
#13 CLICK(0x3ad5878) at include\control.inc:2929
#14 CLICK(0x3ad5878) at include\buttoncontrol.inc:55
#15 CLICK(0x3ad5878) at include\buttons.inc:169
#16 WMDEFAULTCLICKED(0x3ad5878, {MSG = 66567, WPARAM = 0, LPARAM = 0, 
RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, 
LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, 
RESULTFILLER = {}}) at include\buttoncontrol.inc:21

#17 SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal at :0
#18 ?? at :0
#19 VMT_$STDCTRLS_$$_TBUTTONCONTROL at :0
#20 VMT_$STDCTRLS_$$_TCUSTOMSTATICTEXT$indirect at :0
#21 STDCTRLS$_$TBUTTONCONTROL_$__$$_ISCHECKEDSTORED$$BOOLEAN at :0
#22 WNDPROC(0x3ad5878, {MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, 
WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 
0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}) at 
include\wincontrol.inc:5406

#23 DELIVERMESSAGE(0x3ad5878, 0) at lclmessageglue.pas:112
#24 DOWINDOWPROC(0x3b0d780) at win32\win32callback.inc:2534
#25 WINDOWPROC(199064, 273, 22648, 1705918) at win32\win32callback.inc:2696
#26 CUSTOMFORMWNDPROC(199064, 273, 22648, 1705918) at 
win32\win32wsforms.pp:386

#27 USER32!AddClipboardFormatListener at :0
#28 USER32!EndTask at :0
#29 DEBUGSTART_$WIN32WSFORMS at :0
#30 USER32!EndTask at :0
#31 ?? at :0
#32 USER32!EndTask at :0
#33 DEBUGSTART_$WIN32WSFORMS at :0
#34 USER32!SendMessageW at :0
#35 CreateMappedBitmap at :0
#36 ImageList_GetIconSize at :0
#37 USER32!AddClipboardFormatListener at :0
#38 USER32!EndTask at :0
#39 ImageList_GetIconSize at :0
#40 USER32!EndTask at :0
#41 ?? at :0
#42 USER32!EndTask at :0
#43 ImageList_GetIconSize at :0
#44 USER32!CallWindowProcW at :0
#45 CALLDEFAULTWINDOWPROC(1705918, 514, 0, 1310774) at 
win32\win32callback.inc:97

#46 DOWINDOWPROC(0x3b0d610) at win32\win32callback.inc:2442
#47 WINDOWPROC(1705918, 514, 0, 1310774) at win32\win32callback.inc:2696
#48 BUTTONWNDPROC(1705918, 514, 0, 1310774) at win32\win32wsstdctrls.pp:1791
#49 USER32!AddClipboardFormatListener at :0
#50 USER32!EndTask at :0
#51 
WIN32WSSTDCTRLS$_$TWIN32WSBUTTONCONTROL_$__

Re: [Lazarus] Form events firing order and count

2018-02-17 Thread Graeme Geldenhuys via Lazarus

On 2018-02-16 17:40, Gabor Boros via Lazarus wrote:
I want to know when a form maximized, restored or moved. But completely 
lost between form's events.


I reported the LCL problem of inconsistent events and order of events 
between LCL widgetsets (at the time I compared LCL-QT3, LCL-Win32 and 
LCL-GTK2) some 12 years ago. From your email, it unfortunately seems 
nothing has changed in that regards. I guess you'll just have to live 
with it and do lots of testing in your own applications - and devise 
your own workarounds with {$IFDEF } etc code or field 
variables FInSomeEventFired: boolean etc. At the time (circa 2006) our 
application relied heavily on specific event orders and LCL was a 
nightmare - to the point that we moved to a completely different 
solution/toolkit.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form events firing order and count

2018-02-17 Thread Gabor Boros via Lazarus

2018. 02. 17. 17:26 keltezéssel, Graeme Geldenhuys via Lazarus írta:
At the time (circa 2006) our 
application relied heavily on specific event orders and LCL was a 
nightmare - to the point that we moved to a completely different 
solution/toolkit.



Is that nightmare exists with LCL-fpGUI also?

Gabor
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form events firing order and count

2018-02-17 Thread José Mejuto via Lazarus

El 17/02/2018 a las 17:59, Gabor Boros via Lazarus escribió:

2018. 02. 17. 17:26 keltezéssel, Graeme Geldenhuys via Lazarus írta:
event orders and LCL was a nightmare - to the point that we moved to a 
completely different solution/toolkit.

Is that nightmare exists with LCL-fpGUI also?
Gabor


Hello,

Probably in LCL-fpGUI the order is not the same or even some events are 
not fired at all. In pure fpGUI apps I'm not sure about the consistence 
in the order of events/messages.


--

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form events firing order and count

2018-02-17 Thread Graeme Geldenhuys via Lazarus

On 2018-02-17 16:59, Gabor Boros via Lazarus wrote:

Is that nightmare exists with LCL-fpGUI also?


I can't speak much for LCL-fpGUI, but in "pure fpGUI" I spent probably a 
year of testing and development making sure the same events fire in the 
same order under all fpGUI supported platforms. I remember implementing 
numerous tests one after the other for every widget in the toolkit. So 
to answer your question I'm hoping that effort translates well to 
LCL-fpGUI too.


For pure fpGUI it took a lot of effort to get there, but the end result 
was well worth the effort. Resulting in very consistent behaviour across 
all platforms. What a developer would expect from a GUI toolkit.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form events firing order and count

2018-02-17 Thread Graeme Geldenhuys via Lazarus

On 2018-02-17 18:37, José Mejuto via Lazarus wrote:

Is that nightmare exists with LCL-fpGUI also?


Probably in LCL-fpGUI the order is not the same


Now comes the BIG question... Does LCL have a reference implementation? 
Which LCL widgetset gives the correct behaviour and feature list, that 
the other LCL widgetsets need to follow or mimic?


Until that is answered, I guess it is every LCL widgetset for themselves 
and the inconsistencies in LCL will continue. And the burden falls on 
the application developer to try and fix the mess (via workarounds) - 
per application.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ghost selector in form editor

2018-02-17 Thread Juha Manninen via Lazarus
On Thu, Feb 15, 2018 at 10:10 AM, Luca Olivetti via Lazarus
 wrote:
> I've been seeing this from time immemorial, probably since 0.something, both
> under windows and linux/gtk/qt (though under linux is much more frequent):

There is an oldish report:
 https://bugs.freepascal.org/view.php?id=23741
but I don't remember seeing this problem although I have used many
Linux distributions and few Windows versions, too.
What can make the difference?
Does it happen only with particular forms or with any form?

Juha
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ghost selector in form editor

2018-02-17 Thread Vojtěch Čihák via Lazarus

Hi,
 
I can simulate this on Qt in several ways:
1) select two components on different tabs of page control, one of them will be 
ghost
2) some components can be hidden behind other, it is caused by wrong Z-order, 
for example TSpeedButton behind enlarged non-transparent TLabel or TStaticText.
and probably other ways.
 
BTW, what control is that "Status no valido!" caption? Isn't it the case no.2?
 
V.
 
__

Od: Luca Olivetti via Lazarus 
Komu: lazarus@lists.lazarus-ide.org
Datum: 15.02.2018 09:10
Předmět: [Lazarus] ghost selector in form editor

I've been seeing this from time immemorial, probably since 0.something, 
both under windows and linux/gtk/qt (though under linux is much more 
frequent):


when I select an object on the form, sometimes I see a ghost selection 
(or more than one, see the attached screenshots, first one windows, 
second one linux/gtk).


This is lazarus 1.8.0/fpc 3.0.4 but, as I said, I saw this with every 
previous lazarus version.



Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/ 
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007


--

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Compilation aborted!

2018-02-17 Thread Donald Ziesig via Lazarus

Hi Everyone:

I am writing a package that currently has one unit file which, in turn, 
has two inter-related classes.


Until just now, the package compiled (some empty methods) with only 
expected info and warnings.  I just did some minor editing (added 6 
contiguous lines) and now I get "FATAL Compilation aborted".  I 
commented out the newly entered code, but the compilation aborts.  I 
removed the newly entered code but it still aborts.


I ran the IDE from a terminal and it suggested that I look at the State 
file (.compiled).  I did, but it has nothing of interest.


Can anyone suggest what to do next to isolate the problem?

Thanks,

Don Ziesig

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compilation aborted!

2018-02-17 Thread Donald Ziesig via Lazarus

On 02/17/2018 10:08 PM, Donald Ziesig via Lazarus wrote:

Hi Everyone:

I am writing a package that currently has one unit file which, in 
turn, has two inter-related classes.


Until just now, the package compiled (some empty methods) with only 
expected info and warnings.  I just did some minor editing (added 6 
contiguous lines) and now I get "FATAL Compilation aborted".  I 
commented out the newly entered code, but the compilation aborts.  I 
removed the newly entered code but it still aborts.


I ran the IDE from a terminal and it suggested that I look at the 
State file (.compiled).  I did, but it has nothing of interest.


Can anyone suggest what to do next to isolate the problem?

Thanks,

Don Ziesig

Forgot to add: Linux Mint 18.3, Lazarus 1.8.0 02-09-2018 SVN 57265M, FPC 
3.0.4



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compilation aborted!

2018-02-17 Thread Donald Ziesig via Lazarus

On 02/17/2018 10:19 PM, Donald Ziesig via Lazarus wrote:

On 02/17/2018 10:08 PM, Donald Ziesig via Lazarus wrote:

Hi Everyone:

I am writing a package that currently has one unit file which, in 
turn, has two inter-related classes.


Until just now, the package compiled (some empty methods) with only 
expected info and warnings.  I just did some minor editing (added 6 
contiguous lines) and now I get "FATAL Compilation aborted".  I 
commented out the newly entered code, but the compilation aborts.  I 
removed the newly entered code but it still aborts.


I ran the IDE from a terminal and it suggested that I look at the 
State file (.compiled).  I did, but it has nothing of interest.


Can anyone suggest what to do next to isolate the problem?

Thanks,

Don Ziesig

Forgot to add: Linux Mint 18.3, Lazarus 1.8.0 02-09-2018 SVN 57265M, 
FPC 3.0.4



Isolated it to FPC.  Ran fpc from terminal without IDE.  Got same error 
(AV).  It is getting late here. I will look at this in the morning.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus