lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [PATCH] Skin appearance improvements


From: Vadim Zeitlin
Subject: Re: [lmi] [PATCH] Skin appearance improvements
Date: Sun, 3 Jul 2016 14:42:34 +0200

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.

GC> I'm not using themes, and lmi doesn't override the default font, so
GC> I notice DPI dependence, but not font dependence. End users generally
GC> use themes, so they notice font-size dependence. But everything should
GC> look right to everyone if lmi uses only dialog units in XRC files.
GC> Now, lmi rarely specifies sizes in dialog units, but it should use
GC> them generally, in preference to DIPs, right?

 I think it makes sense to use dialog units when you need to express
something in text units, i.e. so many lines of text or a string with that
many characters. DIPs are still fine for things like borders, probably.

GC> > GC> BTW, why did you suggest
GC> > GC> >     <size>50,-1d</size>
GC> > GC> above, with 'd' only on the second element?
GC> > 
GC> >  This is just how XRC syntax works, quoting the very same URL mentioned
GC> > above the grammar is
GC> > 
GC> >   size := x "," y ["d"]
GC> > 
GC> > and "d", if specified, applies to both x and y.
GC> 
GC> Aha. When I read
GC>   
http://docs.wxwidgets.org/trunk/overview_xrcformat.html#overview_xrcformat_type_size
GC> | Semi-formally the format is:
GC> |   size := x "," y ["d"]
GC> I interpreted "Semi-formally" as meaning the grammar is not rigorous,
GC> so I read further (on the same screen, but in a later section):
GC> | When "d" suffix is used, the integer preceding it is interpreted as
GC> | dialog units in the parent window, otherwise it's a DPI-independent
GC> | pixel value

 Yes, but it's for dimensions which only have a single integer.

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

 Regards,
VZ


reply via email to

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