Jump to content

Mobile browser screen size


UliBru

Recommended Posts

Is there a way to get information about the available screen size or panel of a browser? The size may change with different mobile phones and for sure with a desktop browser.

The information should be available during web form creation already to allow a layout adaption to the actual size.

 

BR

Uli

Link to comment
Share on other sites

  • 9 months later...

You can use

ClientEvents->ExtEvents->OnResize

function window.OnResize(sender, width, height)
{
   ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] );
}

And do what ever you want in the form implementing OnAjaxEvent of the form

procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TStrings);
begin
  if(EventName='screensize') Then Caption:=Params.Values['width'];
End;

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 5 years later...
  • 11 months later...
On 8/22/2013 at 11:25 PM, TNT23 said:

You can use

ClientEvents->ExtEvents->OnResize


function window.OnResize(sender, width, height)
{
   ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] );
}

And do what ever you want in the form implementing OnAjaxEvent of the form


procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TStrings);
begin
  if(EventName='screensize') Then Caption:=Params.Values['width'];
End;

Does not have effect.

Link to comment
Share on other sites

  • 6 months later...
On 8/22/2013 at 5:25 PM, TNT23 said:

You can use

ClientEvents->ExtEvents->OnResize


function window.OnResize(sender, width, height)
{
   ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] );
}

And do what ever you want in the form implementing OnAjaxEvent of the form


procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TStrings);
begin
  if(EventName='screensize') Then Caption:=Params.Values['width'];
End;

This still is working perfectly (at least for mobile applications),

Link to comment
Share on other sites

×
×
  • Create New...