Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Tyro question on form issues
Wed, Aug 22 2012 1:41 PMPermanent Link

William

I am entirely new to EWB, so please forgive what may be a dumb question. Is there a way in EWB to access the size of the browser window, and to detect when it changes? It would seem that without such a mechanism, there would be some fairly severe limitations.

Thanks,

Bill
Wed, Aug 22 2012 8:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bil,

<< I am entirely new to EWB, so please forgive what may be a dumb question.
Is there a way in EWB to access the size of the browser window, and to
detect when it changes? It would seem that without such a mechanism, there
would be some fairly severe limitations. >>

Yep, what you want is this event:

http://www.elevatesoft.com/manual?action=viewevent&id=ewb1&comp=TDesktop&event=OnResize

If you set the Application.Desktop AutoHeight and AutoWidth properties to
True, then the desktop will automatically resize to fit the browser window.
You can then just use something like this to get the height and width:

procedure TMyForm.DesktopResize(Sender: TObject);
begin
  LogOutput('Height: '+IntToStr(TDesktop(Sender).Height));
  LogOutput('Width: '+IntToStr(TDesktop(Sender).Width));
end;

procedure TMyForm.MyFormCreate(Sender: TObject);
begin
  Application.Desktop.OnResize:=DesktopResize;
end;

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Image