package com.asg.testproject.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import com.smartgwt.client.widgets.toolbar.ToolStripButton;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class TestProject implements EntryPoint {

	private static final int iconWidth = 24;
	private static final int iconHeight = 24;
	private static final int buttonHeight = 44;
	private static final int buttonWidth = 44;

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		
		ToolStrip toolStrip = new ToolStrip();
		toolStrip.setWidth100();
		toolStrip.setBackgroundColor("#D8D8D8");

		ToolStripButton moreOptionsButton = new ToolStripButton();
		moreOptionsButton.setIcon("icons/24/moreoptions.png");
		moreOptionsButton.setIconHeight(iconHeight);
		moreOptionsButton.setIconWidth(iconWidth);

		// Setting overflow to HIDDEN has no effect on the result when calling setWidth
		//moreOptionsButton.setOverflow(Overflow.HIDDEN);
		moreOptionsButton.setHeight(buttonHeight); // this works nicely for setting the height
		moreOptionsButton.setWidth(buttonWidth); // this has no effect regardless of the value of buttonWidth
		// regardless of the string percent value specified, the button is expanded to its maximum possible size, squeezing any other
		// buttons that come after it all the way to the right.
		//moreOptionsButton.setWidth("3%"); 
		toolStrip.addButton(moreOptionsButton);
		toolStrip.draw();	
	}
}
