Shoutbox

[Bug] Correct height of ListBox - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: WLM Plus! Bug Reports (/forumdisplay.php?fid=7)
+----- Thread: [Bug] Correct height of ListBox (/showthread.php?tid=83577)

[Bug] Correct height of ListBox by mynetx on 05-07-2008 at 10:42 AM

While working on some script, I coded the following.

code:
<Control xsi:type="ListBoxControl" Id="lstSettingsPages">
    <Position Left="5" Top="40" Width="70" Height="218"/>
    <Items>
        <!-- ... -->
    </Items>
</Control>
I cannot set a correct height, look at the following image:
[Image: 2s9c6th.png]

With 218, the box is too low, with 219, it is too high, why is there such a big jump between the both?

Windows XP Service Pack 2 (5.1.2600)
Windows Live Messenger 9.0.1407
Messenger Plus! Live 4.60.0.326
Skin: Apple Live Messenger 0.2.0

RE: [Bug] Correct height of ListBox by Volv on 05-07-2008 at 01:03 PM

It has to fit a whole number of list items.


RE: [Bug] Correct height of ListBox by mynetx on 05-07-2008 at 01:16 PM

Then compare the height of the darkgrey bar on top of the Listbox, THAT is the height of one item. The difference at the bottom is much more than just 1 listbox item line.


RE: [Bug] Correct height of ListBox by markee on 05-08-2008 at 02:14 AM

Have you made the measurements be in pixels? (I forget where it is, NF know and that's all that matters for me :P)


RE: [Bug] Correct height of ListBox by mynetx on 05-08-2008 at 07:06 AM

No, I had the measurements in dialog units, but dialog units should as well not be that high, should they? *wonders

I will try your suggestion and post back here.


RE: [Bug] Correct height of ListBox by Matti on 05-08-2008 at 04:09 PM

Try:

code:
<Position Left="5" Top="40" Width="70" Height="218"/>
   <Units>SizePixels</Units>
</Position>
This will keep the Left and Top values in dialog units (1 unit = 1.5 pixels), but will interpret the Width and Height values as pixels. Eventually, you can use AllPixels instead of SizePixels to have Left and Top also in pixels. It's easier for me to work that way as it lets me perfectly position a control or element. :)

EDIT: But indeed, that small change seems to make the list box lots higher! :O Are you sure you don't have a typo in the XML?
RE: [Bug] Correct height of ListBox by CookieRevised on 05-08-2008 at 05:01 PM

quote:
Originally posted by Mattike
Try:
code:
<Position Left="5" Top="40" Width="70" Height="218"/>
   <Units>SizePixels</Units>
</Position>
This will keep the Left and Top values in dialog units (1 unit = 1.5 pixels), but will interpret the Width and Height values as pixels. Eventually, you can use AllPixels instead of SizePixels to have Left and Top also in pixels. It's easier for me to work that way as it lets me perfectly position a control or element. :)
will work perfect on most default desktops. But people with different display settings like DPI stuff and all that other mambo jambo will see screwed up dialogs (well not really screwed up, but not the stuff you intended anyways)...

In short: 1 dialog unit isn't always 1.5 pixel. So better use dialog units...

(^^ what others tell me todo, personally I would use pixels too though :p especially since any graphical content you use is defined in pixels and thus to align something perfectly to that you need to use pixels too.... But Patchou and others would probably shake their heads at this and tell me to use dialog units and make the dialogs with graphics in such a way that they will always look 'aligned', aka don't use a graphic as the base to align and design controls or windows, only use them as 'touch-ups')