Jump to content

Zorder, drag and drop, and $GUI_ONTOP

Recommended Posts

This drives me nuts. Simply create form1, include an input box and make it accept drops. Create form2, with another input box (or whatever control you like, lables, treeviews, listviews, etc) and make it accept drops. Each form works independently of the other. Merge them together in one script. Have form1 first in script, form2 second. Show form1. Drag and drop. Works fine.

Now (rather form1 is hidden or not) show/switch to form2. If form2 droppable control is inside the frame of form1, the drop is blocked. Drag form2 over some, so the drop target is partly outside the frame of form1, and the drop works.

I initially had this issue, and then learned that AutoIt's zorder seems to be based upon which gui is created first in the script. First made, first zorder.

Is there an equivilent to the control $GUI_ONTOP for a form? Cause I don't see one.

Granted, the script I am running could have other issues.

I error check it by (using event mode) a simple message box at beginning of a function that monitors all drop's. The message box displays the @GUI_DropId. As I stated, form2, when at least partly outside of form1's frame, delivers the DropId. However, it does not even return an ID at all when it is inside the frame.

All I have to work on is this

!>AutoIT3.exe ended.rc:-1073741819

Am I wrong here? Is there a different way to handle zorders in AutoIt that I missed?



Edit: Forgot, WinSetOnTop does work. I am just wondering how to handle zorder when creating gui's, wether this is a code sequence or ex style issue or something else.

Edited by sulfurious
Link to post
Share on other sites

Hmm. After some more experimenting.... Well, I have tried this

setting form1 as parent of form2

using WinSetOnTop

using $GUI_ONTOP (for the control)

using WinSetOnTop (0 for removal form1)

It appears that if I have other contorls on form1, such as progress bars, labels, buttons, input box, etc, that if the drop is over one of these controls (they are on form1, beneath the drop point), then it randomly either does nothing, meaning I get no drop event at all, or it just exits the script, again with no drop action.

However, if I drop where the underlying form1 has no control at all, it works correctly.



Link to post
Share on other sites
  • Moderators

Is there a script for us to look at or are you hogging it all to yourself? :lmao:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...