Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AlignWithMargins not working correctly i Asynch calls
#1
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  Smile
Whats the difference between Asynch and Synch events and when should they be used?

Best asynch regards, Mikael
Reply
#2
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.
Reply
#3
Yes, I know why it is happening. Very unusual test case, though. I'll see if I get if fixed in the next release.
Reply
#4
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,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)