Re: [lazarus] wincontrol align bug
On Sun, 09 Dec 2007 01:36:59 +0100 Giuliano Colla [EMAIL PROTECTED] wrote: Giuliano Colla ha scritto: The FBaseBounds are sometimes wrong in 0.9.24. This has been fixed in svn. Did you test with the current 0.9.25? Yes. I saw no changed behavior since r 12699 until your modified it in r 13219. However, as I have an app which shows the problem, I can try to trace what happens with FBaseBounds, and provide more information. I've made my test, checking just FBaseBounds.Top, because it's the one relevant in my app. What happens is the following: The two widgets created with the form, which are top aligned, have the same value for Top and for FBaseBounds.Top (i.e. 1 for the first and 43 for the second). Can you send me the test example? All the other widgets are created run-time, and initially set bottom aligned, have the correct value for the Top property (corresponding to their position) and 0 in FbaseBound.Top. So when one of them is set top aligned, if FBaseBounds.Top is used, 0 is 1 and the widget goes above the first one, instead of below. If the top property is used instead, the widget goes in the right place. I didn't investigate further, but it seems to me that if a widget has a top property of 350 and FBaseBound.top = 0 and if FBaseBound.top must be used to know where the widget is, there must be a bug somewhere. Yes. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Mattias Gaertner ha scritto: Can you send me the test example? It's rather large and requires the installation of extra packages to run. I'd rather avoid you losing time in things not related to the problem. I'll try to extract just the relevant part. If I make it, I'll send you something more manageable. If it takes too long, I'll send you the large one, with instructions. Giuliano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Andrew Haines ha scritto: Giuliano Colla wrote: I resumed after some time our core application which I'm trying to migrate to Lazarus, and to my dismay I discovered that align doesn't work anymore as it should and used to. [...] A workaround I've found is to set the first component's .Top property to 0 and then then next component down to 10 and so on. Using this in combination of alTop works for me. Thank you for the hint. But in my case my components are created run-time, and should move top-bottom dynamically. If I must update their .top property each time, then I may as well compute where they should be, and set align to none. ( sort of: Top (x) = Top (x-1) + Height (x-1)). I'd rather see Lazarus properties correctly implemented. Giuliano Andrew _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
On Fri, 07 Dec 2007 20:27:06 +0100 Giuliano Colla [EMAIL PROTECTED] wrote: Giuliano Colla ha scritto: I resumed after some time our core application which I'm trying to migrate to Lazarus, and to my dismay I discovered that align doesn't work anymore as it should and used to. I have a panel with a number of widget. Two are top aligned, the others are bottom aligned. But setting alTop to one of them, instead of being stacked below the two already there, it goes on top of them. I tried to trace back in revision, and I found that the last that works properly is r 12699. The offending code is in wincontrol.inc, procedure TWinControl.CreateControlList Sorry a typo. It's TWinControl.CreateControlAlignList, function InsertBefore where the implementation of r 12699 provides the correct alignement, while the implementation of r 12700 does not. Just replacing the expressions in case AAlign with the previous ones the behavior becomes correct again. I don't submit a patch, because I'm unsure of other implications. Both solutions have their pros and cons. To use the current order (e.g. comparing Left instead of FBaseBounds.Left) is less stable, but more Delphi compatible. I changed it. Please test. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Mattias Gaertner ha scritto: [...] Both solutions have their pros and cons. To use the current order (e.g. comparing Left instead of FBaseBounds.Left) is less stable, but more Delphi compatible. I changed it. Please test. Tested. Works fine, thank you. But if the other way around was better, in your opinion, I may add some information, just to see if we can get the best solution. In my application I have two widgets which are there since form creation, and other widgets which are created run-time. The widgets created run-time take precedence over the others. One would say that the FBaseBounds properties weren't properly set for the widgets streamed from lfm. If such is the case, what would need to be fixed is the proper initial setting of FBaseBounds. Giuliano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Mattias Gaertner ha scritto: On Sat, 08 Dec 2007 19:31:17 +0100 Giuliano Colla [EMAIL PROTECTED] wrote: Mattias Gaertner ha scritto: [...] Both solutions have their pros and cons. To use the current order (e.g. comparing Left instead of FBaseBounds.Left) is less stable, but more Delphi compatible. I changed it. Please test. Tested. Works fine, thank you. But if the other way around was better, in your opinion, I may add some information, just to see if we can get the best solution. In my application I have two widgets which are there since form creation, and other widgets which are created run-time. The widgets created run-time take precedence over the others. One would say that the FBaseBounds properties weren't properly set for the widgets streamed from lfm. If such is the case, what would need to be fixed is the proper initial setting of FBaseBounds. The FBaseBounds are sometimes wrong in 0.9.24. This has been fixed in svn. Did you test with the current 0.9.25? Yes. I saw no changed behavior since r 12699 until your modified it in r 13219. However, as I have an app which shows the problem, I can try to trace what happens with FBaseBounds, and provide more information. Giuliano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Giuliano Colla ha scritto: The FBaseBounds are sometimes wrong in 0.9.24. This has been fixed in svn. Did you test with the current 0.9.25? Yes. I saw no changed behavior since r 12699 until your modified it in r 13219. However, as I have an app which shows the problem, I can try to trace what happens with FBaseBounds, and provide more information. I've made my test, checking just FBaseBounds.Top, because it's the one relevant in my app. What happens is the following: The two widgets created with the form, which are top aligned, have the same value for Top and for FBaseBounds.Top (i.e. 1 for the first and 43 for the second). All the other widgets are created run-time, and initially set bottom aligned, have the correct value for the Top property (corresponding to their position) and 0 in FbaseBound.Top. So when one of them is set top aligned, if FBaseBounds.Top is used, 0 is 1 and the widget goes above the first one, instead of below. If the top property is used instead, the widget goes in the right place. I didn't investigate further, but it seems to me that if a widget has a top property of 350 and FBaseBound.top = 0 and if FBaseBound.top must be used to know where the widget is, there must be a bug somewhere. Giuliano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Giuliano Colla ha scritto: I resumed after some time our core application which I'm trying to migrate to Lazarus, and to my dismay I discovered that align doesn't work anymore as it should and used to. I have a panel with a number of widget. Two are top aligned, the others are bottom aligned. But setting alTop to one of them, instead of being stacked below the two already there, it goes on top of them. I tried to trace back in revision, and I found that the last that works properly is r 12699. The offending code is in wincontrol.inc, procedure TWinControl.CreateControlList Sorry a typo. It's TWinControl.CreateControlAlignList, function InsertBefore where the implementation of r 12699 provides the correct alignement, while the implementation of r 12700 does not. Just replacing the expressions in case AAlign with the previous ones the behavior becomes correct again. I don't submit a patch, because I'm unsure of other implications. Regards, Giuliano -- Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde) _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wincontrol align bug
Giuliano Colla wrote: I resumed after some time our core application which I'm trying to migrate to Lazarus, and to my dismay I discovered that align doesn't work anymore as it should and used to. I have a panel with a number of widget. Two are top aligned, the others are bottom aligned. But setting alTop to one of them, instead of being stacked below the two already there, it goes on top of them. I tried to trace back in revision, and I found that the last that works properly is r 12699. The offending code is in wincontrol.inc, procedure TWinControl.CreateControlList where the implementation of r 12699 provides the correct alignement, while the implementation of r 12700 does not. Just replacing the expressions in case AAlign with the previous ones the behavior becomes correct again. I don't submit a patch, because I'm unsure of other implications. A workaround I've found is to set the first component's .Top property to 0 and then then next component down to 10 and so on. Using this in combination of alTop works for me. Andrew _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] wincontrol align bug
I resumed after some time our core application which I'm trying to migrate to Lazarus, and to my dismay I discovered that align doesn't work anymore as it should and used to. I have a panel with a number of widget. Two are top aligned, the others are bottom aligned. But setting alTop to one of them, instead of being stacked below the two already there, it goes on top of them. I tried to trace back in revision, and I found that the last that works properly is r 12699. The offending code is in wincontrol.inc, procedure TWinControl.CreateControlList where the implementation of r 12699 provides the correct alignement, while the implementation of r 12700 does not. Just replacing the expressions in case AAlign with the previous ones the behavior becomes correct again. I don't submit a patch, because I'm unsure of other implications. Regards, Giuliano -- Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde) _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives