|
Re: Sectioned Table Reflow Scroll problem [message #868263 is a reply to message #860383] |
Tue, 01 May 2012 18:24 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Chris,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215997 looks like what
you're describing. I don't think it's going to get fixed soon without
an external contribution though.
I've tried a few things with your snippet, but have only found a rather
ugly workaround, as the underlying bug is baked into the forms layout
implementation. To try the workaround in your snippet:
add fields:
static Rectangle tableBounds;
static boolean isExpanding;
change the expansion listener to:
section.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanging(ExpansionEvent e) {
super.expansionStateChanging(e);
if (e.getState()) {
isExpanding = true;
}
}
public void expansionStateChanged(ExpansionEvent e) {
form.reflow(true);
isExpanding = false;
}
});
add below shell.open():
tableBounds = table.getBounds();
table.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
// don't record bounds change triggered by the buggy layout
if (!isExpanding) {
tableBounds = table.getBounds();
}
}
});
table.addListener(SWT.Show, new Listener() {
public void handleEvent(Event event) {
// asyncExec strikes again
display.asyncExec(new Runnable() {
public void run() {
if (table.isDisposed()) return;
table.setBounds(tableBounds);
}
});
}
});
HTH,
Grant
On 4/27/2012 11:05 PM, Christopher White wrote:
> I'm having some problems with an SWT table within a Form Section. Upon
> initial execution, my table has a vertical scrollbar within it - but
> upon collapsing and then re-expanding the form section, the scrollbar
> now migrates to the form (which is not what i want).
>
> I have some simple code which demonstrates this on pastebin.com/dhBTPBc5
> (apparently i can't post links as i'm under 25 posts..?)
>
> I think this is related to BUG 215997 (again i can't post the link, sorry!)
>
> Does anyone know of a workaround for this?
>
> Thanks, Chris
|
|
|
Powered by
FUDForum. Page generated in 0.03019 seconds