Extending or increaing horizontal scrollbar width [message #1007277] |
Tue, 05 February 2013 05:44  |
Eclipse User |
|
|
|
I used the below code to combine two canvas.
package com.cavium.test.views;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class TwoCanvas {
/**
* @param args
*/
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("Canvas Test");
Composite mainComp = new Composite(shell, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.horizontalSpacing = 0;
mainComp.setLayout(layout);
mainComp.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, true, true));
final Canvas hwCanvas = new Canvas(mainComp, SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL);
hwCanvas.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
hwCanvas.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
hwCanvas.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, false, true));
hwCanvas.getVerticalBar().setVisible(false);
final Canvas traceCanvas = new Canvas(mainComp, SWT.NO_REDRAW_RESIZE | SWT.H_SCROLL | SWT.V_SCROLL);
traceCanvas.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
traceCanvas.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
traceCanvas.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, true, true));
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
Is it possible to increase the width(length) of the horizontal scrollbar as attached here
Attachment: canvas.jpeg
(Size: 10.38KB, Downloaded 276 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03852 seconds