![]() |
|
AlignWithMargins not working correctly i Asynch calls - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: AlignWithMargins not working correctly i Asynch calls (/thread-3017.html) |
AlignWithMargins not working correctly i Asynch calls - Lenfors - 02-08-2023 Hello! Try this: Put an TIWRegion on a form (greater than 100, 100) Put a TWButton in the Region Set the Button.Align to alClient Set the Button.Margins to 20,20,20,20 All this works fine, the button fills the entire region. If you now add an event to the Button as: procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList); begin IWButton1.AlignWithMargins := Not IWButton1.AlignWithMargins; end; The AlignWithMargins will toggle when clicking the button, but the top and left positions are not set to 0 when AlignWithMargins is set to False and scrollbars appear in then Region control. I tried the same function but in the Button1.OnClick event and then it works!? When AlignWithMargins is set to False the Button is reset to its original position filling the entire Region. Is this a bug or as it should be? Maybee It's my lack of understanding of the Asynch and Synch events ![]() Whats the difference between Asynch and Synch events and when should they be used? Best asynch regards, Mikael RE: AlignWithMargins not working correctly i Asynch calls - Alexandre Machado - 02-09-2023 I can see the problem when you set it a second time, i.e. IWButton's AlignWithMargins becomes false again, after being true. I'll see what's the problem and get back to you. RE: AlignWithMargins not working correctly i Asynch calls - Alexandre Machado - 02-09-2023 Yes, I know why it is happening. Very unusual test case, though. I'll see if I get if fixed in the next release. RE: AlignWithMargins not working correctly i Asynch calls - Alexandre Machado - 02-09-2023 This issue has already been fixed in our codebase. We are testing it and it should be available in the next release (planned to be released this weekend) Cheers, |