View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0037163||Lazarus||RTL||public||2020-06-01 19:14||2020-09-02 22:54|
|Reporter||Renato Ricci||Assigned To||Juha Manninen|
|Summary||0037163: Event Handler error|
|Description||Hello, I would like to report that Lazarus is not leting me clear/unlink an event when it is a TCollection..|
Even when i habe 'Auto remove empty methods', the event is not unlinked when we emprty the method.
Please see the attachment for details..
Looks like a bug..
|Tags||No tags attached.|
|Fixed in Revision||r63781|
||Can you please provide a simple example project to reproduce the error.|
Hi.. Please see attachment..
Steps to reproduce:
Active the 'Auto remove empty methods' on yout IDE and:
1) First, install the Package NewPackage.lpk
2) Open de Project Sample.
3) The sample project already has a Event on the component. Try to go to the code and clean the event.
You will see that IDE will remove the Method(since there is no code anymore), but the Event on the component is still there(not suppose to..)
Sample.zip (131,911 bytes)
Yes I can reproduce now. Thanks for the good minimal example.
I only had to remove the "windows" unit here and it compiled.
What is the GroupDescendentsWith() call in procedure Register for?
I checked its implementation. It is empty.
I think you can remove the GroupDescendentsWith() ate register procedure..
And there is another behavior that sometimes happens but I can not reproduce it always is that I dont know why, sometimes I can not set the event to '(none)'.. May be it is related to the above related behavior(Sample Project).
||Hi.. any news on this bug? Thanks|
||The job is done by function RemoveEmptyMethods() in unit EmptyMethodsDlg. You could study it if you have time and motivation. I plan to study it later, too.|
||Thanks! Time I have.. but dont have knowledge :(. I will study it.. Thanks for now..|
I got inspiration and finally was able to fix this, amazingly enough! :)
TCollectionItem does not inherit from TComponent and needs special treatment.
Unit ComponentTreeView has a little similar code. The Object Inspector tree also must show TCollections and TCollectionItems. I improved it a long time ago, it is coming back...
I recommend you to study code related to RTTI and published properties. It is useful.
Thanks a lot!! Sure.. I will study RTTI...
By the way.. did you also notice that.. If you have an Tcollection event and you close the project and open it again, That event/procedure is unlinked from its event?
Take a try..
||Juha, is it possible to use the correction you've make on Lazarus 2.0.8? Thanks.|
> If you have an Tcollection event and you close the project and open it again, That event/procedure is unlinked from its event?
TcollectionItem event, right? I did not see that. Only if the handler method is empty, it will be removed and unlinked.
> is it possible to use the correction you've make on Lazarus 2.0.8? Thanks.
I believe it is. You must apply first the refactoring commit r63780 and then r63781.
Or just use Lazarus trunk.
Please continue questions and discussions in mailing list or forum. A personal mail or PM is good, too.
|2020-06-01 19:14||Renato Ricci||New Issue|
|2020-06-01 19:14||Renato Ricci||File Added: Screenshot_3.png|
|2020-06-02 08:39||Juha Manninen||Note Added: 0123179|
|2020-06-04 16:02||Renato Ricci||Note Added: 0123221|
|2020-06-04 16:02||Renato Ricci||File Added: Sample.zip|
|2020-06-04 16:02||Renato Ricci||File Added: Screenshot_4.png|
|2020-06-04 23:08||Juha Manninen||Note Added: 0123233|
|2020-06-04 23:14||Renato Ricci||Note Added: 0123234|
|2020-06-04 23:28||Renato Ricci||Note Added: 0123235|
|2020-06-04 23:28||Renato Ricci||File Added: Screenshot_5.png|
|2020-06-04 23:34||Renato Ricci||Note Edited: 0123235||View Revisions|
|2020-08-15 13:49||Renato Ricci||Note Added: 0124899|
|2020-08-16 10:55||Juha Manninen||Note Added: 0124916|
|2020-08-18 14:14||Renato Ricci||Note Added: 0124962|
|2020-08-18 19:28||Juha Manninen||Assigned To||=> Juha Manninen|
|2020-08-18 19:28||Juha Manninen||Status||new => assigned|
|2020-08-18 19:44||Juha Manninen||Status||assigned => resolved|
|2020-08-18 19:44||Juha Manninen||Resolution||open => fixed|
|2020-08-18 19:44||Juha Manninen||Fixed in Revision||=> r63781|
|2020-08-18 19:44||Juha Manninen||LazTarget||=> -|
|2020-08-18 19:44||Juha Manninen||Note Added: 0124969|
|2020-08-18 19:50||Renato Ricci||Note Added: 0124970|
|2020-08-18 21:09||Renato Ricci||Note Added: 0124972|
|2020-08-19 09:50||Juha Manninen||Note Added: 0124979|
|2020-08-19 15:17||Renato Ricci||Note Added: 0124991|
|2020-09-02 22:54||Juha Manninen||Relationship added||related to 0019563|