From: <oms...@us...> - 2008-02-25 01:13:47
|
Revision: 1607 http://azsmrc.svn.sourceforge.net/azsmrc/?rev=1607&view=rev Author: omschaub Date: 2008-02-24 17:13:52 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Putting the entire contents of the initialize view into a ScrolledComposite. This never shows up correctly on my Linux, but I get a vertical scroll.. let me know if you need more than this Leonard Modified Paths: -------------- azsmrcplugins/trunk/lbms/plugins/mldht/azureus/gui/DHTView.java Modified: azsmrcplugins/trunk/lbms/plugins/mldht/azureus/gui/DHTView.java =================================================================== --- azsmrcplugins/trunk/lbms/plugins/mldht/azureus/gui/DHTView.java 2008-02-20 00:09:25 UTC (rev 1606) +++ azsmrcplugins/trunk/lbms/plugins/mldht/azureus/gui/DHTView.java 2008-02-25 01:13:52 UTC (rev 1607) @@ -16,9 +16,12 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.program.Program; @@ -172,16 +175,39 @@ } private void initialize (Composite comp) { + //comp.setLayout(new GridLayout(1,false)); + GridData gridData = new GridData(GridData.FILL_BOTH); + comp.setLayoutData(gridData); + + + final ScrolledComposite scrollComposite = new ScrolledComposite(comp, SWT.V_SCROLL | SWT.H_SCROLL); + + + final Composite comp_on_sc = new Composite(scrollComposite,SWT.None); + GridLayout gl = new GridLayout(2, false); - comp.setLayout(gl); + comp_on_sc.setLayout(gl); - createDHTStatsGroup(comp); - createControlGroup(comp); - createRPCGroup(comp); - createMessageStatsGroup(comp); + gridData = new GridData(GridData.FILL_BOTH); + comp_on_sc.setLayoutData(gridData); + + createDHTStatsGroup(comp_on_sc); + createControlGroup(comp_on_sc); + createRPCGroup(comp_on_sc); + createMessageStatsGroup(comp_on_sc); - createRoutingTableView(comp); - createTaskTable(comp); + createRoutingTableView(comp_on_sc); + createTaskTable(comp_on_sc); + + scrollComposite.setContent(comp_on_sc); + scrollComposite.setExpandVertical(true); + scrollComposite.setExpandHorizontal(true); + scrollComposite.addControlListener(new ControlAdapter() { + public void controlResized(ControlEvent e) { + Rectangle r = scrollComposite.getClientArea(); + scrollComposite.setMinSize(comp_on_sc.computeSize(r.width, SWT.DEFAULT)); + } + }); } //---------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |