Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-04

Changes to bugreport #33331 completely changes long standing behaviour

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Torsten Bonde Christiansen

Dear List.

The bug report: https://bugs.freepascal.org/view.php?id=33331

has completely changed the behavious of how TTreeview behave!

The old behaviour (sending OLD current node in OnChanging, sending NEW/SELECTED node in OnChange) is consistent across other components as well.

The bug report is closed so i cannot make an objection to this "fix".

It has created a heck loads of bug in our programs due to this change - can this please be reverted?!?

Kind regards,
Torsten Bonde Christiansen

Reply by email

Maxim Ganetsky
to Torsten Bonde Christiansen

03.04.2018 11:52, Torsten Bonde Christiansen via Lazarus пишет:

Show quoted text 14 lines
Dear List. The bug report: https://bugs.freepascal.org/view.php?id=33331 has completely changed the behavious of how TTreeview behave! The old behaviour (sending OLD current node in OnChanging, sending NEW/SELECTED node in OnChange) is consistent across other components as well. The bug report is closed so i cannot make an objection to this "fix". It has created a heck loads of bug in our programs due to this change - can this please be reverted?!?

I reopened this bug report. Please comment there.

Best regards, Maxim Ganetsky mailto:

Reply by email

Torsten Bonde Christiansen
to Maxim Ganetsky
Maxim Ganetsky wrote 18 lines
03.04.2018 11:52, Torsten Bonde Christiansen via Lazarus пишет: > Dear List. > > The bug report: https://bugs.freepascal.org/view.php?id=33331 > > has completely changed the behavious of how TTreeview behave! > > The old behaviour (sending OLD current node in OnChanging, sending > NEW/SELECTED node in OnChange) is consistent across other components as > well. > > The bug report is closed so i cannot make an objection to this "fix". > > It has created a heck loads of bug in our programs due to this change - > can this please be reverted?!? I reopened this bug report. Please comment there.

Thank you Maxim!

-Torsten.

Reply by email

Werner Pamler
to Maxim Ganetsky: 03.04.2018 11:52, Torsten Bonde Christiansen via Lazarus пишет: I reopened this bug…
Maxim Ganetsky wrote
I reopened this bug report. Please comment there.

But since other opinions are required we should discuss here - the bug tracker is not the place for discussion. I applied the change leading to this issue would like to hear other opinions. Here's what I wrote in bug tracker:

"I don't see anything wrong in the logics of the new behavior: The OnChanging event is fired before the selected node is changed. It has the node which will become the new selected node as a parameter, and you can do some validation and signal in AllowChange whether the change to the new node will be allowed or not. In the event handler you still have access to the currently selected node as TreeView.Selected. Therefore, there is no need at all to duplicate the currently selected node in the node parameter of the event.

This behavior is now compatible with Delphi (it was not before the fix).

Like any bugfix the new code breaks backward compatibility - sorry for the inconvenience if you have relied on the old behavior.

Which other controls have the OnChanging event? I only found TPageControl/TTabControl but they don't pass the changing tab as a parameter. "

Reply by email

Torsten Bonde Christiansen
to Werner Pamler: But since other opinions are required we should discuss here - the bug tracker is not the…
Werner Pamler wrote 26 lines
Am 03.04.2018 um 14:41 schrieb Maxim Ganetsky via Lazarus: > I reopened this bug report. Please comment there. But since other opinions are required we should discuss here - the bug tracker is not the place for discussion. I applied the change leading to this issue would like to hear other opinions. Here's what I wrote in bug tracker: "I don't see anything wrong in the logics of the new behavior: The OnChanging event is fired before the selected node is changed. It has the node which will become the new selected node as a parameter, and you can do some validation and signal in AllowChange whether the change to the new node will be allowed or not. In the event handler you still have access to the currently selected node as TreeView.Selected. Therefore, there is no need at all to duplicate the currently selected node in the node parameter of the event. This behavior is now compatible with Delphi (it was not before the fix). Like any bugfix the new code breaks backward compatibility - sorry for the inconvenience if you have relied on the old behavior. Which other controls have the OnChanging event? I only found TPageControl/TTabControl but they don't pass the changing tab as a parameter. "

I can understand the need for being Delphi compatible, but I'm not a fan of changing a behaviour (which IMHO is not a bug) like this which can potentially affect a lot of places in user code.

Regards,
Torsten.

Reply by email

Werner Pamler
to Torsten Bonde Christiansen: I can understand the need for being Delphi compatible, but I'm not a fan of changing a…
Torsten Bonde Christiansen wrote
OnI can understand the need for being Delphi compatible, but I'm not a fan of changing a behaviour (which IMHO is not a bug) like this which can potentially affect a lot of places in user code.

Sometimes when Delphi has a bug it makes sense to give up Delphi compatibility. But here the Delphi behavior is very logical, the old Lazarus behavior simply does not make any sense. It is necessary to know the new node in order to be able decide whether the node change should be performed.

I doubt whether a "lot of places" is affected in your code - it is only the OnChanging event handler where you must replace "Node" by "TreeView.Selected". Of course, it depends on the number of treeviews involved, but I doubt also that every treeview has an OnChanging handler. So, please be realistic.

Reply by email

Torsten Bonde Christiansen
to Juha Manninen: On Tue, Apr 3, 2018 at 11:52 AM, Torsten Bonde Christiansen via Please list those other…
Juha Manninen wrote 6 lines
On Tue, Apr 3, 2018 at 11:52 AM, Torsten Bonde Christiansen via Lazarus wrote: > The old behaviour (sending OLD current node in OnChanging, sending > NEW/SELECTED node in OnChange) is consistent across other components as > well. Please list those other components.

I apologize for this - my memory played tricks on me as i though tabcontrol/pagecontrol (and the likes) also passed the items....

-Torsten.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180404/9358e90e/attachment.html>

Reply by email