View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0027609||Lazarus||IDE||public||2015-03-05 21:41||2021-03-12 14:18|
|Reporter||Mike Sapsard||Assigned To||Juha Manninen|
|Platform||i7 PC||OS||Linux Mint|
|Summary||0027609: Setting z-order of objects does not work - regression|
|Description||z-order depends on the order of objects in the .lfm file. The attached example shows two buttons and two comboboxes. The z-order in the lfm file is btn1, cmbox1, cmbox2, btn2. |
1) When the form is reduced in width by dragging the right side, the comboboxes and btn2 slide over btn1. They should slide under.
2) Right clicking and changing the z-order also does not move the object begin ... end block in the .lfm file.
|Steps To Reproduce||Run attached file|
|Additional Information||There are several bug reports, patches/fixes for related problems. This may be an accidental regression.|
|Tags||No tags attached.|
|Fixed in Revision|
|Widgetset||GTK 2, Win32/Win64, WinCE, Carbon, Cocoa, QT|
published.zip (3,360 bytes)
||Lazarus version is 1.4RC2.|
||Is this a regression compared to Lazarus 1.2.x?|
||I have done some more tests. Editing and changing z-order in Lazarus IDE does not save changes. Closing Lazarus and editing the .lfm file in a text editor changes the order in the Object Inspector. But, even after Clean and Rebuild it only shows changes in the Object Inspector. The z-order when the application is run, does not change.|
||IMO, this is important issue and should be fixed by 1.4. It's designer bug, not widgetsets.|
Lazarus 1.5 r47837 FPC 2.6.4 i386-win32-win32/win64: OK
Lazarus 1.5 r48395 FPC 2.6.4 i386-win32-win32/win64:
- in IDE changing Z-order seems to have no (or wrong) effect in designer
- in compiled application Z-order seems to work as expected
||So it's regression and must be fixed.|
||I've updated bug info, because this is regression|
This is getting weird.
I just tested the same setup as yesterday (r48395): the Z-ordering behaves as expected both inside IDE and in the built program.
(Yesterday it showed the bug.)
This makes testing rather difficult.
||Possible uninitialized variable.|
Lazarus 1.5 r48332
FPC 3.1.1 i386-linux-qt
Z-order works perfect.
Also Lazarus 1.5 r48332
FPC 3.1.1 i386-linux-gtk2 works fine.
||Tested on Mint 17 64bit with cinnamon and it works ok.|
If this is a regression, this may go further back. While I was working on http://bugs.freepascal.org/view.php?id=20450, I could not initially get the Object Inspector to correctly display the Z-Order.
In the end I added some additional code to objectinspector.pp procedure TObjectInspectorDlg.DoZOrderItemClick(Sender: TObject); that forced the OI to update the order of the controls.
There was also some oddity I saw with the Menu Item Z-order in the OI, and I had to add similar OI refresh code there. That code was even earlier :-( And there was one or two users in the forum who were telling me that they didn't see a problem with the Z-Order at all.
Reason I mention this is the order of controls in the LFM is identical to the order of controls in the OI.
Focussing on just the reported issue here, I'm possibly confused.
> 1) When the form is reduced in width by dragging the right side,
> the comboboxes and btn2 slide over btn1. They should slide under.
btn1 is the first item in the OI list. I would have thought this puts it at the back of the Z-Order. Other controls sliding over this is what I would expect. It's also what I'm seeing here (in Windows) - both at design time, and at runtime. Is my understanding incorrect?
This example works correct here. Btn1 is at the bottom of the stack so covered by other controls when resizing form. Moving btn1 Z order to the top, controls goes below btn1 when form is resized (reduced size). So no issue here.
Fedora 19 64bit, KDE, tested qt,gtk2 and win32 via wine. All of them works correct.
Since the bug cannot be reproduced in a reliable way, I removed target 1.4 (even though it may be a regression).
If there is anybody who can repdoduce it in a reliable way, please try to find the revision that broke it (use disecting).
@Mike: You wrote
"Closing Lazarus and editing the .lfm file in a text editor changes the order in the Object Inspector. But, even after Clean and Rebuild it only shows changes in the Object Inspector. The z-order when the application is run, does not change. "
There should be a copy of the lfm file in the lib folder (with the ppu and o files. Did this copy get updated?
I wonder why there is an lrs file. That should not be there.
Project Options > Miscellaneous "FPC Resources is selected"
Though at the same time (and that makes no sense afaik) "save lrs file in the output dir" but maybe that affects the res file too.
||@Martin: OTOH I have reproduced (but not reproduced it since) this on a fresh project, using FPC resources (not .lrs) and without manually editing the .lfm.|
It can be seen when Lazarus and the app are built with QT5. The designer correctly changes order in .lfm file.
GTK2 behaves wrong and does not obey Z-order. The related issue stays open for that.
I thing everything works fine till the call in wincontrol.inc in line 4245, where
TWinControl(AChild), OldPos, NewPos, WinControls);
is called. I think, this is the routine in the widgetset, in my case GTK2.
"In Gtk2 many controls don't have a window, so they are just painted on their parent. This makes they be painted before controls with a window, so we get a wrong Z-Order. "
Wouldn't it be a good idee to pick uo the proposal of the mentioned tutorial, to put these controls in an eventbox automatically?
|2015-03-05 21:41||Mike Sapsard||New Issue|
|2015-03-05 21:41||Mike Sapsard||File Added: published.zip|
|2015-03-06 10:18||Mike Sapsard||Note Added: 0081673|
|2015-03-06 19:46||Juha Manninen||Note Added: 0081685|
|2015-03-14 12:07||Zeljan Rikalo||Relationship added||related to 0027419|
|2015-03-16 11:58||Mike Sapsard||Note Added: 0082002|
|2015-03-16 15:06||Zeljan Rikalo||Note Added: 0082011|
|2015-03-16 18:57||Bart Broersma||Note Added: 0082017|
|2015-03-16 18:58||Bart Broersma||Note Edited: 0082017||View Revisions|
|2015-03-16 19:19||Zeljan Rikalo||Note Added: 0082018|
|2015-03-16 19:20||Zeljan Rikalo||LazTarget||=> 1.4|
|2015-03-16 19:20||Zeljan Rikalo||Widgetset||GTK 2, QT => GTK 2, Win32/Win64, WinCE, Carbon, Cocoa, QT|
|2015-03-16 19:20||Zeljan Rikalo||Note Added: 0082019|
|2015-03-16 19:20||Zeljan Rikalo||Priority||normal => high|
|2015-03-16 19:20||Zeljan Rikalo||Severity||minor => major|
|2015-03-16 19:20||Zeljan Rikalo||Summary||Setting z-order of objects does not work => Setting z-order of objects does not work - regression|
|2015-03-17 18:47||Bart Broersma||Note Added: 0082038|
|2015-03-17 20:10||Zeljan Rikalo||Note Added: 0082041|
|2015-03-17 21:03||Zeljan Rikalo||Note Added: 0082042|
|2015-03-17 21:07||Zeljan Rikalo||Note Added: 0082043|
|2015-03-18 12:56||Zeljan Rikalo||Note Added: 0082066|
|2015-03-27 21:35||Mike Thompson||Note Added: 0082384|
|2015-03-27 21:40||Mike Thompson||Note Edited: 0082384||View Revisions|
|2015-03-27 22:22||Mike Thompson||Note Added: 0082385|
|2015-03-27 22:23||Mike Thompson||Note Edited: 0082385||View Revisions|
|2015-03-27 22:28||Mike Thompson||Note Edited: 0082385||View Revisions|
|2015-03-27 23:16||Zeljan Rikalo||Note Added: 0082386|
|2015-03-27 23:46||Juha Manninen||Relationship added||related to 0020450|
|2015-04-07 18:22||Bart Broersma||LazTarget||1.4 => -|
|2015-04-07 18:22||Bart Broersma||Note Added: 0082700|
|2015-04-07 19:58||Martin Friebe||Note Added: 0082702|
|2015-04-07 20:02||Bart Broersma||Note Added: 0082703|
|2017-06-14 20:37||Juha Manninen||Relationship added||related to 0032010|
|2021-03-06 18:02||Juha Manninen||Assigned To||=> Juha Manninen|
|2021-03-06 18:02||Juha Manninen||Status||new => resolved|
|2021-03-06 18:02||Juha Manninen||Resolution||open => fixed|
|2021-03-06 18:02||Juha Manninen||Widgetset||GTK 2, Win32/Win64, WinCE, Carbon, Cocoa, QT => GTK 2, Win32/Win64, WinCE, Carbon, Cocoa, QT|
|2021-03-06 18:02||Juha Manninen||Note Added: 0129445|
|2021-03-12 14:18||Reinhard Buchholz||Note Added: 0129602|