[wx-dev] Re: CanApplyThemeBorder()

Vadim Zeitlin vadim at wxwidgets.org
Wed Jan 2 05:50:56 PST 2008


On Wed, 02 Jan 2008 13:08:24 +0000 Julian Smart <julian at anthemion.co.uk> wrote:

JS> Vadim Zeitlin wrote:
JS> > On Tue, 01 Jan 2008 16:42:53 +0000 Julian Smart <julian at anthemion.co.uk> wrote:
...
JS> > JS> Huh? No, you'll get the themed border if you specify wxBORDER_THEME if 
JS> > JS> it makes sense for the control  - so, there won't be a border for a 
JS> > JS> wxStaticText, but there will be for a wxListBox or a wxRichTextCtrl. I 
JS> > JS> don't think there's a problem here.
JS> >
JS> >  I think there is a big problem here. The border styles used to work
JS> > consistently: you got default border if you didn't specify any border style
JS> > and the given border if you used an explicit border style. With
JS> > wxBORDER_THEME you get either themed border or no border at all depending
JS> > on the control. I still believe that this a very bad idea and that it
JS> > should work in exactly the same way as the other styles, i.e. draw the
JS> > themed border if it's specified even for wxStaticText. The problem with
JS> > CanApplyThemeBorder() might be unrelated (or at least secondary) to this
JS> > one, but I still think that the current behaviour (as per your description
JS> > above) is a problem.
JS> >   
JS> I don't think we ever got a correctly drawn themed wxStaticText with 
JS> border (did we?) so I don't think we're any worse off than we were.

 To be honest, I care much more about the API consistency than about full
support of all possible border styles. IOW I'd personally settle for just
one style indicating whether the border is wanted or not. But other people
may have different opinions and, especially, if it works with
wxBORDER_SUNKEN &c why shouldn't it work with wxBORDER_THEME? Besides it
should make the code simpler AFAICS because it would remove the special
handling of wxBORDER_THEME we have now.


 And another point that still remains: it must be enough to override
GetDefaultBorder() to return false to have no border (by default) for the
window. It is wrong that you currently need to also override
CanApplyThemeBorder() to achieve this goal and this must be corrected. I
proposed several ways of doing it and while I don't know which one you
prefer, please let's fix this somehow.

 TIA,
VZ




More information about the wx-dev mailing list