package gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.drawing.DrawPane;
import com.smartgwt.client.widgets.drawing.DrawRect;
import com.smartgwt.client.widgets.events.MouseDownHandler;
import com.smartgwt.client.widgets.events.RightMouseDownEvent;
import com.smartgwt.client.widgets.events.RightMouseDownHandler;
import com.smartgwt.client.widgets.events.DrawEvent;
import com.smartgwt.client.widgets.events.DrawHandler;
import com.smartgwt.client.widgets.events.MouseDownEvent;

public class PinchZoomTest implements EntryPoint {
  private DrawPane drawPane;

  public void onModuleLoad() {
    drawPane = new DrawPane();
    drawPane.addMouseDownHandler(new MouseDownHandler() {
      public void onMouseDown(MouseDownEvent event) {
        SC.logWarn("Got a mouse down event at "+event.getX()+","+event.getY());
      }      
    });
    drawPane.addRightMouseDownHandler(new RightMouseDownHandler() {
      public void onRightMouseDown(RightMouseDownEvent event) {
        SC.logWarn("Got a right mouse down event at "+event.getX()+","+event.getY());
      }      
    });
    drawPane.setCanDragScroll(true);
    drawPane.setEdgeSize(5);
    drawPane.setEdgeOpacity(25);
    drawPane.setShowEdges(true);
    drawPane.setWidth(1000);
    drawPane.setHeight(1000);
    
    drawPane.addDrawHandler(new DrawHandler() {
      public void onDraw(DrawEvent event) {
        DrawRect rect = new DrawRect();
        rect.setDrawPane(drawPane);
        rect.moveTo(50,50);
        rect.setWidth(750);
        rect.setHeight(500);
        rect.setLineWidth(1);
        rect.setFillColor("#ff0000");
        rect.setLineColor("#0000ff");
        rect.draw();
      }     
    });
    drawPane.draw();
  }
}
