DarkwarlorD Posted September 2, 2008 Share Posted September 2, 2008 I researched the forum, could solve some problems, but one still exists:when I click on the third button, it works, but only once. Who knows what's wrong?CODE#Region ;**** Directives created by AutoIt3Wrapper_GUI ****#AutoIt3Wrapper_icon=I:\AutoIt 3.2\Icons\iconspack\tux.ico#AutoIt3Wrapper_outfile=Down_Loader.exe#AutoIt3Wrapper_Compression=4#AutoIt3Wrapper_Res_Comment=Gerenciador de Gerenciadores de Download#AutoIt3Wrapper_Res_Description=Down_Loader 1.0#AutoIt3Wrapper_Res_Fileversion=1.0.0.0#AutoIt3Wrapper_Res_LegalCopyright=© 2008 | -=|DarklorD|=-#AutoIt3Wrapper_Res_Language=1033#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****#include <GUIConstants.au3>#include <Misc.au3>#NoTrayIcon_Singleton("Down_Loader")Global $folder = @ScriptDir & "\Gerenciador"Global $Open_Form = FalseOpt("GUIOnEventMode", 1)#Region ### START Koda GUI section ###Global $Main = GUICreate("Gerenciadores de Download", 383, 288, 285, 147)GUISetIcon($folder&"\unlock.ico")Global $Rapid = GUICtrlCreateButton("", 87, 56, 36, 36, 0)GUICtrlSetOnEvent($Rapid, "RG")Global $RH = GUICtrlCreateButton("", 87, 104, 36, 36, 0)GUICtrlSetOnEvent($RH, "RH")Global $TXT = GUICtrlCreateButton("", 87, 151, 36, 36, 0)GUICtrlSetOnEvent($TXT, "Editar")Global $Sair = GUICtrlCreateButton("Sair", 288, 248, 75, 25, 0)GUICtrlSetOnEvent($Sair, "Sair")Global $Autor = GUICtrlCreateLabel("Desenvolvido por -=|DarklorD|=-", 8, 264, 154, 17)Global $Label1 = GUICtrlCreateLabel("Selecione o Gerenciador:", 71, 16, 222, 22)GUICtrlSetFont(-1, 12, 800, 0, "Verdana")Global $Label2 = GUICtrlCreateLabel("RapidGet", 159, 63, 73, 24)GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")Global $Label4 = GUICtrlCreateLabel("Rapid Hacker 3.7", 159, 112, 112, 24)GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")Global $Label5 = GUICtrlCreateLabel("Abrir Lista.txt", 159, 159, 127, 24)GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")GUISetOnEvent($GUI_EVENT_CLOSE, "Sair")GUISetState(@SW_SHOW, $Main)#EndRegion ### END Koda GUI section ###While 1 Sleep(20) If $Open_Form = True Then Open_Form() EndIfWEndFunc Editar() $Open_Form = TrueEndFuncFunc Open_Form() Global $Form = GUICreate("Editar Lista.txt", 378, 215, 193, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "Fechar") Global $Edit = GUICtrlCreateEdit("", 8, 8, 361, 169) GUICtrlSetData(-1, "Edit") Global $Salvar = GUICtrlCreateButton("Salvar Lista",104, 184, 161, 25, 0) GUICtrlSetOnEvent($Salvar, "Salvar") GUISwitch($Form) GUISetState(@SW_SHOW) Global $file = FileOpenDialog("Selecione a Lista.txt", @ScriptDir , "Lista (Lista.txt)", 1, 'Lista.txt' ) If @error Then MsgBox(0, "Erro", "FileOpenDialog error") Exit EndIf Global $FileData = FileRead( $file ) GUICtrlSetData( $Edit, $FileData ) While 1 Sleep(100) WEndEndFuncFunc RG() Run($folder&"\RG.exe")EndFuncFunc RH() Run($folder&"\RH.exe")EndFuncFunc USD() Run($folder&"\USD.exe")EndFuncFunc Sair() MsgBox(0, "Sair", "Você solicitou o fechamento da Janela Principal! Saindo...") ExitEndFuncFunc Fechar() MsgBox(0, "Sair", "Você solicitou o fechamento da Janela Editar Lista.txt! Saindo...") GUIDelete() $Open_Form = False GUISwitch($Main)EndFuncFunc Salvar() FileDelete( $file ) FileWrite( $file, GUICtrlRead( $Edit )) MsgBox(0, "Lista.txt", "Alterações Salvas." & @CRLF & "Click em OK para Continuar.") $FileData = FileRead( $file ) GUICtrlSetData( $Edit, $FileData )EndFuncThank you for your attention and I apologize for the error, I am not fluent in English. Link to comment Share on other sites More sharing options...
DjDeep00 Posted September 2, 2008 Share Posted September 2, 2008 @DarkwarlorD...The reason why nothing happens when u click the button the second time is because you did not exit the second while loop in Open_Form(). While 1 Sleep(100) WEnd Link to comment Share on other sites More sharing options...
DarkwarlorD Posted September 2, 2008 Author Share Posted September 2, 2008 Thanks for tip, but have some idea of how I fix it ... I am a newbie.I know that I'll have to see if the Close button was clicked and then break the looping, but I do not know implement.Could you help me, please? Link to comment Share on other sites More sharing options...
DjDeep00 Posted September 2, 2008 Share Posted September 2, 2008 While 1 Sleep(100) If @GUI_CtrlId = $GUI_EVENT_CLOSE then ExitLoop WEnd Link to comment Share on other sites More sharing options...
DarkwarlorD Posted September 3, 2008 Author Share Posted September 3, 2008 That's great... it works very fine!!!Thank you for help me. 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