Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo in a Toolbar
Combo in a Toolbar [message #448485] Tue, 11 January 2005 05:10
Mark Diggory is currently offline Mark DiggoryFriend
Messages: 202
Registered: July 2009
Senior Member
I'm working with ControlCOntributor to deliver a combo/text field in a
View Toolbar. I'd like to control the length of the combo so that it
fills the Toolbar (ie like an "address bar" in Firefox.) Heres the code
I have that creates the Combo, I realize that the ToolbarItem wrapper
somehow controls the width. I can't seem to locate the Layout for the
toolbar (if one even exists...). Any tips would be great!

My ControlContribution class

> protected Control createControl(Composite parent) {
> text = new Combo(parent, SWT.DROP_DOWN|SWT.FLAT); //$NON-NLS-1$
> ...
> return text;
> }
> protected int computeWidth(Control control) {
> return control.computeSize(300, SWT.DEFAULT, true).x;
> }

Right now, as you see, I am forcing the length to be 300px in
computeWidth. I'd like this to be more dynamic so that the combo filled
all excess space in the toolbar, I'd also like it to have a minimum size
so that the toolbar folded over properly when there was no space.

Previous Topic:Source of word processing type icons for Eclipse platform?
Next Topic:How to prevent a widget to gain focus...
Goto Forum:

Current Time: Tue May 18 09:06:56 GMT 2021

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

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

Back to the top