mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 35
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Apr 2003
Posts: 35
I believe the only way for obtaining the dimensions of a dialog in pixels is to divide $dialog().w,etc. for $dbuw and $dbuh.
However, this is far inneffective. With my DPI settings, $dbuw returns 2.5 and this oftens results in non integer values:

alias teste { clear echo -s $dialog(server_list).w px -- $calc(($dialog(server_list).w / $dbuw)) dbu
dialog -sb server_list $dialog(server_list).x $dialog(server_list).y $calc(($dialog(server_list).w / $dbuw) -1) -1 echo -s $dialog(server_list).w px -- $calc(($dialog(server_list).w / $dbuw)) dbu
}


I got:
603 px -- 241.2 dbu
606 px -- 242.4 dbu

Even tough I subtracted 1 DBU, the dialog got larger.
It may be possible to obtain the desired results here - I don't know - however, my point is this is an awkward situation.

My apologies if this topic has already been discussed or there is a solution.


Who will trade his karma for my kingdom?
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Run it through $int() ?

Joined: Apr 2003
Posts: 35
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Apr 2003
Posts: 35
//clear | echo -s $dialog(server_list).w px -- $int($calc(($dialog(server_list).w / $dbuw))) dbu | dialog -sb server_list $dialog(server_list).x $dialog(server_list).y $calc($int($calc(($dialog(server_list).w / $dbuw))) -1) -1 | echo -s $dialog(server_list).w px -- $int($calc(($dialog(server_list).w / $dbuw))) dbu

result:
606 px -- 242 dbu
608 px -- 243 dbu

It improved 1px...


Who will trade his karma for my kingdom?

Link Copied to Clipboard