mIRC Home    About    Download    Register    News    Help

Print Thread
#266392 28/11/19 04:08 PM
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Could we get map versions of $dbuw and $dbuh?

And while we're at it, how legit is the map option? Is there a reason why it's still undocumented?

Dazuz #271677 18/05/23 03:47 PM
Joined: Jul 2006
Posts: 4,134
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,134
I'd like to see this added as well, it would help converting dialog to the supposedly better 'map' option.

After some testing (win10 & win7, 100% dpi aka no dpi setting) it seems the ratio is 1.336 for $mapw and 1.228571428571428571428571428571 for $maph (via bigfloat math, 1.228571 is ok for all practical purposes?).

With that you can convert any size and coordinate and get a dialog that looks the same with map than it looked for dbu.

As well as a better/more standard spacing, map is meant to work with dpi settings, when dbu is not.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Dazuz #271792 15/06/23 11:44 AM
Joined: Dec 2002
Posts: 5,404
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,404
$dbuw/$dbuh use GetDialogBaseUnits() which are the average width/height of the system font.

The -l/map options use MapDialogRect() which takes a window handle and bases its calculation on the font being used by a dialog, which can vary by system, language, application, etc.

So these can be added but they would have to be added as $dialog().mapw/.maph properties and can only be used once the dialog has been created using /dialog, eg. in the on dialog init event.


Link Copied to Clipboard