Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 46103 Details for
Bug 150005
[Widgets] CoolBar and CoolItem's 'computeSize' seem broken...
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Snippet to demonstrate the 'computeSize' error
CBComputeSizeError.java (text/plain), 1.91 KB, created by
Eric Moffatt
on 2006-07-11 15:47:16 EDT
(
hide
)
Description:
Snippet to demonstrate the 'computeSize' error
Filename:
MIME Type:
Creator:
Eric Moffatt
Created:
2006-07-11 15:47:16 EDT
Size:
1.91 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package aproj; > >/* > * CoolBar example snippet: drop-down a chevron menu containing hidden tool > * items > * > * For a list of all SWT example snippets see > * http://www.eclipse.org/swt/snippets/ > */ >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.widgets.Canvas; >import org.eclipse.swt.widgets.CoolBar; >import org.eclipse.swt.widgets.CoolItem; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class CBComputeSizeError { > static Display display; > static Shell shell; > > static CoolBar coolBar; > static CoolItem coolItem; > static Canvas border; > > public static void main(String[] args) { > display = new Display(); > shell = new Shell(display); > > coolBar = new CoolBar(shell, SWT.FLAT); > border = new Canvas(coolBar, SWT.NONE) { > public Point computeSize(int wHint, int hHint, boolean changed) { > return new Point(100,100); > } > }; > > coolItem = new CoolItem(coolBar, SWT.NONE); > coolItem.setControl(border); > > Point borderSize = border.computeSize(SWT.DEFAULT, SWT.DEFAULT); > Point coolSize = coolItem.computeSize(SWT.DEFAULT, SWT.DEFAULT); > Point cbSize = coolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 150005
:
46103
|
46192