cancel
Showing results for 
Search instead for 
Did you mean: 

Move userobjects around window area

Former Member
0 Kudos

I am using Powerbuilder 10.5 and have built a window which uses openuserobject to display some custom visual userobjects.

I have managed to use drag/drop events to move my userobjects around the window area but I would prefer a smoother way which would also display the dragged object while it's being moved to its new position. Default drag/drop behavior only displays an icon during drag.

Is there any way I can resolve this?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christos;

  Have you also considered the other Drag Events like:  DragEnter, DragLeave and DragWithin to assist you in enhancing / guiding the users drag experience?

Regards ... Chris

Former Member
0 Kudos

Thanks for the suggestion Chris, already tried with dragwithin which "kind of helps" , object is moved more smoothly but it leaves ugly "traces" on the window surface.

Former Member
0 Kudos

   One thing that might really help you (I think) would be to drop the UO idea and migrate to PB 12.6 where you could use the new Dockable Windows feature instead.

   In the mean time, have you tried doing a Yield ( ) in your DragWithin event code to see if that helps with the screen repainting (ugly "traces") effect?

Former Member
0 Kudos

Thanks a lot Chris,

"Yielding" seems to do the trick although movement is not that smooth anymore but it's far better than before.

Upgrading will not help since these objects are custom and  will still need to be moved around the window area no matter the PB version.

Former Member
0 Kudos

Suggestion: To smooth out the jerkiness, try issuing the Yield ( ) every N times through the DragWithin event script  (where N is an instance variable) instead of every firing of the script mickey by mickey (actual term for one mouse movement on the screen - #pixels per redrawing of the mouse cursor as set by the mouse driver). 

HTH