redndahead Posted July 28, 2004 Posted July 28, 2004 Maybe this is not possible but here is my problem. I tried to create a button that sits on top of a label. If you try to click on the button it doesn't work. As soon as you move the button off of the label it can click. I first created the label then the button so the button sits on top. If i create the button first and then the label the label hides the button as expected but when you click on the label it clicks the button. Any way to change this behavior? red
Holger Posted July 28, 2004 Posted July 28, 2004 I don't really understand what you mean. What do you mean with "button that sits on top of a label"? Could you make a screenshot please? I don't have an idea what do you describes Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Hooch Posted July 28, 2004 Posted July 28, 2004 Wouldn't it be better/easier to toggle if the button is present? i.e GUISetControlEx($MyButton, 32) or GUISetControlEx($MyButton, 16) I have one set of buttons on a tab that are shown based on if a checkbox is checked or not.
this-is-me Posted July 28, 2004 Posted July 28, 2004 He wants the zorder of the button to over lap part of the label. Who else would I be?
Hooch Posted July 28, 2004 Posted July 28, 2004 Oh you want it to be visible but unclickable.... or am I still missing the point? If I am not then you can toggle the "disabled" style?
Valik Posted July 28, 2004 Posted July 28, 2004 Who cares if it clicks the button... just ignore the message?
this-is-me Posted July 28, 2004 Posted July 28, 2004 (edited) |----------------------------------| | | | | | button | | |----------------------| | | | |----------------------------------| | | label | | | |-----------------------------------| I think that is what he wants. Edited July 28, 2004 by this-is-me Who else would I be?
Holger Posted July 28, 2004 Posted July 28, 2004 Hmmm...at the moment I can't understand why such overlapping is needed... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
CyberSlug Posted July 29, 2004 Posted July 29, 2004 I'm not sure if this is what you want, but see my post hereHere's the relevant excerpt:GuiCreate($title, 200, 100, 10, 10, 0x80000000) ;;; CREATE ALL CONTROLS BEFORE THE BACKGROUND $hello = GuiSetControl("button","Hello", 10, 10, 30, 20) $close = GuiSetControl("button","Close", 140, 60, 30, 20) $background = GuiSetControl("label","", 0, 0, 200, 100) GuiShow() WinSetOnTop($title, "", 1) ;;; SET CONTROL STATES TO SHOW... IN ORDER FOR THE WINDOW TO REPAINT (MAKE BUTTONS APPEAR ON TOP) GUISetControlEx($hello, 16);show GUISetControlEx($close, 16);show Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Valik Posted July 29, 2004 Posted July 29, 2004 (edited) Just like the Windows Z-Order, though, the last thing with focus will be at the top. In the case of controls, the last control that was clicked will be the one on top. So with the example this-is-me posted, you could click on either control to bring that particular one to the top (I guess that's provided the label is a tab-stop, which labels aren't by default). Unless you really really know what you're doing, overlapping controls is not a good idea. Edited July 29, 2004 by Valik
this-is-me Posted July 29, 2004 Posted July 29, 2004 If you code the same overlap in visual basic, it doesn't do that... Is there something that could be changed in the gui functions to allow that to work? I can see a few reasons that this would be needed. Who else would I be?
Holger Posted July 29, 2004 Posted July 29, 2004 Is this a problem when you only disable this label like this?: $title = "test" GuiCreate($title, 200, 100, 10, 10, 0x80000000) ;;; CREATE ALL CONTROLS BEFORE THE BACKGROUND $hello = GuiSetControl("button","Hello", 10, 10, 30, 20) $close = GuiSetControl("button","Close", 140, 60, 30, 20) $background = GuiSetControl("label","", 0, 0, 200, 100) GUISetControlEx(-1, 128);disable lable;-) GuiShow() WinSetOnTop($title, "", 1) ;;; SET CONTROL STATES TO SHOW... IN ORDER FOR THE WINDOW TO REPAINT (MAKE BUTTONS APPEAR ON TOP) GUISetControlEx($hello, 16);show GUISetControlEx($close, 16);show GUIWaitClose() Or do I have still an understanding problem? Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Valik Posted July 29, 2004 Posted July 29, 2004 CS is attempting to detect clicks inside the window by making a label the size of the window. Label's return from GuiMsg() when clicked. Disabling the label means it won't return a message, so the existence of the label becomes pointless.
Holger Posted July 29, 2004 Posted July 29, 2004 @Valik:ahhh, yeah...now I understand it. Hmmm...I think like you too, overlapping isn't very well. But I don't know if it is easy to change/code in the GUI-functions. It would be good for me to see what the real meaning/target should be. And what is with: $background = GuiSetControl("label","", 0, 0, 200, 100) GUISetControlNotify(-1,1) So with CyberSlug's code it should be no problem Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
redndahead Posted July 29, 2004 Author Posted July 29, 2004 Alright since I've been gone there has been a full conversation about it. =) Here is what I mean. I have a gui that is a pop up window. So no title bar at the top. I created my own title bar using a label then I wanted to place my own buttons at the top. I wanted spacing in between the buttons so I want the label color to show through. But if I do this I am completely unable to click on the buttons. Here is a screenshot of my window. What I ended up doing is putting the buttons right next to each other and have the label bump up against that.red
CyberSlug Posted July 29, 2004 Posted July 29, 2004 (edited) Avoid overlapping controls Here's one attempt that does use overlapping.... Why don't you just create another colored label where you want the gap between the buttons??? Global $GUI_SHOW = 16 Opt("WinTitleMatchMode", 4) Opt("GUINotifyMode", 1) $window = GuiCreate("MyGUI", 392,273,(@DesktopWidth-392)/2, (@DesktopHeight-273)/2 , 0x80000000) $button_1 = GUISetControl("button", "0", 300, 0, 30, 30) GUISetControlFont($button_1, 24, 400, "Webdings") $button_2 = GUISetControl("button", "x", 360, 0, 30, 30) GUISetControlFont($button_2, 24, 400, "Wingdings") $titlebar = GUISetControl("label", "Label 1", 0, 0, 400, 30) GUISetControlEx ($titlebar, 0, 0, "", 0x0, 0x00FF00) GuiShow() While 1 showButtonsOnTop();needed if window is every not activate and is reactivated sleep(100) $msg = GuiMsg(0) Select Case $msg = $button_1 WinSetState("handle=" & $window, "", @SW_MINIMIZE) Case $msg = $button_2 Exit EndSelect WEnd Exit Func showButtonsOnTop() GUISetControlEx($button_1, $GUI_SHOW) GUISetControlEx($button_2, $GUI_SHOW) EndFunc Note: The "webdings" font contains icons for the minimize,restore,maximize buttons found on the Windows 9x/2000 style titlebar. Edited July 29, 2004 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!
redndahead Posted July 29, 2004 Author Posted July 29, 2004 Quote Avoid overlapping controls smile.gif Here's one attempt that does use overlapping....Why don't you just create another colored label where you want the gap between the buttons???Well I could create another label but I just thought that the topmost control should be able to receive the action no matter what. Anywho, I'm getting it to work as is. Thanks for the clue on the font. Is this installed on all computers?red
Holger Posted August 1, 2004 Posted August 1, 2004 Cause I have to go to bed ( to much thinking today ) you could use: WS_CLIPSIBLINGS on the overlapping (label)-control like this: $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("test", 200, 100, 10, 10, 0x80000000) ;;; CREATE ALL CONTROLS BEFORE THE BACKGROUND $hello = GuiSetControl("button","Hello", 10, 10, 30, 20) $close = GuiSetControl("button","Close", 140, 60, 30, 20) $background = GuiSetControl("label","", 0, 0, 200, 100, $WS_CLIPSIBLINGS) GUISetControlNotify(-1,1) GuiShow() GUIWaitClose() Msgbox(0,"",GUIRead()) GUIDelete() Exit Hope that helps Good night... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Angel Posted November 5, 2004 Posted November 5, 2004 Holger, can you please explain to me what does this WS_CLIPSIBLINGS settings? I've had the same problem with an overlapping panel and button and I'd like to understand how to avoid this, a part than not overlapping them! :"> Angel Holger said: Cause I have to go to bed ( to much thinking today ) you could use:WS_CLIPSIBLINGS on the overlapping (label)-control like this:$WS_CLIPSIBLINGS = 0x04000000 GuiCreate("test", 200, 100, 10, 10, 0x80000000) ;;; CREATE ALL CONTROLS BEFORE THE BACKGROUND $hello = GuiSetControl("button","Hello", 10, 10, 30, 20) $close = GuiSetControl("button","Close", 140, 60, 30, 20) $background = GuiSetControl("label","", 0, 0, 200, 100, $WS_CLIPSIBLINGS) GUISetControlNotify(-1,1) GuiShow() GUIWaitClose() Msgbox(0,"",GUIRead()) GUIDelete() ExitHope that helps Good night... <{POST_SNAPBACK}>
Josbe Posted November 5, 2004 Posted November 5, 2004 MSDN Reference AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now