Bug 60704 - Long menu item labels cut off
Summary: Long menu item labels cut off
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 61146 61209 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-02 20:59 EDT by Brock Janiczak CLA
Modified: 2004-05-06 12:20 EDT (History)
3 users (show)

See Also:


Attachments
truncated menu items (16.54 KB, image/png)
2004-05-02 21:01 EDT, Brock Janiczak CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brock Janiczak CLA 2004-05-02 20:59:41 EDT
Build id: 200404281424
xp manifest installed
comctrl32.dll 5.82.2800.1106

Some menu items in the edit menu (for the java editor) have truncated labels. 
eg. incremental find previous

M8 did not show the accelerators for these long menu items

will attach a screenshot
Comment 1 Brock Janiczak CLA 2004-05-02 21:01:55 EDT
Created attachment 10204 [details]
truncated menu items

notice 'incremental find previous' and 'show tooltip description' are truncated
Comment 2 Brock Janiczak CLA 2004-05-02 22:54:33 EDT
I am not 100% sure this is an SWT bug as i couldn't reproduce with a snippet.

The problem seems to be triggered by the workbench command system updating the
assigned keystrokes of the menu items.  I traced though the processa nd all it
seem to end up doing is changing the text of the MenuItem with setText();

test steps:
1. Open a java file
2. click on the edit menu
3. Notice cut off labels
4. give focus to the package explorer or navigator
5. Click on the Edit menu. No accelerators are listed but the menu is the same
size as in step 3.
Comment 3 Steve Northover CLA 2004-05-03 17:11:57 EDT
It's SWT.  We have a work around for this bug in Windows that is not being 
triggered.
Comment 4 Steve Northover CLA 2004-05-03 19:41:58 EDT
This code shows the problem:

import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

public class PR_60704 {
public static void main (String [] args) {
	Display display = new Display ();
	Image image = new Image (display, 16, 16);
	Shell shell = new Shell (display);
	Menu menu = new Menu (shell, SWT.BAR);
	shell.setMenuBar (menu);
	MenuItem fileItem = new MenuItem (menu, SWT.CASCADE);
	fileItem.setText ("File");
	Menu fileMenu = new Menu (shell, SWT.DROP_DOWN);
	fileItem.setMenu (fileMenu);
	MenuItem item0 = new MenuItem (fileMenu, SWT.CHECK);
	item0.setText ("Delete\tDelete");
	item0.setImage (image);
	MenuItem item2 = new MenuItem (fileMenu, SWT.PUSH);
	item2.setText ("Incremental Find Previous\tCtrl+Shift+J");
	shell.pack ();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	image.dispose ();
	display.dispose ();
}
}
Comment 5 Steve Northover CLA 2004-05-03 19:52:47 EDT
Fixed > 20040503
Comment 6 Nick Edgar CLA 2004-05-05 14:23:11 EDT
This change causes a problem whereby the text label for MenuItems with sub-Menus
are blank.

To see:
- new window in resource perspective
- in Navigator view, clear selection and pop up the menu
- pop up the menu again
- the New menu item is blank

If I back out the change to Menu (back to v1.71), it works OK.

Comment 7 Steve Northover CLA 2004-05-05 17:58:26 EDT
Fixed > 20040505

Sorry about that.  I was unable to self host in order to check the change.  I 
still can't but I fixed it using someone else's workspace.
Comment 8 Nick Edgar CLA 2004-05-06 09:53:17 EDT
*** Bug 61146 has been marked as a duplicate of this bug. ***
Comment 9 Steve Northover CLA 2004-05-06 11:27:35 EDT
Please watch for this again and bug #61146.  The fix was not complete and more 
code has been changed in the same area.  Thanks.
Comment 10 Nick Edgar CLA 2004-05-06 12:19:34 EDT
*** Bug 49811 has been marked as a duplicate of this bug. ***
Comment 11 Nick Edgar CLA 2004-05-06 12:20:38 EDT
*** Bug 61209 has been marked as a duplicate of this bug. ***