none
2012-06-07 05:17:25 UTC
Hi,
I am using the "CGridCtrl" class from thecodeproject.com, which is fairly
widely used. It is quite buggy but can be beaten into shape if you are
persistent enough. I only mention that I'm using it to point out that
there's a ton of code that I didn't write, so there might be a hidden bug
that I just haven't found.
It's a grid control for doing spreadsheet-type stuff. It automatically
shows scroll bars when the grid doesn't fit in the window's client area.
I'm having some really bizarre problems with the scroll bars -- and
apparently, I'm not the first, because the source is littered with comments
like "changed this to avoid infinite loop" wherever the scroll bars are
involved. And still, I occaisionally see infinite loops when scrolling
around the grid...
So, what I thought I would do is just force the scroll bars to always be
shown, but disabled when not needed. That would eliminate the constant
showing/hiding of the bars, which causes the client area to shrink/expand,
which causes the grid to recalculate its size, and so on and so on.
All I did was find all calls to CWnd::SetScrollInfo() and added the
SIF_DISABLENOSCROLL to the SCROLLINFO's fMask member. For good measure, I
also added it to any calls to CWnd::GetScrollInfo(), but the documentation
seems to say that it's ignored there.
The end result is that the scroll bars are always shown, sometimes
disabled, on *most* systems. On some systems (both XP and Win 7), though,
only the horizontal bar is shown and the vertical bar just disappears as if
I hadn't specified the SIF_DISABLENOSCROLL flag.
Any idea what I might be doing wrong, or what might be lurking somewhere in
the CGridCtrl code that is overriding my flag? I've searched the code
thoroughly for SetScrollInfo() calls and even "SIF_..." and there aren't
any matches.
Thanks.
I am using the "CGridCtrl" class from thecodeproject.com, which is fairly
widely used. It is quite buggy but can be beaten into shape if you are
persistent enough. I only mention that I'm using it to point out that
there's a ton of code that I didn't write, so there might be a hidden bug
that I just haven't found.
It's a grid control for doing spreadsheet-type stuff. It automatically
shows scroll bars when the grid doesn't fit in the window's client area.
I'm having some really bizarre problems with the scroll bars -- and
apparently, I'm not the first, because the source is littered with comments
like "changed this to avoid infinite loop" wherever the scroll bars are
involved. And still, I occaisionally see infinite loops when scrolling
around the grid...
So, what I thought I would do is just force the scroll bars to always be
shown, but disabled when not needed. That would eliminate the constant
showing/hiding of the bars, which causes the client area to shrink/expand,
which causes the grid to recalculate its size, and so on and so on.
All I did was find all calls to CWnd::SetScrollInfo() and added the
SIF_DISABLENOSCROLL to the SCROLLINFO's fMask member. For good measure, I
also added it to any calls to CWnd::GetScrollInfo(), but the documentation
seems to say that it's ignored there.
The end result is that the scroll bars are always shown, sometimes
disabled, on *most* systems. On some systems (both XP and Win 7), though,
only the horizontal bar is shown and the vertical bar just disappears as if
I hadn't specified the SIF_DISABLENOSCROLL flag.
Any idea what I might be doing wrong, or what might be lurking somewhere in
the CGridCtrl code that is overriding my flag? I've searched the code
thoroughly for SetScrollInfo() calls and even "SIF_..." and there aren't
any matches.
Thanks.