@Override
	public void onBrowserEvent(Event event) {
		if (!event.getCurrentEventTarget().cast().equals(getElement())) {
			super.onBrowserEvent(event);
			return;
		}
		if (width == -1) {
			determineSizes();
		}

		boolean mouseEvent = false;
		int type = DOM.eventGetType(event);
		switch (type) {
			case Event.ONMOUSEDOWN:
				mouseDown = true;
			case Event.ONMOUSEMOVE:
				mouseEvent = true;
			case TouchEvent.ONTOUCHSTART:
			case TouchEvent.ONTOUCHMOVE:
				if (!mouseEvent || mouseDown) {
					int xPos = xPos(event, type);
					handleDrag(xPos);
				}
				break;
			case Event.ONMOUSEUP:
				mouseDown = false;
		}
		event.stopPropagation();
	}