Skip to main content
February 18, 2011
Answered

How can I get the monitor size?

  • February 18, 2011
  • 1 reply
  • 649 views

I got the object of the monitor size with "$.screens".

But I don't know how to convert  the object to text...(-"-;) ??

Please teach me.

お願いします。

thank you.

nakamori

This topic has been closed for replies.
Correct answer Muppet_Mark-QAl63s

win.center()

Forget the rest… Done 4U

1 reply

Muppet_Mark-QAl63s
Inspiring
February 18, 2011

var x = $.screens; // Array var y = x[0].toString(); // I only have 1 alert(y.constructor);

Sorry I was not reading your question properly… ooooopps. Still don''t thing I've understood your question?

February 19, 2011

Sorry ... Information from me was a too little.

I want to show the dialog to the center of the monitor.
The dialog's size is influenced by number of files.

So,I want to write the script like this...

var x = $.screens; // Array of the "Object" [left,top,right,bottom]?? var y = x[2].toString(); //get the width size (but I don't know the command...) var monitorAveW = y/2; //center of width

...

...

var diadogSizeW = 50*fileItemsA ;     // diadog's Size (Width)

var diadogSizeH = 100*fileItemsB ;   // diadog's Size (Height)

var winL = monitorAveW-(diadogSizeW/2); //position of Left

var winT = monitorAveH-(diadogSizeH/2); //position of Top

var winR = monitorAveW+(diadogSizeW/2); //position of Right

var winB = monitorAveH+(diadogSizeH/2); //position of Bottom

win = new Window();

win.bounds = [winL,winT,winR,winB];

I tried your script.

but I could not get the position of center of monitor ...

Could you help me?

Thank you.

Nakamori

Muppet_Mark-QAl63s
Muppet_Mark-QAl63sCorrect answer
Inspiring
February 19, 2011

win.center()

Forget the rest… Done 4U