BrettF Posted June 27, 2009 Share Posted June 27, 2009 I can keep up very well. Many others of the guys that will help you will have less of an idea. Keep that in mind. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Skruge Posted June 27, 2009 Share Posted June 27, 2009 ok, what i need to know is, to get my buttons to do the actions I want from it, eg Save, Clear, Load, Open and Close, can anyone maybe help me, somewhere my GUI's is not right...^^ This is much more helpful.First you need to add conditions for each button. You already have cases for $Button3 and $Button8 but the statements are empty.Next, you have to define what these actions do.Use GUICtrlRead/GUICtrlSetData to read/update the controls.Where do you plan to save to/load from? Look at FileRead/FileWrite, RegRead/RegWrite, and/or the INIRead functions. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
wizard Posted June 29, 2009 Author Share Posted June 29, 2009 ^^ This is much more helpful.First you need to add conditions for each button. You already have cases for $Button3 and $Button8 but the statements are empty.Next, you have to define what these actions do.Use GUICtrlRead/GUICtrlSetData to read/update the controls.Where do you plan to save to/load from? Look at FileRead/FileWrite, RegRead/RegWrite, and/or the INIRead functions.THANKS 4 HELP I WILL TRY IT Link to comment Share on other sites More sharing options...
wizard Posted June 30, 2009 Author Share Posted June 30, 2009 hi all..i I have a GUI with multiple inputs,once I have filled them in I press a button which saves the GUICtrlRead results of all inputs in one file. Next time I start the program I want to be able to load all this data from 1 file back in the appropriate inputs (by clicking a button for example).i try but i get erorr her is what i have dan now... #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\admin\my documents\max99-5.kxf $Form1_1 = GUICreate("max99_2_the_max_v1.0.0", 575, 533, 192, 124) GUISetBkColor(0xFF00FF) $Group1 = GUICtrlCreateGroup("multy", 8, 8, 193, 345) $id1 = GUICtrlCreateInput("id1", 16, 24, 121, 21) $id2 = GUICtrlCreateInput("id2", 16, 48, 121, 21) $id3 = GUICtrlCreateInput("id3", 16, 72, 121, 21) $id4 = GUICtrlCreateInput("id4", 16, 96, 121, 21) $id5 = GUICtrlCreateInput("id5", 16, 120, 121, 21) $id6 = GUICtrlCreateInput("id6", 16, 144, 121, 21) $id7 = GUICtrlCreateInput("id7", 16, 168, 121, 21) $id8 = GUICtrlCreateInput("id8", 16, 192, 121, 21) $id9 = GUICtrlCreateInput("id9", 16, 216, 121, 21) $id10 = GUICtrlCreateInput("id10", 16, 240, 121, 21) $id11 = GUICtrlCreateInput("id11", 16, 264, 121, 21) $id12 = GUICtrlCreateInput("id12", 16, 288, 121, 21) $password = GUICtrlCreateInput("password", 16, 320, 121, 21) GUICtrlCreateRadio("50 mp", 144, 32, 49, 17) $Button1 = GUICtrlCreateButton("load", 144, 56, 51, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("save", 144, 120, 51, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("clear", 144, 320, 51, 25, $WS_GROUP) $Button13 = GUICtrlCreateButton("open", 144, 192, 51, 25, $WS_GROUP) $Button14 = GUICtrlCreateButton("close", 144, 232, 51, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("roomlist", 208, 8, 361, 505) $ListView1 = GUICtrlCreateListView("", 216, 24, 170, 262, BitOR($LVS_LIST,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS)) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSetState(-1, $GUI_DISABLE) $Button8 = GUICtrlCreateButton("getlist", 216, 296, 171, 25, $WS_GROUP) $Button9 = GUICtrlCreateButton("enter all", 400, 392, 155, 33, $WS_GROUP) $Button10 = GUICtrlCreateButton("kick all", 400, 432, 155, 33, $WS_GROUP) $Button11 = GUICtrlCreateButton("leave all", 400, 472, 155, 33, $WS_GROUP) $Group4 = GUICtrlCreateGroup("room kick", 392, 16, 169, 369) $Edit1 = GUICtrlCreateEdit("", 400, 32, 153, 345, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_GROUP,$WS_VSCROLL)) GUICtrlSetData(-1, "kicklist") GUICtrlCreateGroup("", -99, -99, 1, 1) $Button12 = GUICtrlCreateButton("sent", 216, 360, 171, 25, BitOR($BS_MULTILINE,$WS_GROUP)) $Combo2 = GUICtrlCreateCombo("flood", 216, 328, 169, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetData(-1, " | | :P| :P:P:P| :P:P:P:P| :P:P:P:P:P| :P:P:P:P| :P:P:P| :P:P| :P| | | :x| :XX:x| :x:X:X| :x:X| :x| | :x:X:X:X:X:X:X:X:X:X| :o:O:O:O:O:O:O:O:O| :DD:D:D:D:D:D:D:D|:S:S:S:S:S:S:S:S:S:S:S|max99 rulls:P:P:P:P|max99_2_the_max:P:P:P|/roll|/8ball") $Edit2 = GUICtrlCreateEdit("", 216, 392, 169, 113) GUICtrlSetData(-1, "Edit2") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("spy", 8, 360, 193, 113) $spy = GUICtrlCreateInput("spy", 16, 376, 121, 21) $p = GUICtrlCreateInput("password-2", 16, 408, 121, 21) $Combo1 = GUICtrlCreateCombo("room", 16, 440, 121, 25) GUICtrlSetData(-1, "giyani|USA girl|usa|usa...|mxit|mxit v5|afrikaans1|afrikaans 2|afrikaans3|afr|doom") $Button4 = GUICtrlCreateButton("save spy", 144, 376, 51, 17, $WS_GROUP) $Button5 = GUICtrlCreateButton("load spy", 144, 400, 51, 17, $WS_GROUP) $Button6 = GUICtrlCreateButton("conec", 144, 424, 51, 17, $WS_GROUP) $Button7 = GUICtrlCreateButton("logout", 144, 448, 51, 17, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label1 = GUICtrlCreateLabel("max99 rullles ", 24, 480, 151, 33) GUICtrlSetFont(-1, 18, 400, 2, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Form1_1 Case $id2 Case $id5 Case $Button3 Case $Button8 Case $Edit1 EndSwitch WEnd $Form1_1 = GUICreate("max99_2_the_max_v1.0.0", 575, 533, 192, 124) $id1 = GUICtrlCreateInput("id1", 16, 24, 121, 21) $id2 = GUICtrlCreateInput("id2", 16, 48, 121, 21) $id3 = GUICtrlCreateInput("id3", 16, 72, 121, 21) $id4 = GUICtrlCreateInput("id4", 16, 96, 121, 21) $id5 = GUICtrlCreateInput("id5", 16, 120, 121, 21) $id6 = GUICtrlCreateInput("id6", 16, 144, 121, 21) $id7 = GUICtrlCreateInput("id7", 16, 168, 121, 21) $id8 = GUICtrlCreateInput("id8", 16, 192, 121, 21) $id9 = GUICtrlCreateInput("id9", 16, 216, 121, 21) $id10 = GUICtrlCreateInput("id10", 16, 240, 121, 21) $id11 = GUICtrlCreateInput("id11", 16, 264, 121, 21) $id12 = GUICtrlCreateInput("id12", 16, 288, 121, 21) $password = GUICtrlCreateInput("password", 16, 320, 121, 21) $Edit = GUICtrlCreateEdit("Edit", 0, 56, 250, 73) $SaveButton = GUICtrlCreateButton("save", 144, 120, 51, 25, $WS_GROUP) $LoadButton = GUICtrlCreateButton("load", 144, 56, 51, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SaveButton SaveData() Case $LoadButton LoadData() EndSwitch WEnd Func SaveData() $Data1=GUICtrlRead($Input1) $Data1=GUICtrlRead($Input2) $Data1=GUICtrlRead($Input3) $Data1=GUICtrlRead($Input4) $Data1=GUICtrlRead($Input5) $Data1=GUICtrlRead($Input6) $Data1=GUICtrlRead($Input7) $Data1=GUICtrlRead($Input8) $Data1=GUICtrlRead($Input9) $Data1=GUICtrlRead($Input10) $Data1=GUICtrlRead($Input11) $Data1=GUICtrlRead($Input12) $password = GUICtrlCreateInput("password", 16, 320, 121, 21) $Data3=GUICtrlRead($Edit) If FileExists(@ScriptDir & "\Save.txt") then FileDelete(@ScriptDir & "\Save.txt") FileWrite(@ScriptDir & "\Save.txt", $Data1 & @TAB & $Data2 & @TAB & $Data3) If FileExists(@ScriptDir & "\Save.txt") then MsgBox(0, "MSG", "Your data has been saved.") EndFunc Func LoadData() If FileExists(@ScriptDir & "\Save.txt") then $LoadData=FileRead(@ScriptDir & "\Save.txt") $LoadData=StringSplit($LoadData, @TAB) GUICtrlSetData($Input1, $LoadData[1]) GUICtrlSetData($Input2, $LoadData[2]) GUICtrlSetData($Input3, $LoadData[3]) GUICtrlSetData($Input4, $LoadData[4]) GUICtrlSetData($Input5, $LoadData[5]) GUICtrlSetData($Input6, $LoadData[6]) GUICtrlSetData($Input7, $LoadData[7]) GUICtrlSetData($Input8, $LoadData[8]) GUICtrlSetData($Input9, $LoadData[9]) GUICtrlSetData($Input10, $LoadData[10]) GUICtrlSetData($Input11, $LoadData[11]) GUICtrlSetData($Input12, $LoadData[12]) $password = GUICtrlCreateInput("password", 16, 320, 121, 21) GUICtrlSetData($Edit, $LoadData[3]) Else MsgBox(0, "MSG", "Saved data could not be found.") EndIf EndFunc Link to comment Share on other sites More sharing options...
Skruge Posted June 30, 2009 Share Posted June 30, 2009 i try but i get erorrWhat is the error message? While 1$nMsg = GUIGetMsg()Switch $nMsgCase $GUI_EVENT_CLOSEExitCase $Form1_1Case $id2Case $id5Case $Button3Case $Button8Case $Edit1EndSwitchWEnd$Form1_1 = GUICreate("max99_2_the_max_v1.0.0", 575, 533, 192, 124)The way you've written this while loop, the only way to end the loop is by exiting the script. Therefore your second GUI will never be created. Func SaveData() $Data1=GUICtrlRead($Input1) $Data1=GUICtrlRead($Input2) $Data1=GUICtrlRead($Input3) $Data1=GUICtrlRead($Input4) $Data1=GUICtrlRead($Input5) $Data1=GUICtrlRead($Input6) $Data1=GUICtrlRead($Input7) $Data1=GUICtrlRead($Input8) $Data1=GUICtrlRead($Input9) $Data1=GUICtrlRead($Input10) $Data1=GUICtrlRead($Input11) $Data1=GUICtrlRead($Input12) $password = GUICtrlCreateInput("password", 16, 320, 121, 21) $Data3=GUICtrlRead($Edit) If FileExists(@ScriptDir & "\Save.txt") then FileDelete(@ScriptDir & "\Save.txt") FileWrite(@ScriptDir & "\Save.txt", $Data1 & @TAB & $Data2 & @TAB & $Data3) If FileExists(@ScriptDir & "\Save.txt") then MsgBox(0, "MSG", "Your data has been saved.")EndFuncSince you're reusing the same variable, $Data1 will be set to the contents of $Input12 and all of the prior reads are wasted.Also, why are you creating a password input in this function? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
wizard Posted July 1, 2009 Author Share Posted July 1, 2009 What is the error message? The way you've written this while loop, the only way to end the loop is by exiting the script. Therefore your second GUI will never be created. Since you're reusing the same variable, $Data1 will be set to the contents of $Input12 and all of the prior reads are wasted.Also, why are you creating a password input in this function?ok u neet the pasword input for all the ids so dat u can save the ids...dis ids is register ids with pasword...and den after u save the ids and pasword neet two us the login buton den i can run all dis ids..im not a programmer but i try.. 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