gpence Posted July 12, 2005 Share Posted July 12, 2005 OK, I've decided to add a GUI to this project and the first thing I do is add a picture and a CLOSE button. It runs fine, except the CLOSE button won't... I thought the process was to create a button and assign the handle to a variable, then use the Select Case statement inside a While loop to check for $msg = $Btn_Close, but it doesn't work... what am I missing?? Thanks, gpence #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.5 Prototype GuiCreate("Project Name", 600, 300,(@DesktopWidth-600)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Pic_1 = GuiCtrlCreatePic("proj_logo.gif", 0, 0, 600, 300) $Btn_Close = GUICtrlCreateButton ("Close", 500, 240, 90, 35, $BS_CENTER + $BS_DEFPUSHBUTTON + $BS_VCENTER) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop Case $msg = $Btn_Close MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- Link to comment Share on other sites More sharing options...
GaryFrost Posted July 12, 2005 Share Posted July 12, 2005 #include <GuiConstants.au3> #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.5 Prototype GuiCreate("Project Name", 600, 300,(@DesktopWidth-600)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Pic_1 = GuiCtrlCreatePic("proj_logo.gif", 0, 0, 600, 300) $Btn_Close = GUICtrlCreateButton ("Close", 500, 240, 90, 35, $BS_CENTER + $BS_DEFPUSHBUTTON + $BS_VCENTER) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop Case $msg = $Btn_Close MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2005 Developers Share Posted July 12, 2005 (edited) Doesn't the picture overlap the button ? Edited July 12, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GaryFrost Posted July 12, 2005 Share Posted July 12, 2005 (edited) jdeb is correct i believe, I didn't have a picture to test with. if you want the picture to cover the gui. add your other controls 1st then add picture and disable picture. Edited July 12, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
gpence Posted July 12, 2005 Author Share Posted July 12, 2005 (edited) jdeb is correct i believe, I didn't have a picture to test with.if you want the picture to cover the gui.add your other controls 1st then add picture and disable picture.<{POST_SNAPBACK}>You're both correct. I used a 600x300 image with a white background and a small logo in the upper left corner. Now I understand I've put a control on top of my button so the click never reaches the button, correct?OK, I see 2 possible courses of action: a) gafrost's suggestion of disabling the picture -- and a cursory look at help isn't giving me a good example of how to do that, or use the small logo and set the background to white (which again, I need a suggestion on how to do that... sorry)OK -- I got the GUICtrlSetState to work!! But for future reference, can you tell me how to set the background white (option ?Hmm, it worked -- sort of... when the GUI comes up, the button is hidden by the pic until I mouseover it, then it becomes static in the proper place... why?Thanks,gpence Edited July 12, 2005 by gpence Link to comment Share on other sites More sharing options...
GaryFrost Posted July 12, 2005 Share Posted July 12, 2005 sorry try it this way, create your controls and then disable the pic #include <GuiConstants.au3> #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.5 Prototype GuiCreate("Project Name", 600, 300,(@DesktopWidth-600)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Pic_1 = GuiCtrlCreatePic("proj_logo.gif", 0, 0, 600, 300) $Btn_Close = GUICtrlCreateButton ("Close", 500, 240, 90, 35, $BS_CENTER + $BS_DEFPUSHBUTTON + $BS_VCENTER) GUICtrlSetState($Pic_1,$GUI_DISABLE) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop Case $msg = $Btn_Close MsgBox(0, " Closing ", " Exiting the Vault II Transfer Auditor... ", 2) ExitLoop EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
gpence Posted July 13, 2005 Author Share Posted July 13, 2005 sorry try it this way, create your controls and then disable the picExcellent! Thank you very much GAFROST (and JdeB)!!! Link to comment Share on other sites More sharing options...
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