mIRC Home    About    Download    Register    News    Help

Print Thread
#7196 18/01/03 04:05 PM
Joined: Dec 2002
Posts: 40
L
Lucifer Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 40
Is there a way to convert pixels to dbu. If I had a dialog like
Code:
dialog test {
  title ""
  size -1 -1 200  100 
  option dbu
}

and I want to use /dialog -s it uses pixels to size the dialog (I think) I need to convert the pixels to dbu
and the $width returns the numbers as pixels I need to convert those to. There must be a way... right?

#7197 18/01/03 08:21 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Dbu vs. Pixels
The dbu option makes mIRC use dialog base units when creating the dialog, this ensures that the dialog will look the same for all users under any size display, etc. Pixels is the default however to maintain compatibility with previous scripts.

The identifiers $dbuw and $dbuh return the dbu per pixel width and height values for the current display. This may or may not be an integer value.

dialog -s $dname $dialog($dname).x $dialog($dname).y $calc($width(%text,%font,%fontsize) * $dbuw) $dialog($dname).h


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#7198 19/01/03 03:51 AM
Joined: Dec 2002
Posts: 40
L
Lucifer Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 40
As always Hammer comes to the rescue wink Thanks


Link Copied to Clipboard