Hi,
1) it's very confusing to have a different behavior of the [SKIN] location on a MenuItem then everywhere else.
Usually, this gives the right URL on most components:
setIcon("[SKIN]/actions/approve.png");
but not on MenuItem, this gives a 404. On a ToolStripButton this works.
This location is OK to show the approve icon on the MenuItem:
setIcon("[SKIN]/../actions/approve.png");
2) Setting ToolStripButton.setShowTitle(false) also hides its icon.
- There is no setShowIcon(boolean) method
I wanted to set a title and switch on the title in my clickhandler, so I could have just one handler for all ToolStripButtons, since there is no setName(String) on ToolStripButton.
Repro:
SmartGWT EE 2.3
GWT 2.0.4
IE8 dev mode
1) it's very confusing to have a different behavior of the [SKIN] location on a MenuItem then everywhere else.
Usually, this gives the right URL on most components:
setIcon("[SKIN]/actions/approve.png");
but not on MenuItem, this gives a 404. On a ToolStripButton this works.
This location is OK to show the approve icon on the MenuItem:
setIcon("[SKIN]/../actions/approve.png");
2) Setting ToolStripButton.setShowTitle(false) also hides its icon.
- There is no setShowIcon(boolean) method
I wanted to set a title and switch on the title in my clickhandler, so I could have just one handler for all ToolStripButtons, since there is no setName(String) on ToolStripButton.
Repro:
Code:
public VLayout getTest1() { VLayout panel = new VLayout(); //This icon location is translated into the following URL //404 - GET /smarteetester/sc/skins/Enterprise/images/Menu/actions/approve.png MenuItem validateMenuItem = new MenuItem("Icon is gone"); validateMenuItem.setIcon("[SKIN]/actions/approve.png"); //This points to the correct location MenuItem validateMenuItem2 = new MenuItem("Icon is OK"); validateMenuItem2.setIcon("[SKIN]/../actions/approve.png"); //...which is confusing, because on ToolStripButton the 'normal' location must be set: //This is OK ToolStripButton validateButton2 = new ToolStripButton(); validateButton2.setIcon("[SKIN]/actions/approve.png"); //An icon is desired, but a title is not ToolStripButton validateButton3 = new ToolStripButton("Title"); validateButton3.setIcon("[SKIN]/actions/approve.png"); //if I give a title and setShowTitle(false), then the icon disappears as well! ToolStripButton validateButton = new ToolStripButton("Approve"); validateButton.setShowTitle(false); validateButton.setIcon("[SKIN]/actions/approve.png"); //ToolStripButton has no setName() Menu menu2 = new Menu(); menu2.setShowShadow(true); menu2.setShadowDepth(10); menu2.setItems(validateMenuItem, validateMenuItem2); IMenuButton menuButtonBI = new IMenuButton("Item", menu2); menuButtonBI.setWidth(100); ToolStrip toolstrip = new ToolStrip(); toolstrip.setWidth100(); toolstrip.addButton(validateButton); toolstrip.addButton(validateButton2); toolstrip.addButton(validateButton3); toolstrip.addMember(menuButtonBI); panel.addMember(toolstrip); return panel; }
SmartGWT EE 2.3
GWT 2.0.4
IE8 dev mode
Comment