Question How to drag and drop an editor field widget using mouse out of an child frame widget into another child frame widget (or the parent frame)

steini

New Member
Hello,
it is possible to drag and drop an editor field widget from an parent frame to a child frame widget using mouse. But how to drag and drop an editor field widget using mouse out of a child frame? It seems that it is not possible to move the widget out to e.g. parent frame or another child frame. Is there a possibility to solve this? Maybe a workaround.. Thank you very much.

Steini
 

PatrickTingen

New Member
I don't think it is possible at all to re-parent a widget. I tried building a small example, but when I try to set the new parent for an editor, Progress forbids this:

1688113109530.png 1688113137905.png

But you can just move the field around, test it with the attached program. Uncomment the lines in the procedure 'checkNewFrame' to see the errors. Note that a static editor behaves different than a dynamic one.
 

Attachments

  • test-1.w
    9.9 KB · Views: 9

steini

New Member
Hello, thank you for reply. Yes, it seems to be not possible. The first "drag&drop" from e.g. top frame to a child can be done by a workaround-> delete the editor widget and recreate a new one with new parent.. this works .. But to move (drag) the editor widget out of the child frame to
a) another child or b) top frame.. this can not be solved actually.. must also be something complex with delete and recreate but i guess this will not work very visuually smooth and good looking.. or do you have an idea ?
 

Cringer

ProgressTalk.com Moderator
Staff member
Shouldn't be too hard to delete the object and recreate it with the same properties as the old object, just a different frame. If you hide the widget, create the new one hidden and then unhide it once it's realised it shouldn't look too bad or be too slow. But I'd question why you want to do it.
 

steini

New Member
Thank you again. Why.. we are trying to create a simple drag&drop tool with basic progress tools. We want to drag&drop shipments/records (= editor widgets) to truck/records (frame widget). As mentioned, this works quite good using delete and recreate in one direction (into the frame). But out of the child frame...hmmm .. if you have an simple example.. i would be thankful..

more or less it look like this..

1688391183394.png
 
Last edited:

PatrickTingen

New Member
In that case, perhaps another way to look at it is to determine the coordinates of the editor when you drop it. Based on that you know where they want the shipment to be in the schedule. Then at that point change the data underneath and just redraw the screen. No need for reparenting and - bonus - less coupling with the UI.

And redrawing can be done quite smart. Since UI operations in ABL are slow, you probably don't want to redraw blocks that did not change. I have a few programs where I do something similar. There I save the widget handles in a temp-table for re-use so I don't have to create them again when I redraw the screen.
 

steini

New Member
Hi,
do you mean not using frame widgets at all? Actually we are using n - frame widgets as a containers for a truck/ship etc. We delete editor widget in top frame and create in container frame widget. Automatically scrolling within this frame works (lot of shipments) and we do have a lot of this container frames (e.g. trucks) and staff even can move the frame widget around on screen (including all shipmenst in it).
 

PatrickTingen

New Member
Indeed, that was what I meant, but I can see your case for usage of frames (scrolling) so I think it is wise to stick with that. However, what might be possible is to delete the widget when you move it from one frame to another and then re-create it in the new frame, like @Cringer mentioned.
 

steini

New Member
Indeed, that was what I meant, but I can see your case for usage of frames (scrolling) so I think it is wise to stick with that. However, what might be possible is to delete the widget when you move it from one frame to another and then re-create it in the new frame, like @Cringer mentioned.
hi, tried to implement this.. actually we have two problems...
a) picking the editor widget with first left mouse and move out of a frame in one step is not possible, because of deleting the current selected widget crashes the program. Therefore first left-mouse-click and select the widget, delete it and create it in top frame widget, then you can move it around...
b) when editor widget was deleted from child frameA and recreated in top frame... but not moved to another frame it seems (visually) that it is still in frameA, but it is not.. it is in top frame. Actually this is visible based on the text inside the editor widget (i am in top frame).. but in production other information will not inform about that :-(

What do you think? Any suggestions or improvements will be welcome ;-)
 

Attachments

  • test1-2.w
    13 KB · Views: 0

missguided79

New Member
Hello,
it is possible to drag and drop an editor field widget from an parent frame to a child frame widget using mouse. But how to drag and drop an editor field widget using mouse out of a child frame? It seems that it is not possible to move the widget out to e.g. parent frame or another child frame. Is there a possibility to solve this? Maybe a workaround.. Thank you very much.

Steini
Y R DO U WANT 2 do it the hard way
> Just already HAVE the widget (editor) in a frame with visability attributes of the frame and widget set 2 false.
Then on the appropriate mouse trigger - set the visibility attributes 2 true
Gives the impression 2 the user that IS wanted
 
Top