Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » [Gantt] Workaround for scrollbars
[Gantt] Workaround for scrollbars [message #60081] Fri, 10 October 2008 15:47
Laurent Marchal is currently offline Laurent MarchalFriend
Messages: 91
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------070004050802020207070500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi gantt users !

I have found a workaround to re-set the scroll bar location after a refresh.

It seems that during the gantt redraw, the scrollbar's selection value
is not used to draw, so programmatically changing the scrollbar
selection will be taken into account.

The workaround simply send a fake event saying the scrollbar changed
it's selection.

+1 for a GanttComposite.refresh(boolean restoreScrollBars).

Laurent Marchal.

--------------070004050802020207070500
Content-Type: text/x-java;
name="fix.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="fix.java"

ScrollBar vScrollBar = _ganttChart.getGanttComposite().getVerticalBar();
int vScroll = vScrollBar != null ? vScrollBar.getSelection() : 0;

// do what you need

// restore scroll status
if (vScrollBar != null) {
vScrollBar.setSelection(vScroll);
}
//refresh the chart
_ganttChart.getGanttComposite().refresh();
// send events to force refresh
Event event = new Event();
// needed !
event.detail = 1;
vScrollBar.notifyListeners(SWT.Selection, event);


--------------070004050802020207070500--
Previous Topic:setFocusItem on Disposed GridItem
Next Topic:[Gantt] Workaround for scrollbars
Goto Forum:
  


Current Time: Wed Apr 24 18:16:35 GMT 2024

Powered by FUDForum. Page generated in 0.03131 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top