lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Skin appearance improvements


From: Greg Chicares
Subject: Re: [lmi] [PATCH] Skin appearance improvements
Date: Sun, 3 Jul 2016 13:10:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-07-03 12:42, Vadim Zeitlin wrote:
> On Sun, 3 Jul 2016 12:04:00 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> Okay, so...
> GC> 
> GC> (1) "100" in C++ code means real pixels, with no adjustment for either
> GC> DPI or dialog font;
> GC> 
> GC> (2) "100" in XRC code means DPI-independent pixels, with no adjustment
> GC> for the dialog font; and
> GC> 
> GC> (3) "100d" in XRC code means dialog units, which adjust for the dialog
> GC> font...and also for DPI, because that affects the font.
> 
>  This is right but please note -- and sorry if I'm just pointing out
> something obvious -- that "1d" is not the same as 1px, whatever the DPI.
> One horizontal dialog unit is defined as 1/4th of the average width of a
> Latin alphabet letter and one vertical unit is 1/8th of the font height.
> So this is why I said to use 40 dialog units for ~10 character string.

I was just wondering about that. I noticed that in 'src/msw/listbox.cpp'
you recently made this change:
- wListbox = 100;
+ wListbox = 6*GetCharWidth();
so I figured that "1d" is not at all like 1px. I suppose there's some
scale factor that's constant across lmi dialogs and could therefore be
determined OAOO through experimentation. Someday I should change
things like this
            <object class="wxTextCtrl" name="Comments">
                <help>Freeform comments</help>
                <size>180,-1</size>
            </object>
replacing "180" by 180*factor, where the factor differs for vertical
vs. horizontal sizes and is not even a ratio of small integers, e.g.:
  
http://stackoverflow.com/questions/395195/wpf-how-to-specify-units-in-dialog-units
| 1 horizontal dlu = 2.265px
| 1 vertical dlu = 2.375px

For now, I'm just trying to record all this information in one place
so that I don't have to repeat this research later when I actually
have time to change these hard-coded sizes.

> GC>   
> http://docs.wxwidgets.org/trunk/overview_xrcformat.html#overview_xrcformat_type_size
[...]
> GC> Would a change like
> GC> - Semi-formally the format is:
> GC> + Formally the format is:
> GC> make sense?
> 
>  Perhaps, but I think it's better to just say clearly what we mean here as
> this seems like a possibly common confusion, so I've just done that in
> 
>       https://github.com/wxWidgets/wxWidgets/commit/94d93bc

Thanks, that's most helpful.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]