On Sat, 14 May 2016 23:22:36 +0200 I wrote:
[see
http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/167494 for full
context]
Me> But I also wonder if we shouldn't change the
Me> code to avoid invalidating the best size of wxStaticText controls with
Me> wxST_NO_AUTORESIZE style when their label changes. This seems more logical
Me> to me and would, IMHO, result in more intuitive behaviour. And I don't see
Me> what existing code could this break. Am I missing any good reasons to still
Me> invalidate best size even for wxST_NO_AUTORESIZE controls? Or should we
Me> make this change?
I've finally decided to make it as there haven't been any objections but
quickly ran into another question I'm not sure about: currently,
AutoResizeIfNecessary() considers that it's always necessary to resize the
control unless if has wxST_NO_AUTORESIZE set. However the code calling it
(or doing its equivalent in wxGTK and wxOSX) also checks for IsEllipsized()
with the same comment in all ports:
if ( !IsEllipsized() ) // if ellipsize is ON, then we don't want to get resized!
{
AutoResizeIfNecessary();
}
But why is this comment actually correct? IMO it makes sense to want to use
ellipsis if there is not enough space to show the full text, but still use
as much of it as possible. And we already have the perfectly clearly named
(for once!) wxST_NO_AUTORESIZE if you really don't want the control to
resize itself no matter what and nothing prevents you from combining it
with one of wxST_ELLIPSIZE_XXX flags.
So IMO the current behaviour is just wrong and we should change it and
remove "!IsEllipsized()" checks. If there are no objections to this
neither, I will do this, as well as the change proposed above when I next
have a moment for it (hopefully sooner than in 2 months...).
Regards,
VZ