MatheusGM Posted January 6, 2010 Share Posted January 6, 2010 I need some help with this script, cuz i'm trying to create a DVD Menu For my Programs, And Each Buttom(Category) Have a "GUI" For The kind of program, and when i create the first, The Buttons Don't Work ( I can't Click, but i can nav. by keyboard) and don't close :S Plz Help me! expandcollapse popup#Region ### Includes ### #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #NoTrayIcon #EndRegion ### Includes ### #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Programas V1 - BETA", 640, 464, 347, 207) GUISetIcon(@scriptdir & "\Ico\icon.ico") SoundPlay(@scriptdir & "\BGM\bgm1.mp3") $Fundo = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo.jpg", 0, 0, 641, 465, 0) $Button1 = GUICtrlCreateButton("Anti-Virus", 24, 320, 89, 33) $Button2 = GUICtrlCreateButton("Atualizações W.", 120, 320, 89, 33) $Button3 = GUICtrlCreateButton("Codecs", 216, 320, 89, 33) $Button4 = GUICtrlCreateButton("Compartilhadores", 24, 360, 89, 33) $Button5 = GUICtrlCreateButton("Editores de Img.", 120, 360, 89, 33) $Button6 = GUICtrlCreateButton("Ferramentas p/ S;", 216, 360, 89, 33) $Button7 = GUICtrlCreateButton("Gerenciadores D.", 344, 320, 89, 33) $Button8 = GUICtrlCreateButton("Gravação", 440, 320, 89, 33) $Button9 = GUICtrlCreateButton("Media Players", 536, 320, 89, 33) $Button10 = GUICtrlCreateButton("Mensageiros", 344, 360, 89, 33) $Button11 = GUICtrlCreateButton("Navegadores", 440, 360, 89, 33) $Button12 = GUICtrlCreateButton("Programação", 536, 360, 89, 33) $Button13 = GUICtrlCreateButton("Utilitários", 280, 400, 89, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Select Case $msg = $Button1 ;~ Run("Explorer.exe " & @ScriptDir & "\Anti-Virus\") ;~ Run(@ScriptDir & "\Anti-Virus\Avira Personal Free\Avira Anti Virus Personal Setup.exe") #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form_gui1 = GUICreate("Programas V1 (BETA) - Anti-Virus", 400, 281, 192, 124) GUISetIcon(@scriptdir & "\Ico\icon.ico") $Fundo_gui1 = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo1.jpg", -16, -8, 417, 289) $Avira = GUICtrlCreateButton("Avira", 152, 200, 89, 33) $Exit1 = GUICtrlCreateButton("Sair", 176, 248, 33, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $Gmsg = GUIGetMsg() Select Case $Gmsg = $Avira Run(@scriptdir & "\Anti-Virus\Avira Personal Free\Avira Anti Virus Personal Setup.exe") Case $Gmsg = $Exit1 WinClose("Programas V1 (BETA) - Anti-Virus") EndSelect WEnd GUIDelete() Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 6, 2010 Moderators Share Posted January 6, 2010 MatheusGM,I have lost count of the number of times this has been asked - does no-one ever read the Help file? From the Help file for GUICtrlCreatePic:"If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control ...: GuiCtrlSetState(-1,$GUI_DISABLE)"So disable all of your $Fundo picture controls and you should find your buttons working again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MatheusGM Posted January 7, 2010 Author Share Posted January 7, 2010 I'll try that, i read but i didn't know that the picture is "buggin'" my buttons, and another "bug" is when I press on "Sair" Button It Close the GUI of Anti-Virus, and the Master GUI, Bugs The Buttons :S Link to comment Share on other sites More sharing options...
MatheusGM Posted January 7, 2010 Author Share Posted January 7, 2010 Where Should I put the GuiCtrlSetState(-1,$GUI_DISABLE)? when a put after the "GUISetState(@SW_SHOW)" My Last Button Don't Work :S Modify my script and post here, i didn't understand :S Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2010 Moderators Share Posted January 7, 2010 MatheusGM, Modify my script and post here, i didn't understand :S Whatever happened to "Please" or "Por favor"? You need to disable the picture control immediately after creating it - just as the Help file says. That is why you can use the "-1", it is shorthand for "the last control created". So you need to put the "disable" lines here: $Form1 = GUICreate("Programas V1 - BETA", 640, 464, 347, 207) GUISetIcon(@scriptdir & "\Ico\icon.ico") SoundPlay(@scriptdir & "\BGM\bgm1.mp3") $Fundo = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo.jpg", 0, 0, 641, 465, 0) GuiCtrlSetState(-1,$GUI_DISABLE) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Button1 = GUICtrlCreateButton("Anti-Virus", 24, 320, 89, 33) $Form_gui1 = GUICreate("Programas V1 (BETA) - Anti-Virus", 400, 281, 192, 124) GUISetIcon(@scriptdir & "\Ico\icon.ico") $Fundo_gui1 = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo1.jpg", -16, -8, 417, 289) GuiCtrlSetState(-1,$GUI_DISABLE) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Avira = GUICtrlCreateButton("Avira", 152, 200, 89, 33) That should sort the problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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