Problem solverd!
First I must admit that I was approaching this slightly wrong. I was eagerly trying to handle form resizing while I needed to handle Panel resizing since Andora uses it as a drawing surface in my program.. So now I call AdDraw.Restore in panels OnResize event. And for avoidance of multiple cals of AdDraw.Restore I check IsFormResizing variable of Boolean type to see if the form is in resizing state. I set this variable to True or False by handling WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE.
So my code looks like this:
Code:
procedure TMainForm.WMEnterSizeMove(var Message: TMessage);
begin
IsFormResizing := True;
end;
procedure TMainForm.WMExitSizeMove(var Message: TMessage);
begin
AdDraw.Restore;
IsFormResizing := False;
end;
procedure TMainForm.MainViewResize(Sender: TObject);
begin
if not IsFormResizing then
begin
AdDraw.Restore;
end;
end;
@User137
The reason why I need to call AdDraw.Restore is that Andora 2D can adjust it's drawing routine to the new surface size becouse othervise all of the graphics would get streched.
Bookmarks