XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 7th, 2025, 11:06 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: February 4th, 2018, 3:00 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
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.

Image

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.


Top
 Profile  
 
PostPosted: March 9th, 2018, 6:33 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Jim, please - add to the bug list


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group