If I set an icon (.setIcon()) to a IMenuButotn (taken from http://www.smartclient.com/smartgwt/...components_new), nothing happens. The icon is not shown. How to show an icon here?
Using 6.0-p20160519.
Using 6.0-p20160519.
public void onModuleLoad() { final IMenuButton menuButton = createErstellenButton(); menuButton.setWidth(100); menuButton.setAutoDraw(false); final HStack layout = new HStack(); layout.setWidth100(); layout.setMembers(menuButton); layout.draw(); } private IMenuButton createErstellenButton() { final Menu menu = new Menu(); menu.setWidth(570); menu.setAutoDraw(false); /* Trenner */ FileItem trennerImageItem = new FileItem("f_image"); trennerImageItem.setRequired(true); trennerImageItem.setWidth(250); trennerImageItem.setShowTitle(false); TextItem trennerFilename = new TextItem("f_image_filename"); trennerFilename.setVisible(false); final DynamicForm trennerDynamicForm = new DynamicForm(); trennerDynamicForm.setWidth(200); trennerDynamicForm.setSnapTo("TR"); trennerDynamicForm.setFields(trennerImageItem); final IButton addTrennerButton = new IButton("erstellen"); addTrennerButton.setWidth(100); addTrennerButton.setIcon(KidsIcons.SAVE.getFilename()); final HStack trennerEmbedded = new HStack(); trennerEmbedded.setDefaultLayoutAlign(VerticalAlignment.CENTER); trennerEmbedded.setAutoDraw(false); trennerEmbedded.setSnapTo("TR"); trennerEmbedded.setHeight100(); trennerEmbedded.setMembers(trennerDynamicForm, addTrennerButton); final MenuItem trennerErstellenMenuItem = new MenuItem("trenner"); trennerErstellenMenuItem.setShowRollOver(false); trennerErstellenMenuItem.setEmbeddedComponentFields("key"); trennerErstellenMenuItem.setEmbeddedComponent(trennerEmbedded); /* Bereich */ FileItem pageImageItem = new FileItem("f_image"); pageImageItem.setTitle("bild"); pageImageItem.setRequired(true); pageImageItem.setWidth(280); SelectItem pageItem = new SelectItem("f_page"); pageItem.setTitle("kategorie"); pageItem.setSortField("f_display_reihenfolge"); pageItem.setDisplayField("f_display_text"); pageItem.setValueField("f_id"); pageItem.setWidth(280); pageItem.setRequired(true); SelectItem klasseTypItem = new SelectItem("f_klasse_typ", "Klasse"); klasseTypItem.setWidth(280); klasseTypItem.setRequired(true); ColorPickerItem backgroundColorItem = new ColorPickerItem("f_background_color"); backgroundColorItem.setTitle("background"); backgroundColorItem.setRequired(true); backgroundColorItem.setWidth(280); backgroundColorItem.setDefaultPickerMode(ColorPickerMode.COMPLEX); final DynamicForm pageDynamicForm = new DynamicForm(); pageDynamicForm.setWidth(300); pageDynamicForm.setSnapTo("TR"); pageDynamicForm.setFields(pageImageItem, pageItem, klasseTypItem, backgroundColorItem); final IButton addpageButton = new IButton("erstellen"); addpageButton.setWidth(100); addpageButton.setIcon(KidsIcons.SAVE.getFilename()); final VStack pageEmbedded = new VStack(5); pageEmbedded.setDefaultLayoutAlign(Alignment.RIGHT); pageEmbedded.setAutoDraw(false); pageEmbedded.setSnapTo("TR"); pageEmbedded.setHeight100(); pageEmbedded.setWidth(100); VLayout spacer = new VLayout(); spacer.setHeight(10); pageEmbedded.setMembers(pageDynamicForm, addpageButton, spacer); final MenuItem pageErstellenMenuItem = new MenuItem("Bereich"); pageErstellenMenuItem.setShowRollOver(false); pageErstellenMenuItem.setEmbeddedComponentFields("key"); pageErstellenMenuItem.setEmbeddedComponent(pageEmbedded); menu.setData(new MenuItemSeparator(), trennerErstellenMenuItem, new MenuItemSeparator(), pageErstellenMenuItem, new MenuItemSeparator()); final IMenuButton erstellenButton = new IMenuButton("erstellen", menu); erstellenButton.setWidth(100); erstellenButton.setAutoDraw(false); erstellenButton.setBaseStyle("buttonRounded"); erstellenButton.setHeight(28); [B]erstellenButton.setIcon("myIcon.ico");[/B] return erstellenButton; }
Comment