[wx-dev] wxMSW: Themed borders?
Julian Smart
julian at anthemion.co.uk
Sun Aug 5 02:59:26 PDT 2007
Hi,
Revisiting this thread from January, I'd love to see themed borders in
wxWidgets - in my apps I've got themed (blue border) text controls,
sunken text rich text controls and other controls with a black border.
It's a mess. It looks like Robin's got code ready and waiting to cure it...
I suggest as a compromise we use wxBORDER_SIMPLE (or absent border
style) as the cue for themed borders. Apps using this style already
(trying to fit in with XP themes) will then look good, and apps not
providing a style will also look good.
Where themes are not available on wxMSW, wxBORDER_SUNKEN should be the
default border style.
I think introducing yet another style is sub-optimal, though I wouldn't
go as far as Vadim and banish border styles because sometimes you do
want control over them.
It would be good to have this in 2.8.x since it's not really great
having this mish-mash of border styles and it can ruin the look of an
app. We could, however, have a system option to revert to previous
behaviour in the unlikely event it causes people problems.
Thoughts? I'd be happy to do some work on this.
Thanks,
Julian
Robin Dunn wrote:
> Vadim Zeitlin wrote:
>> On Mon, 29 Jan 2007 16:26:14 -0800 Robin Dunn <robin at alldunn.com> wrote:
>
>> RD> I've done a bit of googling today and it looks like the way this
>> has RD> been solved by others so far is to handle WM_NCPAINT and draw
>> the border RD> there.
>> RD> RD> http://www.codeproject.com/cs/miscctrl/RichTextBoxEx.asp
>> RD>
>> http://www.codeguru.com/cpp/w-p/win32/tutorials/article.php/c8729__1/
>> RD>
>> http://www.shorterpath.com/develop/zonearticles/ThemedCustomControl.asp
>>
>> This is the standard Windows way of doing this.
>
> Ok, I've started grafting in some native themed border drawing into
> wxMSW, see attached patch. Unfortunately there are no more style bits
> left in the range used by border styles, so for now I've just stolen
> wxBORDER_DOUBLE. Any suggestions for what to do instead? I've
> thought about piggy backing on wxBORDER_SUNKEN instead, since that
> maps to WS_EX_CLIENTEDGE and with that style the native widgets draw a
> themed border. However if I do that then I'd have to decide when to
> let the native border drawing happen, and when to do my custom
> drawing, that might get kinda tricky so I'd rather keep it a separate
> style, but there aren't any available... I'd like to be able to do
> this for 2.8 so that rules out adding a new member. Any other ideas?
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-dev-help at lists.wxwidgets.org
--
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD: www.anthemion.co.uk/dialogblocks
More information about the wx-dev
mailing list