Bug 155159 - [Contributions] Incorrect Size for IContributionItem
Summary: [Contributions] Incorrect Size for IContributionItem
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-24 22:10 EDT by Andy Tsoi CLA
Modified: 2019-09-06 16:15 EDT (History)
2 users (show)

See Also:


Attachments
Windows Classic Style (4.76 KB, image/png)
2006-08-24 22:16 EDT, Andy Tsoi CLA
no flags Details
Windows XP Style (4.01 KB, image/png)
2006-08-24 22:17 EDT, Andy Tsoi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Tsoi CLA 2006-08-24 22:10:57 EDT
I have created a ViewPart to display a table and inserted few textboxes into the view’s toolbar area. But their widths are not displayed correctly.

This happened when I choose “Window Classic Style” in Display Properties.


IContributionItem comboCIDone = new ControlContribution("Example")
		{

			protected Control createControl(Composite parent)
			{
				ToolBar bar = (ToolBar) parent;

				Label label = new Label(parent, SWT.NONE);
				label.setBackground(GUIUtil.BLUE);

				return label;
			}

			/*
			 * (non-Javadoc)
			 * @see org.eclipse.jface.action.ControlContribution#computeWidth(org.eclipse.swt.widgets.Control)
			 */
			@Override
			protected int computeWidth(Control control)
			{

				return 200;
			}
		};
Comment 1 Andy Tsoi CLA 2006-08-24 22:16:37 EDT
Created attachment 48668 [details]
Windows Classic Style
Comment 2 Andy Tsoi CLA 2006-08-24 22:17:11 EDT
Created attachment 48669 [details]
Windows XP Style
Comment 3 Boris Bokowski CLA 2006-08-27 21:12:23 EDT
I'm guessing this is SWT, but we need to tell them what happens at their level.
Comment 4 Andy Tsoi CLA 2007-03-28 04:33:14 EDT
Sorry do you have any update on it? We are looking for the answer so that i can find some work around on it.
Comment 5 Paul Webster CLA 2007-04-05 19:05:29 EDT
Assigning to component owner
PW
Comment 6 Paul Webster CLA 2007-06-24 09:58:32 EDT
You should not be casting whatever is passed into createControl(*) ... I'm less sure about how you can control the size.

Eric?

PW
Comment 7 Eric Moffatt CLA 2007-06-25 09:53:28 EDT
Paul, there's another defect that talks about Windows 'Classic' not sizing correctly (in Combos if my memory still works). Perhaps as you slog through the rest of your defects you (or I...;-) might come across it...

Comment 8 Pinard-Legry Guilhaume CLA 2009-03-04 06:46:34 EST
Hello,

Any news about this issue?
I am facing the exact same problem:
using RCP 3.4.1 any ControlContribution is resized very small when switching to Windows classic look&feel.

Is there a workaround while waiting for a patch?

Thank you,

Guilhaume
Comment 9 Pinard-Legry Guilhaume CLA 2009-03-04 06:55:05 EST
(In reply to comment #8)
> Hello,
> 
> Any news about this issue?
> I am facing the exact same problem:
> using RCP 3.4.1 any ControlContribution is resized very small when switching to
> Windows classic look&feel.
> 
> Is there a workaround while waiting for a patch?
> 
> Thank you,
> 
> Guilhaume
> 

Saying "very small size" means very small width: for a checkbox with a label, the label is truncated and I acn only see the box.

Thanks

Guilhaume
Comment 10 Paul Webster CLA 2009-03-04 08:10:31 EST
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009(In reply to comment #8)
> 
> Is there a workaround while waiting for a patch?

Sorry, there's no update at this time.  Probably the next step would be an SWT snippet that shows the problem on win classic vs XP

PW
Comment 11 Eclipse Webmaster CLA 2019-09-06 16:15:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.