I did that mostly so I could separate it out into a method like I just did;
private void updateLastClickedLocation() {
int x = Event.getCurrentEvent().getClientX();
int y = Event.getCurrentEvent().getClientY();
InstructionProcessor.lastclicked_x = x - this.getElement().getAbsoluteLeft() + this.getElement().getScrollLeft() +
this.getElement().getOwnerDocument().getScrollLeft();
InstructionProcessor.lastclicked_y = y - this.getElement().getAbsoluteTop() + this.getElement().getScrollTop() +
this.getElement().getOwnerDocument().getScrollTop();
}
As I'll be using this a bit.
I'll try this now, the code was a lot more simple then I thought. I was thinking getAbsoluteLeft on a element only returned X relative to its container.
This is all on a dragable absolute panel I made, with elements on it that are click-able with various mouse buttons while the container still being dragable itself. I could probably use a normal click handler, but I find it neater to use the switch method seeing as I am handling all the event types anyway.