Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Allow TVS_NOSCROLL to be set for a Tree


The problem is that TVS_NOSCROLL was not available in older versions of the common controls DLL and clients of SWT got used to the free scroll bars in Trees, so much so that this had to be emuated on other platforms and we got bug reports when if we didn't.  In fact, I'd like nothing better than to get rid of them but it'd break too much code.  So we are stuck with the current behavior.  The comment from the code refers to the fact that when no scroll bars are specified and more items than are visible are added to the tree, then using the arrow keys to move around the items will not scroll to show the selection (at least it did not at the time the comment was written).

There is no platform independent way to set style bits because they only exist on Windows.  I'm not exactly sure what you are doing.  Why is the native scrolling insufficient?



"Olivier Modica" <omodica@xxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

06/16/2003 01:41 PM
Please respond to platform-swt-dev

       
        To:        <platform-swt-dev@xxxxxxxxxxx>
        cc:        
        Subject:        [platform-swt-dev] Allow TVS_NOSCROLL to be set for a Tree



Hi,

This is a thread about TVS_NOSCROLL for the Tree widget, and discusses
why disablin it can be restrictive.

I read and understand the following comments in Tree#checkStyle():
/**
* Feature in Windows.  It is not possible to create
* a tree that scrolls and does not have scroll bars.
* The TVS_NOSCROLL style will remove the scroll bars
* but the tree will never scroll.  Therefore, no matter
* what style bits are specified, set the H_SCROLL and
* V_SCROLL bits so that the SWT style will match the
* widget that Windows creates.
*/
However this is too restrictive for some specific needs. I have a case
where a Tree component requires more control other the scrollbars,
namely in terms of positioning (SWT.RIGHT_TO_LEFT on Tree is not
enough).
In that case I would use a ScrolledComposite and listeners to adjust
the ScrolledComposite size and settings to provide scrolling support
for a Tree widget with the TVS_NOSCROLL bit set.

Not setting the TVS_NOSCROLL bit set causes some flickering when
specific
events happen since the Tree widget will display its scrollbar until a
new
size for the ScrolledComposite is set.

I'd like to avoid this flickering, and since setting the visibility of
the
Tree scrollbars will not work, my only current strategy is to change the
Tree widget implementation to set the TVS_NOSCROLL bit.

Are there any way to pass additional bit values for the widget, outside
of
private methods?

Best regards,
Olivier Modica.

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top