Xwidget has no implementation of the onMouseDrag event.
This makes it difficult to implement a slider of some sort in code. Xwidget has all the other events onMouseDown, onMouseEnter &c but onMouseDrag has not been implemented which is a strange omission.
For example: You might want to click upon a graphical object to grab it and then move it elsewhere, locked in one axis so it slides to the right/left or up/down.

A drag function can be simulated using onMouseDown in combination with onMouseMove using :
Code:
function playListSliderOnMouseDown(Sender,Button,Shift,X,Y)
{
playListSliderClicked = true ;
pdx = X;
pdy = Y;
}
Code:
function playListSliderOnMouseMove(Sender,Shift,X,Y,Dx,Dy)
if (playListSliderClicked) {
Sender.top = Sender.top + Y - pdy;
}
}
However, the problem is that with Xwidget the mouse move does not keep pace with the cursor and so the mouse cursor can easily leave the boundaries of the image whilst the image is being dragged. If you pull the cursor one way or another then the image stops being dragged when the cursor exits. This is not a proper drag function but a mere emulation of it. It works better with large images as it is more difficult to exit the boundaries of the image than it is with smaller images. OnMouseDrag, when implemented this way on small images, basically does not work.
Other engines that use javascript functions have implemented the onMouseDrag function as a polyfill so you can use the following:
Code:
playListSlider.onMouseDrag = function(event) {
playListSlider.vOffset = event.vOffset -5;
}
The mouse event and position of that event is noted and passed to the function and the graphical element is dragged according to the cursor position.
The problem is that Jscript, Microsoft's implementation of javascript (which Xwidget uses for its scripting) does not implement an onMouseDrag event so neither does Xwidget. My suggestion is that Tony Implement onMouseDrag as a polyfill providing Xwidget with the functionality that other widget engines provide. The Yahoo widget designers were clever chaps and they recognised the need for an onMouseDrag function and they implemented it as a polyfill extending javascript to incorporate a very useful function.
PS. Jim, add this please to the list of suggestions.
onMouseDrag definition - The mousedrag event is sent when the user moves the mouse over an object with the mouse button held down.