| Scroll bar handling - how to get a reference to a visible scroll bar? [message #442498] |
Sun, 05 September 2004 00:29  |
Eclipse User |
|
|
|
Originally posted by: lcohen.free.fr
Hi All,
I'm writing a diff-like application where I have a view of 2 different versions of the same content, each displayed as
HTML content within a SashForm through a Browser control.
This gives me this basic hierarchy of controls:
SashForm
Left side: composite1
custom composite1
Browser control1
Right side: composite2
custom composite2
Browser control2
I'm trying to synchronize the vertical scrolling of the 2 views, but for the life of me, I can't seem to get a reference
to the vertical scrollbars on my control, even though I can see them when I run the app.
I tried: composite1.getVerticalBar(), custom_composite1.getVerticalBar() and browser1.getVerticalBar(), but they all
return null.
I also tried to define my controls with the SWT.V_SCROLL style, but this actually gives me 2 scroll bars on each side,
which is kind of ugly.
What is the part that I missed or failed to understand as to how to work with scrollbars?
I'm getting short of things to try and didn't find much litterature on this specific topic.
I'll happily welcome any hint, insight or advice.
Thanks for your time,
-Laurent
|
|
|
| Re: Scroll bar handling - how to get a reference to a visible scroll bar? [message #442526 is a reply to message #442498] |
Tue, 07 September 2004 10:43  |
Eclipse User |
|
|
|
Hi,
The Browser widget will turn on and off the scrollbars based on the HTML
content. It is currently not possible to access these scrollbars directly.
You can open a feature request (Platform / SWT).
An alternative way is to use a single Browser and render both sources into
one HTML page - using CSS or a table to show the diff content into 2 columns
facing each other. Or you could also decide to use 2 frames and synchronize
them using javascript as indicated below.
Example:
http://www.webreference.com/programming/javascript/jf/column 4/fscroll_main.htm
Code:
http://www.webreference.com/programming/javascript/jf/column 4/
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.03793 seconds