TTabControl/TCustomTabControl OnChanging triggers from code but shouldn't
Original Reporter info from Mantis: FRex
-
Reporter name: Błażej Roszkowski
Original Reporter info from Mantis: FRex
- Reporter name: Błażej Roszkowski
Description:
The OnChange event used to be triggered by code but it now isn't.
This is explained by change in 1.8.x to be compatible with Delphi: http://wiki.freepascal.org/Lazarus_1.8.0_release_notes#TCustomTabControl_setting_TabIndex_or_PageIndex_by_code
The problem is that OnChanging still triggers so it leads to weird situation where I get that event (to save stuff in current tab in) but then don't get an OnChange (to change tab contents to new stuff) after it.
I could reproduce it on an old (24-25-ish, I can't recall) and new Fedora 28 and on an old and fresh installation Windows 10 with 1.8.2 (using Gtk2 and WinAPI LCL respectively).
I believe neither should trigger by default and both should if the flag in Options is set.
Delphi Tokyo docs use same wording in 'Note' about in code triggering for both events:
http://docwiki.embarcadero.com/Libraries/Tokyo/en/Vcl.ComCtrls.TCustomTabControl.OnChange
http://docwiki.embarcadero.com/Libraries/Tokyo/en/Vcl.ComCtrls.TCustomTabControl.OnChanging
I'm not sure if I'm right since I'm very weak at Delphi/Pascal but this came up in this thread and wp has told me to report this (ignore posts by jamie): https://forum.lazarus.freepascal.org/index.php/topic,41164.msg285177.html
I also don't own a copy of any modern Delphi and I don't want to register and use up my trial period for this so I can't check it myself easily.
Mantis conversion info:
- Mantis ID: 33720
- Fixed in version: 2.0
- Fixed in revision: r59985 (#30e9e11e)
- Target version: 2.0