wxRendererGTK::DrawSplitterBorder()

John Dallaway jld at ecoscentric.com
Mon Feb 11 00:23:13 PST 2008


Hi Vadim

Vadim Zeitlin wrote:

> On Fri, 08 Feb 2008 11:31:15 +0000 John Dallaway wrote:
> 
> JD> Vadim Zeitlin wrote:
> JD> 
> JD> > On Wed, 06 Feb 2008 16:49:53 +0000 John Dallaway wrote:
> JD> > 
> JD> > JD> Can someone please explain why the wxRendererGTK::DrawSplitterBorder()
> JD> > JD> method is implemented but empty?
> JD> > 
> JD> > I don't know for sure but I'd guess that this corresponds to the native
> JD> > splitter widget appearance. Although, of course, this is probably theme-
> JD> > dependent and so can at most be true with the default theme...
> JD> 
> JD> Thank you for your response.
> JD> 
> JD> When I eliminate the masking of border style bits in
> JD> wxSplitterWindow::Create(), I can make the "splitter" sample application
> JD> draw a reasonable border around the wxSplitterWindow under wxGTK by
> JD> passing wxSUNKEN_BORDER into the wxSplitterWindow::Create() call. Do you
> JD> agree that this is a reasonable solution?
> 
>  If I understand you correctly, I don't think so. The removal of border
> flags in wxSplitterWindow::Create() is done on purpose, as the comment says
> this window draws its border itself. Drawing extra border will certainly
> look ugly on the systems where wxRenderer::DrawSplitterBorder() does draw
> one already.

Yes. On some platforms (such as GTK) the native border is deemed to
match the appearance of the sash acceptably. On others (such as Win32)
the native border does not match the sash so the border is drawn
explicitly by wxRenderer::DrawSplitterBorder().

>  Again, it's still not clear at all to me what the problem really is. Does
> wxSplitterWindow appear differently from native GTK+ splitters? If so, in
> which theme?

The problem is that on platforms such as GTK there is no border drawn at
all because wxSplitterWindow::Create() masks any user-supplied style
information and passes wxBORDER_NONE to wxWindow::Create(). This can be
readily verified by running the "splitter" sample application unmodified
under wxGTK. wxSplitterWindow::Create() assumes that:

1) wxRenderer::DrawSplitterBorder() will draw a border on all platforms

2) the caller will always pass the wxSP_3DBORDER style into
   wxSplitterWindow::Create()

Per bug 1888733, I think the masking of style bits in
wxSplitterWindow::Create() should be eliminated so that the caller can
specify a border style such as wxSUNKEN_WINDOW for a wxSplitterWindow
when wxSP_3DBORDER is not appropriate or when
wxRenderer::DrawSplitterBorder() is empty. Do you agree?

John Dallaway




More information about the wx-dev mailing list