package com.ssdi.test.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.ImgButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuItem;


/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class TestsmartGwtProject implements EntryPoint {
	
	private ImgButton viewMenuButton;
	private ImgButton discoverButton;
	private ImgButton statusUpdateButton;
	private ImgButton secDBButton;
	private ImgButton fssButton;

	
	public void onModuleLoad() {
		VLayout vlay = new VLayout(10);
		HLayout hlay = new HLayout();
		hlay.setAlign(Alignment.LEFT);
		hlay.setMembersMargin(2);
		hlay.setExtraSpace(30);
		hlay.setMargin(2);

		final Menu groupMenu = new Menu();
		groupMenu.setShowShadow(true);
		groupMenu.setShadowDepth(10);

		MenuItem m1 = new MenuItem("MenuItem1");
		MenuItem m2 = new MenuItem("MenuItem2");
		MenuItem m3 = new MenuItem("MenuItem3");
		groupMenu.setItems(m1, m2, m3);

		viewMenuButton = new ImgButton();
		viewMenuButton.setSrc("./Group_Menu.png");
		viewMenuButton.setWidth(24);
		viewMenuButton.setHeight(24);
		viewMenuButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				groupMenu.showNextTo(viewMenuButton, "right");
				groupMenu.showContextMenu();

			}
		});

		discoverButton = new ImgButton();
		discoverButton.setWidth(24);

		discoverButton.setHeight(24);
		discoverButton.setTooltip("Search1");
		discoverButton.setHoverWrap(false);
		discoverButton.setSrc("./Search_Start.png");
		discoverButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				SC.say("Search1");
			}
		});

		statusUpdateButton = new ImgButton();
		statusUpdateButton.setWidth(24);

		statusUpdateButton.setHeight(24);
		statusUpdateButton.setTooltip("Search2");
		statusUpdateButton.setHoverWrap(false);
		statusUpdateButton.setSrc("./Search_Start.png");
		statusUpdateButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				SC.say("Search2");
			}
		});

		secDBButton = new ImgButton();
		secDBButton.setWidth(24);

		secDBButton.setHeight(24);
		secDBButton.setTooltip("Search3");
		secDBButton.setHoverWrap(false);
		secDBButton.setSrc("./Search_Start.png");
		secDBButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				SC.say("Search3");
			}
		});

		fssButton = new ImgButton();
		fssButton.setWidth(24);

		fssButton.setHeight(24);
		fssButton.setTooltip("Search4");
		fssButton.setHoverWrap(false);
		fssButton.setSrc("./Search_Start.png");
		fssButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				SC.say("Search4");
			}
		});

		hlay.addMembers(viewMenuButton, discoverButton, statusUpdateButton,
				fssButton, secDBButton);
		vlay.addMember(hlay);
		RootPanel.get().add(vlay);
		

	}

}
