Jump to content

How do overlapped controls work


therks
 Share

Recommended Posts

I was trying something just earlier, not out of any real need, more just a proof of concept kind of thing, and ran into a bit of a problem I hadn't expected.

See, the way I figured things went GUI wise, was that the z-order of controls pertained to the order of their creation.

ie: If Ctrl1 and Ctrl2 are overlapped, then whichever was created second would be on top of the first.

For example:

$gui_pic_Main = GuiCtrlCreatePic('main.gif', 0, 0, 275, 116);
$gui_pic_Close = GuiCtrlCreatePic('close.gif', 265, 4, 7, 7);

Then Close would be above Main, hence if you clicked Close, it would return it's ID, and if you clicked anywhere else (Main takes up the entire area of the GUI) then Main's ID would be returned.

But this is not how it works. Instead, everywhere I click returns Main's ID.

Now, just so I could say I tried everything, I did attempt creating the controls in reverse. This resulted in the correct result event wise, but not graphically.

Now, as it stands, I don't need this functionality, I just thought it would be a neat idea to try, but I was wondering if there was any possibility that a fix for this would be rather simple on the developers end. If not, then I certainly don't expect it. It'd be nice, but I'm not greedy (especially for something I don't currently need). But if it can be changed/fixed, I think it'd be cool, and with it in mind, I'm sure I, or someone else, could whip up some fairly neat scripts.

Anyway, I've attached an example of the script I was trying out.

It's just a recreation of the Winamp window. The attempted working controls are the 5 play control buttons (Previous, Play, Pause, Stop, Next) and the top right corner buttons (Minimize, "Maximize", Close). You'll note that clicking any of them produces the same result.

Also, right clicking anywhere will change the skin.

You'll have to keep the paths in order when you extract the files, otherwise the skins won't work.

Link to comment
Share on other sites

Weird. Any suggestions then?

<{POST_SNAPBACK}>

Sorry for not searching an answer.

I don't know how to force the overlap control to notify but I know how to not notify

$gui_pic_Main = GuiCtrlCreatePic('default.gif', 0, 0, 275, 116,0);

Merry Christmas :idiot:

Link to comment
Share on other sites

Z-order is related to creation but in the reverse order that you think.

You can change the tabstop/z-order with something like this code

EDIT: You could also create the main gif last and with the WS_CLIPSIBILINGS style:

Global $WS_CLIPSIBLINGS = 0x4000000;
$gui_pic_Main = GuiCtrlCreatePic('default.gif', 0, 0, 275, 116, $WS_CLIPSIBLINGS);
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Z-order is related to creation but in the reverse order that you think.

You can change the tabstop/z-order with something like this code

EDIT:  You could also create the main gif last and with the WS_CLIPSIBILINGS style:

Global $WS_CLIPSIBLINGS = 0x4000000;
$gui_pic_Main = GuiCtrlCreatePic('default.gif', 0, 0, 275, 116, $WS_CLIPSIBLINGS);

<{POST_SNAPBACK}>

I am not sure the overlap is related to the tabstop.

For $WS_CLIPSIBLINGS it look lile you just suppress the notification as 0 does :idiot:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...