With SmartGWT version 2.5p the code works fine, but with latest SmartGWT 3.0p the background of the menubuttons does not change. Im using Internet Explorer 8.
Made a testproject just to make sure that my problem didnt depend on anything else.
//////******************TestProject.java*********************///
package com.test.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.CssResource.NotStrict;
import com.google.gwt.user.client.Window;
import com.test.client.ApplicationMenu;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class TestProject implements EntryPoint {
private static final int NORTH_HEIGHT = 85; //HEADER_HEIGHT + APPLICATION_MENU_HEIGHT
private VLayout mainLayout;
private HLayout northLayout;
private HLayout southLayout;
private VLayout eastLayout;
private VLayout westLayout;
ApplicationMenu applicationMenu ;
interface GlobalResources extends ClientBundle {
@NotStrict
@Source("TestProject.css")
CssResource css();
}
public void onModuleLoad() {
//inject global styles
GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();
Window.enableScrolling(false);
Window.setMargin("0px");
//mainLayout tar upp hela ytan
mainLayout = new VLayout();
mainLayout.setWidth100();
mainLayout.setHeight100();
northLayout = new HLayout();
northLayout.setHeight(NORTH_HEIGHT);
VLayout vLayout = new VLayout();
vLayout.addMember(new ApplicationMenu());
northLayout.addMember(vLayout);
southLayout = new HLayout();
southLayout.setMembers(westLayout, eastLayout);
mainLayout.addMember(northLayout);
mainLayout.addMember(southLayout);
mainLayout.draw();
}
}
//////***************ApplicationMenu .java*********************///
package com.test.client;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuBar;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.ItemClickEvent;
import com.smartgwt.client.widgets.menu.events.ItemClickHandler;
import com.smartgwt.client.types.VerticalAlignment;
public class ApplicationMenu extends HLayout {
private static final int APPLICATION_MENU_HEIGHT = 27;
private static final int DEFAULT_SHADOW_DEPTH = 10;
private static final int DEFAULT_MENU_WIDTH = 50;
private static final String ICON_PREFIX = "icons/16/";
private static final String ICON_SUFFIX = ".png";
private MenuBar menuBar ;
public ApplicationMenu() {
super();
GWT.log("init ApplicationMenu()...", null);
this.addStyleName("applicationMenu");
this.setHeight(APPLICATION_MENU_HEIGHT);
this.setDefaultLayoutAlign(VerticalAlignment.CENTER);
//Lägg till menuBar ApplicationMenu
menuBar = new MenuBar();
this.addMember(menuBar);
//Skapa huvudmenyer till menuBar
Menu menuArkiv = new Menu();
menuArkiv.setTitle("Arkiv");
menuArkiv.setShowShadow(true);
menuArkiv.setShadowDepth(DEFAULT_SHADOW_DEPTH);
menuArkiv.setWidth(DEFAULT_MENU_WIDTH);
Menu menuVerktyg = new Menu();
menuVerktyg.setTitle("Verktyg");
menuVerktyg.setShowShadow(true);
menuVerktyg.setShadowDepth(DEFAULT_SHADOW_DEPTH);
menuVerktyg.setWidth(DEFAULT_MENU_WIDTH);
menuBar.setMenus(menuArkiv,menuVerktyg);
//Skapa alternativ i Verktygsmenyn
menuVerktyg.addItem(new MenuItem("Admin Databas",ICON_PREFIX + "settings" + ICON_SUFFIX));
menuVerktyg.addItem(new MenuItem("Inställningar",ICON_PREFIX + "settings" + ICON_SUFFIX));
menuVerktyg.addItemClickHandler(new ItemClickHandler() {
public void onItemClick(ItemClickEvent event) {
if (event.getItem().getTitle().compareToIgnoreCase("Admin Databas")==0){
com.smartgwtee.tools.client.SCEE.openDataSourceConsole();
};
}
});
}
}
//***CSS FILE******//
.applicationMenu {
background-image: url(images/menu/application_menu.png);
background-repeat: repeat-x;
color: #15428b;
paddning-left: 4px;
}
/* menu header buttons */
.menuButton,
.menuButtonOver,
.menuButtonDown,
.menuButtonDisabled,
.menuButtonFocused,
.menuButtonFocusedDown,
.menuButtonFocusedOver,
.menuButtonSelected,
.menuButtonSelectedDown,
.menuButtonSelectedOver,
.menuButtonSelectedDisabled {
border: transparent 1px solid;
background: none;
color: #15428b;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 4px;
padding-right: 4px;
font-family:Arial,sans-serif; font-size:12px;
color: #000000;
}
.menuButtonOver {
border: #ffdb6c 1px solid;
background-image:none;
background-color: #ffdb6c;
background-repeat: repeat-x;
color: #15428b;
cursor: default;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 2px;
padding-right: 2px;
}
.menuButtonDown,
.menuButtonFocusedDown,
.menuButtonFocusedOver,
.menuButtonSelected,
.menuButtonSelectedDown,
.menuButtonSelectedOver {
border: #ffdb6c 1px solid;
background-image: url(/images/menu/application_menu_button_down.png);
background-repeat: repeat-x;
color: #15428b;
cursor: default;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 2px;
padding-right: 2px;
}
.menuButtonDisabled,
.menuButtonSelectedDisabled {
color:#AAAAAA;
border:1px solid #A6ABB4;
}
Made a testproject just to make sure that my problem didnt depend on anything else.
//////******************TestProject.java*********************///
package com.test.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.CssResource.NotStrict;
import com.google.gwt.user.client.Window;
import com.test.client.ApplicationMenu;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class TestProject implements EntryPoint {
private static final int NORTH_HEIGHT = 85; //HEADER_HEIGHT + APPLICATION_MENU_HEIGHT
private VLayout mainLayout;
private HLayout northLayout;
private HLayout southLayout;
private VLayout eastLayout;
private VLayout westLayout;
ApplicationMenu applicationMenu ;
interface GlobalResources extends ClientBundle {
@NotStrict
@Source("TestProject.css")
CssResource css();
}
public void onModuleLoad() {
//inject global styles
GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();
Window.enableScrolling(false);
Window.setMargin("0px");
//mainLayout tar upp hela ytan
mainLayout = new VLayout();
mainLayout.setWidth100();
mainLayout.setHeight100();
northLayout = new HLayout();
northLayout.setHeight(NORTH_HEIGHT);
VLayout vLayout = new VLayout();
vLayout.addMember(new ApplicationMenu());
northLayout.addMember(vLayout);
southLayout = new HLayout();
southLayout.setMembers(westLayout, eastLayout);
mainLayout.addMember(northLayout);
mainLayout.addMember(southLayout);
mainLayout.draw();
}
}
//////***************ApplicationMenu .java*********************///
package com.test.client;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuBar;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.ItemClickEvent;
import com.smartgwt.client.widgets.menu.events.ItemClickHandler;
import com.smartgwt.client.types.VerticalAlignment;
public class ApplicationMenu extends HLayout {
private static final int APPLICATION_MENU_HEIGHT = 27;
private static final int DEFAULT_SHADOW_DEPTH = 10;
private static final int DEFAULT_MENU_WIDTH = 50;
private static final String ICON_PREFIX = "icons/16/";
private static final String ICON_SUFFIX = ".png";
private MenuBar menuBar ;
public ApplicationMenu() {
super();
GWT.log("init ApplicationMenu()...", null);
this.addStyleName("applicationMenu");
this.setHeight(APPLICATION_MENU_HEIGHT);
this.setDefaultLayoutAlign(VerticalAlignment.CENTER);
//Lägg till menuBar ApplicationMenu
menuBar = new MenuBar();
this.addMember(menuBar);
//Skapa huvudmenyer till menuBar
Menu menuArkiv = new Menu();
menuArkiv.setTitle("Arkiv");
menuArkiv.setShowShadow(true);
menuArkiv.setShadowDepth(DEFAULT_SHADOW_DEPTH);
menuArkiv.setWidth(DEFAULT_MENU_WIDTH);
Menu menuVerktyg = new Menu();
menuVerktyg.setTitle("Verktyg");
menuVerktyg.setShowShadow(true);
menuVerktyg.setShadowDepth(DEFAULT_SHADOW_DEPTH);
menuVerktyg.setWidth(DEFAULT_MENU_WIDTH);
menuBar.setMenus(menuArkiv,menuVerktyg);
//Skapa alternativ i Verktygsmenyn
menuVerktyg.addItem(new MenuItem("Admin Databas",ICON_PREFIX + "settings" + ICON_SUFFIX));
menuVerktyg.addItem(new MenuItem("Inställningar",ICON_PREFIX + "settings" + ICON_SUFFIX));
menuVerktyg.addItemClickHandler(new ItemClickHandler() {
public void onItemClick(ItemClickEvent event) {
if (event.getItem().getTitle().compareToIgnoreCase("Admin Databas")==0){
com.smartgwtee.tools.client.SCEE.openDataSourceConsole();
};
}
});
}
}
//***CSS FILE******//
.applicationMenu {
background-image: url(images/menu/application_menu.png);
background-repeat: repeat-x;
color: #15428b;
paddning-left: 4px;
}
/* menu header buttons */
.menuButton,
.menuButtonOver,
.menuButtonDown,
.menuButtonDisabled,
.menuButtonFocused,
.menuButtonFocusedDown,
.menuButtonFocusedOver,
.menuButtonSelected,
.menuButtonSelectedDown,
.menuButtonSelectedOver,
.menuButtonSelectedDisabled {
border: transparent 1px solid;
background: none;
color: #15428b;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 4px;
padding-right: 4px;
font-family:Arial,sans-serif; font-size:12px;
color: #000000;
}
.menuButtonOver {
border: #ffdb6c 1px solid;
background-image:none;
background-color: #ffdb6c;
background-repeat: repeat-x;
color: #15428b;
cursor: default;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 2px;
padding-right: 2px;
}
.menuButtonDown,
.menuButtonFocusedDown,
.menuButtonFocusedOver,
.menuButtonSelected,
.menuButtonSelectedDown,
.menuButtonSelectedOver {
border: #ffdb6c 1px solid;
background-image: url(/images/menu/application_menu_button_down.png);
background-repeat: repeat-x;
color: #15428b;
cursor: default;
font-family: Tahoma, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
padding-left: 2px;
padding-right: 2px;
}
.menuButtonDisabled,
.menuButtonSelectedDisabled {
color:#AAAAAA;
border:1px solid #A6ABB4;
}