[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Custom wxArtProvider affects html help toolbar buttons
From: |
Greg Chicares |
Subject: |
Re: [lmi] Custom wxArtProvider affects html help toolbar buttons |
Date: |
Tue, 17 Mar 2009 18:55:51 +0000 |
User-agent: |
Thunderbird 2.0.0.19 (Windows/20081209) |
On 2009-01-20 16:13Z, Vaclav Slavik wrote:
> On Sun, 2009-01-18 at 00:05 +0000, Greg Chicares wrote:
>> Apparently 16x15 (fifteen) is the wxArtProvider::GetSizeHint() default
>> for most if not all icons in wx-2.8.9 for msw (not just for frame icons).
>> I have this comment in 'icon_monger.cpp':
>>
>> /// For platforms with standard interface guidelines, GetSizeHint()
>> /// does the right thing; but for msw it just returns 16 by 15 because
>> /// there's no standard practice, so hardcoded sizes are given here.
>>
>> and I think you're saying that a future version of wx will return
>> 16x16 (both sixteen), so someday I ought to change my comment thus:
>> - /// does the right thing; but for msw it just returns 16 by 15 because
>> + /// does the right thing; but for msw it just returns 16 by 16 because
>> ^
>> Have I understood correctly?
>
> Actually, the entire comment should be removed after you switch to wx3,
> wxArtProvider now does the right thing (i.e. return 24x24 for toolbar
> items, 16x16 for menu items etc.) on MSW too on wx trunk.
I'm about to remove that comment as you suggest. But I wonder whether
we can also remove the function that it documents (conditional on
upgrading to wx-2.9). In particular, would the following patch be wrong?
(It seems to work perfectly on msw.)
Index: icon_monger.cpp
===================================================================
RCS file: /sources/lmi/lmi/icon_monger.cpp,v
retrieving revision 1.14
diff -U 3 -r1.14 icon_monger.cpp
--- icon_monger.cpp 17 Jan 2009 21:44:16 -0000 1.14
+++ icon_monger.cpp 17 Mar 2009 18:43:00 -0000
@@ -145,7 +145,7 @@
}
#if wxCHECK_VERSION(2,9,0)
- wxSize const desired_size = desired_icon_size(client, size);
+ wxSize const desired_size = wxArtProvider::GetSizeHint(client);
#else // !wxCHECK_VERSION(2,9,0)
// See:
// http://lists.nongnu.org/archive/html/lmi/2008-10/msg00022.html
For wx-2.9, without that change, the code in lmi HEAD says, in effect:
wxSize const desired_size =
wxDefaultSize != size
? size
: wxArtProvider::GetSizeHint(client)
;
and so my question is whether the 'wxDefaultSize != size' case matters.
AFAICT, this just says that if the 'size' argument to CreateBitmap() is
not the default -1, then it's to be used unchanged; and GetSizeHint() is
used instead only if CreateBitmap() gets wxDefaultSize as an argument.
Is that still necessary with wx-2.9? (Where would a nondefault size come
from, if not from GetSizeHint()?)
- Re: [lmi] Custom wxArtProvider affects html help toolbar buttons,
Greg Chicares <=