Jump to content

Recommended Posts

Posted

in UniLoginFormCreate, UniApplication.ScreenWidth 's value is "0" how can I get screenwidth while or before UniLoginFormCreate ?

procedure TFRM_Login.UniLoginFormCreate(Sender: TObject);
begin
  Self.BorderStyle:= bsNone;
  Self.Left:= UniApplication.ScreenWidth div 2;

Thank you.

  • 3 weeks later...
  • Administrators
Posted

this bug still continue on 1.0.0.1399_RC

 

Hello,

 

Technically, it is not possible to get browser width height when first request is received from the browser. Browser HTTP headers do not include any size parameters.

Why do you need size value?

Posted

Hi,

 

Can help you,

 

Try...

 

1. UniLoginForm1.Script ...

window.onresize = function(){
  if (typeof UniLoginForm1 !== 'undefined') {  
    var getSize = Ext.getBody().getViewSize(),
        winWidth = getSize.width,
        winHeight = getSize.height,
        left = (winWidth - UniLoginForm1.window.width) / 2,
        top = (winHeight - UniLoginForm1.window.height) / 2;

    UniLoginForm1.window.setPosition(left, top);
  }
}

2. UniLoginForm1.AlignmentControl -> uniAlignmentClient

 

http://forums.unigui.com/index.php?/topic/5950-how-set-center-login-form-when-resize-browser/&do=findComment&comment=30485

 

Best regards,

Posted

Thank you so much for help.

This is work like, what I want.

 

Q: Why FormScreenResize event not triggered? when resize browser.

 

@Farshad

I wanna center my loginform on browser. maybe other form(s) in future.  And I have no idea (I hope yet) uniGUI mecanism. If I'm not wrong, before create and show loginform, has to created server and main module, this mean can get some info from browser. ofcourse this is my idea, no knowledge yet. I'm still learning mode. (I hope this session be short :) )

Thank for answers.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...