supadodger Posted March 27, 2009 Share Posted March 27, 2009 like make a simple gui with 1 label and 1 input box and then have it save an ini when the okay button is pressed?. then i can try to build from there? Link to comment Share on other sites More sharing options...
supadodger Posted March 27, 2009 Author Share Posted March 27, 2009 like make a simple gui with 1 label and 1 input box and then have it save an ini when the okay button is pressed?.then i can try to build from there?i know u can build the gui with koda.its the actually making it do something that confuses me. Link to comment Share on other sites More sharing options...
BrettF Posted March 27, 2009 Share Posted March 27, 2009 Well take a look in the helpfile. If you search, and try it really isn't that hard 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...
supadodger Posted March 27, 2009 Author Share Posted March 27, 2009 (edited) Well take a look in the helpfile. If you search, and try it really isn't that hard thanks for the simple example i asked for so i can try to learn instead of sending me to the help file which ive already read over and over and cant comprehend.i asked for a simple gui with 1 input box and 1 button and 1 label that when the button is hit updates an ini file.it might not be hard for someone thats actually been actively doing stuff with autoit but i havent and now i am trying to learn.im not asking for anything that should be hard for an expert.i need a gui with 25+ input boxes so its not like im gonna take this code and run either. Edited March 27, 2009 by supadodger Link to comment Share on other sites More sharing options...
BrettF Posted March 27, 2009 Share Posted March 27, 2009 (edited) Its time to do it step by step, since you can comprehend one of the best help files ever, like dude! It has examples already! Every single AutoIt function has one, and if it doesn't, you'd have to have no brain to know what to do with it. Netherless, here is the explanation, which I am very sure you could have worked out, if you actually tried.Please note, this information is charged at $US1,000,000/microsecond. Payment is required to be made into my newly created Swiss bank account.... So lets start with creating your GUI.I assume you are using the full version of SciTE, so why don't you open than, then go Tool -> KODA, which is what we will use to create the GUI.Now we will create the controls.Now we go tools -> Generating form options -> And check the check box that says "generate events for all controls".Now we close that dialogue, and go Tools -> Generate form code. If you wish to edit your GUI later, make sure you save it before you do this step. Click insert into SciTE.And now we have our GUI.Now we delete the crap we don't need from the message loop.This stuff:Case $Form1 Case $Form1 Case $Form1 Case $Form1Which leaves us with $GUI_EVENT_CLOSE, $input1 and $button1.Now if we wanted to show text of the input when we press the button, we can do something like so:Case $button1 MsgBox (0, "I'm a noob and I can't read the helpfile!", GUICtrlRead ($Input1))Fin.EDIT:Since you probably can't even do it with pictures, here's the final code:#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 447, 193, 125) $Input1 = GUICtrlCreateInput("Input1", 8, 8, 121, 21) $button1 = GUICtrlCreateButton ("Button Text", 8, 40, 100, 29) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Input1 Case $button1 MsgBox (0, "I'm a noob and I can't read the helpfile!", GUICtrlRead ($Input1)) EndSwitch WEnd Edited March 27, 2009 by BrettF 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...
supadodger Posted March 27, 2009 Author Share Posted March 27, 2009 Now we delete the crap we don't need from the message loop. This stuff: Case $Form1 Case $Form1 Case $Form1 Case $Form1 i wont need that later? that was a good explenation other than the hostility. thanks for helping though. each item on the gui has a Case under that case is what is performed if u click that item right? Link to comment Share on other sites More sharing options...
CodyBarrett Posted March 27, 2009 Share Posted March 27, 2009 OR!!! you can do what i and a few others like to do... write up the code manually THOUGH it is harder and usually you get somethings wrong (lots of guess and check) but its rewarding (ithink) writeing it up maually takes alittle more experience though... KODA will do your Fine untill then [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted March 27, 2009 Share Posted March 27, 2009 i wont need that later?that was a good explenation other than the hostility.thanks for helping though.each item on the gui has a Caseunder that case is what is performed if u click that item right?No you will not need it, that is what I said right? I'm not sure why KODA does it, just anything with like that is useless for general purposes... 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...
MrMitchell Posted March 27, 2009 Share Posted March 27, 2009 each item on the gui has a Caseunder that case is what is performed if u click that item right?@Supadodger: Have you already read this doc on GUI concepts? It's very helpful...http://www.autoitscript.com/autoit3/docs/guiref/GUIRef.htm Link to comment Share on other sites More sharing options...
youknowwho4eva Posted March 27, 2009 Share Posted March 27, 2009 Hmmm I went to the help file and copied the sample code for guictrlcreateinput I quoted out lines 12 and 13 I replaced line 23 (Which was exitloop) with the sample code for iniwrite I replaced the "this is a new value" with guictrlread($file) All from the help file 4 steps #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $file, $btn, $msg GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES $file = GUICtrlCreateInput("", 10, 5, 300, 20) ;~ GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;~ GUICtrlCreateInput("", 10, 35, 300, 20) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn IniWrite("C:\Temp\myfile.ini", "section2", "key", GUICtrlRead($file)) EndSelect WEnd MsgBox(4096, "drag drop file", GUICtrlRead($file)) EndFunc ;==>Example Giggity 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