[wx-dev] proposed change to wxScrolledWindow

Stefan Csomor csomor at advancedconcepts.ch
Mon Jul 23 11:05:04 PDT 2007


Vadim Zeitlin wrote:
> On Mon, 23 Jul 2007 19:45:33 +0200 Stefan Csomor <csomor at advancedconcepts.ch> wrote:
>
> SC> I've received a change in another patch (1744665) which suggest the 
> SC> following change in generic/scrlwing.cpp
> SC> 
> SC> @@ -1360,7 +1360,12 @@
> SC>      MacSetClipChildren( true ) ;
> SC>  #endif
> SC>  
> SC> -    bool ok = wxPanel::Create(parent, id, pos, size, 
> SC> style|wxHSCROLL|wxVSCROLL, name);
> SC> +    if (style & (wxHSCROLL | wxVSCROLL) == 0)
> SC> +    {
> SC> +        // if neither scroll bars are specified, assume that both are 
> SC> desired
> SC> +        style |= wxHSCROLL | wxVSCROLL;
> SC> +    }
> SC> +    bool ok = wxPanel::Create(parent, id, pos, size, style, name);
> SC> 
> SC> allowing to use only one scrollbar in a scrolled window, is this 
> SC> something I should apply ? if yes to wx_2_8 or only to HEAD ? I'm 
> SC> hesitant as it changes behaviour of existing code, but I also see that 
> SC> it might be useful ....
>
>  This was the old behaviour AFAIR, before wxWindow was changed to create
> scrollbars only when wx[HV]SCROLL were specified. So I think it should do
> no harm to do it like this but OTOH it could hinder your efforts to force
> people to use wxSCROLL styles explicitly instead of relying on wx always
> creating the scrollbars.
>   
If a ..SCROLL flag is not set at the moment of the wxWindow constructor, 
then there cannot be a corresponding scrollbar on OSX, this is still 
maintained.

I'd assume that the change here was meant to allow not having a 
scrollbar in one direction but maintaining the old scrolwin behaviour of 
adding the stiles in case no scroll flag at all is given.

So an effect of the change would only be visible in a situation where a 
wxScrolledWindow is created with only ONE instead of the TWO or NO 
scrollflag, in this setup I'd assume that the developer actually would 
want something with ONE scrollbar only ...

So might this pose problems, or might the scrollwin implementation 
itself depend on the fact that there are always two scrollbars ?

Stefan







More information about the wx-dev mailing list