Advert
bvr
Active Members-
Posts
88 -
Joined
-
Last visited
About bvr
- Birthday 09/08/1985
Profile Information
-
Location
Pennsylvania
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
bvr's Achievements
Wayfarer (2/7)
0
Reputation
-
So that will be able to pick the names and stuff from the numbers 1,2,3...ect? Like a unique identifier to separate from double entrees and repeat customers.
-
I want it to show up in my listview and read from my .ini file where everything is stored.
-
On my lawncare manager I want my jobs that I add to the listview so I can select them and edit them. I want it to display in the listview the Date, Name, and Address. Here is my code so far. ;Author: Brandon Royer ;Program Name: Lawn Care Manager ; Date: 2013-2014 ; Version: 1.0 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> #include <GUIListBox.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <Array.au3> $Form1 = GUICreate("Lawn Business Manager v1.0", 615, 410, 192, 124) $Main_List1 = GUICtrlCreateListView("Date | Name | Address | Money", 24, 64, 537, 253) $sIniFile = @ScriptDir & "\Storage.ini" $MenuItem_File = GUICtrlCreateMenu("&File") $MenuItem_Edit = GUICtrlCreateMenu("&Edit") $MenuItem_Help = GUICtrlCreateMenu("&Help") $Main_Tab1 = GUICtrlCreateTab(8, 8, 601, 377) $Main_TabSheet1 = GUICtrlCreateTabItem("Job Manager") $Main_Group1 = GUICtrlCreateGroup("Jobs", 16, 40, 585, 329) $Main_Button1 = GUICtrlCreateButton("Add", 24, 336, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Main_Button2 = GUICtrlCreateButton("Edit", 112, 336, 75, 25) $Main_Button3 = GUICtrlCreateButton("Remove", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet2 = GUICtrlCreateTabItem("Equipment Manager") $Main_Group2 = GUICtrlCreateGroup("Equipment", 16, 40, 585, 329) $Main_List2 = GUICtrlCreateList("", 24, 64, 537, 253) $Main_Button4 = GUICtrlCreateButton("Add Unit", 24, 336, 75, 25) $Main_Button5 = GUICtrlCreateButton("Edit Unit", 112, 336, 75, 25) $Main_Button6 = GUICtrlCreateButton("Remove Unit", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet3 = GUICtrlCreateTabItem("Stastistics/Money") $Main_Group3 = GUICtrlCreateGroup("Stastistics", 16, 48, 569, 329) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_Button7 = GUICtrlCreateButton("Add Expense", 24, 344, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Main_Button1 Add_Job() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Add_Job() $Form2 = GUICreate("Add Job", 615, 578, 232, 131) $sIniFile = @ScriptDir & "\Storage.ini" Local $aSections = IniReadSectionNames($sIniFile) Global $iCurrent_Max_Section = _ArrayMax($aSections) If @error Then $iCurrent_Max_Section = 0 ; This sets the value to 0 if there are no existing sections EndIf $Group1 = GUICtrlCreateGroup("Job Information", 8, 8, 601, 561) $Label1 = GUICtrlCreateLabel("Date:", 32, 40, 30, 17) $Date = GUICtrlCreateDate("2013/08/25 01:14:40", 64, 40, 186, 21) $Label2 = GUICtrlCreateLabel("Time Started:", 32, 72, 67, 17) $TimeStarted = GUICtrlCreateInput("00:00", 112, 72, 49, 21) $TimeStart_amPM = GUICtrlCreateCombo("pm", 168, 72, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($TimeStart_amPM, "am") $Label3 = GUICtrlCreateLabel("Time Finished:", 32, 104, 72, 17) $TimeFinished = GUICtrlCreateInput("00:00", 112, 104, 49, 21) $TimeFinish_amPM = GUICtrlCreateCombo("pm", 168, 104, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($TimeFinish_amPM, "am") $Label4 = GUICtrlCreateLabel("First Name:", 40, 136, 57, 17) $FirstName = GUICtrlCreateInput("", 112, 136, 121, 21) $Label5 = GUICtrlCreateLabel("Last Name:", 40, 168, 58, 17) $LastName = GUICtrlCreateInput("", 112, 168, 121, 21) $Label6 = GUICtrlCreateLabel("Address:", 40, 200, 45, 17) $Address = GUICtrlCreateInput("", 96, 200, 129, 21) $Label7 = GUICtrlCreateLabel("City:", 240, 200, 24, 17) $City = GUICtrlCreateInput("", 280, 200, 153, 21) $Label8 = GUICtrlCreateLabel("State:", 40, 232, 32, 17) $State = GUICtrlCreateInput("", 72, 232, 121, 21) $Label9 = GUICtrlCreateLabel("Phone Number:", 40, 264, 78, 17) $Zip = GUICtrlCreateInput("", 280, 232, 105, 21) $Label10 = GUICtrlCreateLabel("-", 176, 264, 7, 17) $PhoneDigit_One = GUICtrlCreateInput("", 120, 264, 41, 21) $Label11 = GUICtrlCreateLabel("-", 248, 264, 7, 17) $PhoneDigit_Two = GUICtrlCreateInput("", 192, 264, 41, 21) $Label12 = GUICtrlCreateLabel("Email:", 40, 296, 32, 17) $PhoneDigit_Three = GUICtrlCreateInput("", 264, 264, 41, 21) $Label13 = GUICtrlCreateLabel("Money Made:", 40, 328, 69, 17) $Lable14 = GUICtrlCreateLabel("Notes:", 40, 360, 35, 17) $Label14 = GUICtrlCreateLabel("Zip:", 240, 232, 22, 17) $Email = GUICtrlCreateInput("", 80, 296, 153, 21) $MoneyMade = GUICtrlCreateCombo("$5", 120, 328, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($MoneyMade,"$10 | $15 | $20 | $25 | $30 | $35 | $40 | $45 | $50 | $60 | $65 | $70 | $75 | $80 | $85 | $90 | $95 | $100") $Notes = GUICtrlCreateEdit("", 24, 384, 577, 137) GUICtrlSetData(-1, "") $Secondary_SaveButton = GUICtrlCreateButton("Save", 24, 536, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Secondary_CancelButton = GUICtrlCreateButton("Cancel", 112, 536, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Secondary_CancelButton GUIDelete($Form2) Return Case $Secondary_SaveButton $iCurrent_Max_Section += 1 ; Increase the value for teh next section IniWrite($sIniFile, $iCurrent_Max_Section, "Date", GUICtrlRead($Date)) ; And use it to write the new section IniWrite($sIniFile, $iCurrent_Max_Section, "Time Started", GUICtrlRead($TimeStarted) & GUICtrlRead($TimeStart_amPM)) IniWrite($sIniFile, $iCurrent_Max_Section, "Time Finished", GUICtrlRead($TimeFinished) & GUICtrlRead($TimeFinish_amPM)) IniWrite($sIniFile, $iCurrent_Max_Section, "First Name", GUICtrlRead($FirstName)) IniWrite($sIniFile, $iCurrent_Max_Section, "Last Name", GUICtrlRead($LastName)) IniWrite($sIniFile, $iCurrent_Max_Section, "Address", GUICtrlRead($Address)) IniWrite($sIniFile, $iCurrent_Max_Section, "City", GUICtrlRead($City)) IniWrite($sIniFile, $iCurrent_Max_Section, "State", GUICtrlRead($State)) IniWrite($sIniFile, $iCurrent_Max_Section, "Zip", GUICtrlRead($Zip)) IniWrite($sIniFile, $iCurrent_Max_Section, "Phone Number", GUICtrlRead($PhoneDigit_One) & GUICtrlRead($PhoneDigit_Two) & GUICtrlRead($PhoneDigit_Three)) IniWrite($sIniFile, $iCurrent_Max_Section, "Email", GUICtrlRead($Email)) IniWrite($sIniFile, $iCurrent_Max_Section, "Money Made", GUICtrlRead($MoneyMade)) IniWrite($sIniFile, $iCurrent_Max_Section, "Notes", GUICtrlRead($Notes)) GUIDelete($Form2) Return EndSwitch WEnd EndFunc ;==>Add_Job
-
No problem! I try to learn as much as I can, and have always wanted to build programs with Autoit. I understand the basics, but when you get into arrays and other sorts of stuff it becomes confusing.
-
Works perfectly . Thanks for the help. Now later this week I shall learn to read from the ini file and show up in the list window.
-
Says Unknown Function name _ArrayMax($aSections)
-
Ok I got that working. Now to add multiple entries I would have to use an array? This is what I found in the help file but can't see how it can be added to my script ; Demonstrate creating a new section using an array as input. Local $aData1 = IniReadSection($sIni, "Section1") ; Read in what we just wrote above. For $i = 1 To UBound($aData1) - 1 $aData1[$i][1] &= "-" & $i ; Change the data some Next IniWriteSection($sIni, "Section2", $aData1) ; Write to a new section.
-
Everything works except for the "am/pm." It shows "0" when it writes to the ini file. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> #include <GUIListBox.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> $Form1 = GUICreate("Yesterday's Lawn Care", 615, 410, 192, 124) $sIniFile = @ScriptDir & "\Storage.ini" $MenuItem_File = GUICtrlCreateMenu("&File") $MenuItem_Edit = GUICtrlCreateMenu("&Edit") $MenuItem_Help = GUICtrlCreateMenu("&Help") $Main_Tab1 = GUICtrlCreateTab(8, 8, 601, 377) $Main_TabSheet1 = GUICtrlCreateTabItem("Job Manager") $Main_Group1 = GUICtrlCreateGroup("Jobs", 16, 40, 585, 329) $Main_List1 = GUICtrlCreateList("", 24, 64, 537, 253) $Main_Button1 = GUICtrlCreateButton("Add", 24, 336, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Main_Button2 = GUICtrlCreateButton("Edit", 112, 336, 75, 25) $Main_Button3 = GUICtrlCreateButton("Remove", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet2 = GUICtrlCreateTabItem("Equipment Manager") $Main_Group2 = GUICtrlCreateGroup("Equipment", 16, 40, 585, 329) $Main_List2 = GUICtrlCreateList("", 24, 64, 537, 253) $Main_Button4 = GUICtrlCreateButton("Add Unit", 24, 336, 75, 25) $Main_Button5 = GUICtrlCreateButton("Edit Unit", 112, 336, 75, 25) $Main_Button6 = GUICtrlCreateButton("Remove Unit", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet3 = GUICtrlCreateTabItem("Stastistics/Money") $Main_Group3 = GUICtrlCreateGroup("Stastistics", 16, 48, 569, 329) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_Button7 = GUICtrlCreateButton("Add Expense", 24, 344, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Main_Button1 Add_Job() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Add_Job() $Form2 = GUICreate("Add Job", 615, 578, 232, 131) $sIniFile = @ScriptDir & "\Storage.ini" $Group1 = GUICtrlCreateGroup("Job Information", 8, 8, 601, 561) $Label1 = GUICtrlCreateLabel("Date:", 32, 40, 30, 17) $Date = GUICtrlCreateDate("2013/08/25 01:14:40", 64, 40, 186, 21) $Label2 = GUICtrlCreateLabel("Time Started:", 32, 72, 67, 17) $TimeStarted = GUICtrlCreateInput("00:00", 112, 72, 49, 21) $TimeStart_amPM = GUICtrlCreateCombo("pm", 168, 72, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $TimeStart_amPM = GUICtrlSetData(-1, "am") $Label3 = GUICtrlCreateLabel("Time Finished:", 32, 104, 72, 17) $TimeFinished = GUICtrlCreateInput("00:00", 112, 104, 49, 21) $TimeFinish_amPM = GUICtrlCreateCombo("pm", 168, 104, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $TimeFinish_amPM = GUICtrlSetData(-1, "am") $Label4 = GUICtrlCreateLabel("First Name:", 40, 136, 57, 17) $FirstName = GUICtrlCreateInput("", 112, 136, 121, 21) $Label5 = GUICtrlCreateLabel("Last Name:", 40, 168, 58, 17) $LastName = GUICtrlCreateInput("", 112, 168, 121, 21) $Label6 = GUICtrlCreateLabel("Address:", 40, 200, 45, 17) $Address = GUICtrlCreateInput("", 96, 200, 129, 21) $Label7 = GUICtrlCreateLabel("City:", 240, 200, 24, 17) $City = GUICtrlCreateInput("", 280, 200, 153, 21) $Label8 = GUICtrlCreateLabel("State:", 40, 232, 32, 17) $State = GUICtrlCreateInput("", 72, 232, 121, 21) $Label9 = GUICtrlCreateLabel("Phone Number:", 40, 264, 78, 17) $Zip = GUICtrlCreateInput("", 280, 232, 105, 21) $Label10 = GUICtrlCreateLabel("-", 176, 264, 7, 17) $PhoneDigit_One = GUICtrlCreateInput("", 120, 264, 41, 21) $Label11 = GUICtrlCreateLabel("-", 248, 264, 7, 17) $PhoneDigit_Two = GUICtrlCreateInput("", 192, 264, 41, 21) $Label12 = GUICtrlCreateLabel("Email:", 40, 296, 32, 17) $PhoneDigit_Three = GUICtrlCreateInput("", 264, 264, 41, 21) $Label13 = GUICtrlCreateLabel("Money Made:", 40, 328, 69, 17) $Lable14 = GUICtrlCreateLabel("Notes:", 40, 360, 35, 17) $Label14 = GUICtrlCreateLabel("Zip:", 240, 232, 22, 17) $Email = GUICtrlCreateInput("", 80, 296, 153, 21) $MoneyMade = GUICtrlCreateCombo("$5", 120, 328, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $MoneyMade = GUICtrlSetData(-1, "$10 | $15 | $20 | $25 | $30 | $35 | $40 | $45 | $50 | $60 | $65 | $70 | $75 | $80 | $85 | $90 | $95 | $100") $Notes = GUICtrlCreateEdit("", 24, 384, 577, 137) GUICtrlSetData(-1, "") $Secondary_SaveButton = GUICtrlCreateButton("Save", 24, 536, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Secondary_CancelButton = GUICtrlCreateButton("Cancel", 112, 536, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Secondary_CancelButton GUIDelete($Form2) Return Case $Secondary_SaveButton IniWrite($sIniFile, "Add Job", "Date", GUICtrlRead($Date)) IniWrite($sIniFile, "Add Job", "Time Started", GUICtrlRead($TimeStarted) & GUICtrlRead($TimeStart_amPM)) IniWrite($sIniFile, "Add Job", "Time Finished", GUICtrlRead($TimeFinished) & GUICtrlRead($TimeFinish_amPM)) IniWrite($sIniFile, "Add Job", "First Name", GUICtrlRead($FirstName)) IniWrite($sIniFile, "Add Job", "Last Name", GUICtrlRead($LastName)) IniWrite($sIniFile, "Add Job", "Address", GUICtrlRead($Address)) IniWrite($sIniFile, "Add Job", "City", GUICtrlRead($City)) IniWrite($sIniFile, "Add Job", "State", GUICtrlRead($State)) IniWrite($sIniFile, "Add Job", "Zip", GUICtrlRead($Zip)) IniWrite($sIniFile, "Add Job", "Phone Number", GUICtrlRead($PhoneDigit_One) & GUICtrlRead($PhoneDigit_Two) & GUICtrlRead($PhoneDigit_Three)) IniWrite($sIniFile, "Add Job", "Email", GUICtrlRead($Email)) IniWrite($sIniFile, "Add Job", "Money Made", GUICtrlRead($MoneyMade)) IniWrite($sIniFile, "Add Job", "Notes", GUICtrlRead($Notes)) GUIDelete($Form2) Return EndSwitch WEnd EndFunc ;==>Add_Job
-
I will give it a try once I got the whole list saved. Running into problems with the "Time." I have the time in a combo box, and "pm/am" in a combo box beside it. Trying to figure out how to include both of them on the same line.
-
I can do this without changing the code everytime?
-
Cool it works, though I did think of something else. When I save it, its saved in the ini file which I can use to bring it back up to edit it. But...when I add new addresses and stuff, it will just change the one I already saved.
-
Renamed all the first Vars with "Main" in front of it to specify it is the Main GUI. I keep getting errors with the save function for the .ini Write, this piece of code. Where I have the second "Add Job" is the problem. I'm not sure what is suppose to go there. Here is the updated code. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> #include <GUIListBox.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> $Form1 = GUICreate("Yesterday's Lawn Care", 615, 410, 192, 124) $sIniFile = @ScriptDir & "\Storage.ini" $MenuItem_File = GUICtrlCreateMenu("&File") $MenuItem_Edit = GUICtrlCreateMenu("&Edit") $MenuItem_Help = GUICtrlCreateMenu("&Help") $Main_Tab1 = GUICtrlCreateTab(8, 8, 601, 377) $Main_TabSheet1 = GUICtrlCreateTabItem("Job Manager") $Main_Group1 = GUICtrlCreateGroup("Jobs", 16, 40, 585, 329) $Main_List1 = GUICtrlCreateList("", 24, 64, 537, 253) $Main_Button1 = GUICtrlCreateButton("Add", 24, 336, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MsgBox($MB_SYSTEMMODAL, "ControlID", "On creating main GUI:" & @CRLF & "$Button1 = " & $Main_Button1) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $Main_Button2 = GUICtrlCreateButton("Edit", 112, 336, 75, 25) $Main_Button3 = GUICtrlCreateButton("Remove", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet2 = GUICtrlCreateTabItem("Equipment Manager") $Main_Group2 = GUICtrlCreateGroup("Equipment", 16, 40, 585, 329) $Main_List2 = GUICtrlCreateList("", 24, 64, 537, 253) $Main_Button4 = GUICtrlCreateButton("Add Unit", 24, 336, 75, 25) $Main_Button5 = GUICtrlCreateButton("Edit Unit", 112, 336, 75, 25) $Main_Button6 = GUICtrlCreateButton("Remove Unit", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_TabSheet3 = GUICtrlCreateTabItem("Stastistics/Money") $Main_Group3 = GUICtrlCreateGroup("Stastistics", 16, 48, 569, 329) GUICtrlCreateGroup("", -99, -99, 1, 1) $Main_Button7 = GUICtrlCreateButton("Add Expense", 24, 344, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Main_Button1 Add_Job() MsgBox($MB_SYSTEMMODAL, "ControlID", "On returning to main GUI:" & @CRLF & "$Button1 = " & $Button1) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Add_Job() $Form2 = GUICreate("Add Job", 615, 578, 232, 131) $sIniFile = @ScriptDir & "\Storage.ini" $Group1 = GUICtrlCreateGroup("Job Information", 8, 8, 601, 561) $Label1 = GUICtrlCreateLabel("Date:", 32, 40, 30, 17) $Date1 = GUICtrlCreateDate("2013/08/25 01:14:40", 64, 40, 186, 21) $Label2 = GUICtrlCreateLabel("Time Started:", 32, 72, 67, 17) $Input1 = GUICtrlCreateInput("00:00", 112, 72, 49, 21) $Combo1 = GUICtrlCreateCombo("pm", 168, 72, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo1 = GUICtrlSetData(-1, "am") $Label3 = GUICtrlCreateLabel("Time Finished:", 32, 104, 72, 17) $Input2 = GUICtrlCreateInput("00:00", 112, 104, 49, 21) $Combo2 = GUICtrlCreateCombo("pm", 168, 104, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo2 = GUICtrlSetData(-1, "am") $Label4 = GUICtrlCreateLabel("First Name:", 40, 136, 57, 17) $Input3 = GUICtrlCreateInput("First Name", 112, 136, 121, 21) $Label5 = GUICtrlCreateLabel("Last Name:", 40, 168, 58, 17) $Input4 = GUICtrlCreateInput("", 112, 168, 121, 21) $Label6 = GUICtrlCreateLabel("Address:", 40, 200, 45, 17) GUICtrlCreateInput("", 96, 200, 129, 21) $Label7 = GUICtrlCreateLabel("City:", 240, 200, 24, 17) $Input5 = GUICtrlCreateInput("", 280, 200, 153, 21) $Label8 = GUICtrlCreateLabel("State:", 40, 232, 32, 17) $Input6 = GUICtrlCreateInput("", 72, 232, 121, 21) $Label9 = GUICtrlCreateLabel("Phone Number:", 40, 264, 78, 17) $Input7 = GUICtrlCreateInput("", 280, 232, 105, 21) $Label10 = GUICtrlCreateLabel("-", 176, 264, 7, 17) $Input8 = GUICtrlCreateInput("", 120, 264, 41, 21) $Label11 = GUICtrlCreateLabel("-", 248, 264, 7, 17) $Input9 = GUICtrlCreateInput("", 192, 264, 41, 21) $Label12 = GUICtrlCreateLabel("Email:", 40, 296, 32, 17) $Input10 = GUICtrlCreateInput("", 264, 264, 41, 21) $Label13 = GUICtrlCreateLabel("Money Made:", 40, 328, 69, 17) $Lable14 = GUICtrlCreateLabel("Notes:", 40, 360, 35, 17) $Label14 = GUICtrlCreateLabel("Zip:", 240, 232, 22, 17) $Input11 = GUICtrlCreateInput("", 80, 296, 153, 21) $Combo3 = GUICtrlCreateCombo("$5", 120, 328, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo3 = GUICtrlSetData(-1, "$10 | $15 | $20 | $25 | $30 | $35 | $40 | $45 | $50 | $60 | $65 | $70 | $75 | $80 | $85 | $90 | $95 | $100") $Edit1 = GUICtrlCreateEdit("", 24, 384, 577, 137) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Save", 24, 536, 75, 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MsgBox($MB_SYSTEMMODAL, "ControlID", "On creating secondary GUI:" & @CRLF & "$Button1 = " & $Button1) ; ~~~~~~~~~~~~~~~~~~~~~~~ $Button2 = GUICtrlCreateButton("Cancel", 112, 536, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 GUIDelete($Form2) Return Case $Button1 IniWrite($sIniFile, "Add Job", "Input3" GUICtrlRead($Input3)) EndSwitch WEnd EndFunc ;==>Add_Job
-
; Author: Brandon M. Royer ; Program: Lawn Mowing Manager ; Date: 8/1/2013 ; Updated GUI 8/25/2013 ; Updated GUI, and added some functions 8/26/2013 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\brandon\documents\koda_1.7.3.0\forms\ylawncare.kxf $Form1 = GUICreate("Yesterday's Lawn Care", 615, 410, 192, 124) $sIniFile = @ScriptDir & "\Storage.ini" $MenuItem2 = GUICtrlCreateMenu("&File") $MenuItem1 = GUICtrlCreateMenu("&Edit") $MenuItem3 = GUICtrlCreateMenu("&Help") $Tab1 = GUICtrlCreateTab(8, 8, 601, 377) $TabSheet1 = GUICtrlCreateTabItem("Job Manager") $Group1 = GUICtrlCreateGroup("Jobs", 16, 40, 585, 329) $List1 = GUICtrlCreateList("", 24, 64, 537, 253) $Button1 = GUICtrlCreateButton("Add", 24, 336, 75, 25) $Button2 = GUICtrlCreateButton("Edit", 112, 336, 75, 25) $Button3 = GUICtrlCreateButton("Remove", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $TabSheet2 = GUICtrlCreateTabItem("Equipment Manager") $Group2 = GUICtrlCreateGroup("Equipment", 16, 40, 585, 329) $List2 = GUICtrlCreateList("", 24, 64, 537, 253) $Button4 = GUICtrlCreateButton("Add Unit", 24, 336, 75, 25) $Button5 = GUICtrlCreateButton("Edit Unit", 112, 336, 75, 25) $Button6 = GUICtrlCreateButton("Remove Unit", 200, 336, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $TabSheet3 = GUICtrlCreateTabItem("Stastistics/Money") $Group3 = GUICtrlCreateGroup("Stastistics", 16, 48, 569, 329) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button7 = GUICtrlCreateButton("Add Expense", 24, 344, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button1 Add_Job() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Add_Job () #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\brandon\documents\koda_1.7.3.0\forms\add_job.kxf $Form2 = GUICreate("Add Job", 615, 578, 232, 131) $sIniFile = @ScriptDir & "\Storage.ini" $Group1 = GUICtrlCreateGroup("Job Information", 8, 8, 601, 561) $Label1 = GUICtrlCreateLabel("Date:", 32, 40, 30, 17) $Date1 = GUICtrlCreateDate("2013/08/25 01:14:40", 64, 40, 186, 21) $Label2 = GUICtrlCreateLabel("Time Started:", 32, 72, 67, 17) $Input1 = GUICtrlCreateInput("00:00", 112, 72, 49, 21) $Combo1 = GUICtrlCreateCombo("pm", 168, 72, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo1 = GUICtrlSetData(-1, "am") $Label3 = GUICtrlCreateLabel("Time Finished:", 32, 104, 72, 17) $Input2 = GUICtrlCreateInput("00:00", 112, 104, 49, 21) $Combo2 = GUICtrlCreateCombo("pm", 168, 104, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo2 = GUICtrlSetData(-1, "am") $Label4 = GUICtrlCreateLabel("First Name:", 40, 136, 57, 17) $Input3 = GUICtrlCreateInput("First Name", 112, 136, 121, 21) $Label5 = GUICtrlCreateLabel("Last Name:", 40, 168, 58, 17) $Input4 = GUICtrlCreateInput("", 112, 168, 121, 21) $Label6 = GUICtrlCreateLabel("Address:", 40, 200, 45, 17) GUICtrlCreateInput("", 96, 200, 129, 21) $Label7 = GUICtrlCreateLabel("City:", 240, 200, 24, 17) $Input5 = GUICtrlCreateInput("", 280, 200, 153, 21) $Label8 = GUICtrlCreateLabel("State:", 40, 232, 32, 17) $Input6 = GUICtrlCreateInput("", 72, 232, 121, 21) $Label9 = GUICtrlCreateLabel("Phone Number:", 40, 264, 78, 17) $Input7 = GUICtrlCreateInput("", 280, 232, 105, 21) $Label10 = GUICtrlCreateLabel("-", 176, 264, 7, 17) $Input8 = GUICtrlCreateInput("", 120, 264, 41, 21) $Label11 = GUICtrlCreateLabel("-", 248, 264, 7, 17) $Input9 = GUICtrlCreateInput("", 192, 264, 41, 21) $Label12 = GUICtrlCreateLabel("Email:", 40, 296, 32, 17) $Input10 = GUICtrlCreateInput("", 264, 264, 41, 21) $Label13 = GUICtrlCreateLabel("Money Made:", 40, 328, 69, 17) $Lable14 = GUICtrlCreateLabel("Notes:", 40, 360, 35, 17) $Label14 = GUICtrlCreateLabel("Zip:", 240, 232, 22, 17) $Input11 = GUICtrlCreateInput("", 80, 296, 153, 21) $Combo3 = GUICtrlCreateCombo("$5", 120, 328, 57, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo3 = GUICtrlSetData(-1, "$10 | $15 | $20 | $25 | $30 | $35 | $40 | $45 | $50 | $60 | $65 | $70 | $75 | $80 | $85 | $90 | $95 | $100") $Edit1 = GUICtrlCreateEdit("", 24, 384, 577, 137) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Save", 24, 536, 75, 25) $Button2 = GUICtrlCreateButton("Cancel", 112, 536, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 GUIDelete ( $Form2 ) Return Case $Button1 IniWrite($sIniFile, "Add Job", "First Name" GUICtrlRead($Input3)) EndSwitch WEnd EndFunc
-
I'm having problems getting this to work. I want to press save and save the whole file so I can bring it up later in the program. Right now I'm just trying to get it to save, I'll worry about the loading later. Also when I close out of this secondary GUI and go back to the main one, I cannot press the "Add Job" button again to open up the secondary. Func Add_Job () #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\brandon\documents\koda_1.7.3.0\forms\add_job.kxf $Form2 = GUICreate("Add Job", 615, 578, 232, 131) $sIniFile = @ScriptDir & "\Storage.ini" $Group1 = GUICtrlCreateGroup("Job Information", 8, 8, 601, 561) $Label1 = GUICtrlCreateLabel("Date:", 32, 40, 30, 17) $Date1 = GUICtrlCreateDate("2013/08/25 01:14:40", 64, 40, 186, 21) $Label2 = GUICtrlCreateLabel("Time Started:", 32, 72, 67, 17) $Input1 = GUICtrlCreateInput("00:00", 112, 72, 49, 21) $Combo1 = GUICtrlCreateCombo("pm", 168, 72, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo1 = GUICtrlSetData(-1, "am") $Label3 = GUICtrlCreateLabel("Time Finished:", 32, 104, 72, 17) $Input2 = GUICtrlCreateInput("00:00", 112, 104, 49, 21) $Combo2 = GUICtrlCreateCombo("pm", 168, 104, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo2 = GUICtrlSetData(-1, "am") $Label4 = GUICtrlCreateLabel("First Name:", 40, 136, 57, 17) $Input3 = GUICtrlCreateInput("First Name", 112, 136, 121, 21) $Label5 = GUICtrlCreateLabel("Last Name:", 40, 168, 58, 17) $Input4 = GUICtrlCreateInput("", 112, 168, 121, 21) $Label6 = GUICtrlCreateLabel("Address:", 40, 200, 45, 17) GUICtrlCreateInput("", 96, 200, 129, 21) $Label7 = GUICtrlCreateLabel("City:", 240, 200, 24, 17) $Input5 = GUICtrlCreateInput("", 280, 200, 153, 21) $Label8 = GUICtrlCreateLabel("State:", 40, 232, 32, 17) $Input6 = GUICtrlCreateInput("", 72, 232, 121, 21) $Label9 = GUICtrlCreateLabel("Phone Number:", 40, 264, 78, 17) $Input7 = GUICtrlCreateInput("", 280, 232, 105, 21) $Label10 = GUICtrlCreateLabel("-", 176, 264, 7, 17) $Input8 = GUICtrlCreateInput("", 120, 264, 41, 21) $Label11 = GUICtrlCreateLabel("-", 248, 264, 7, 17) $Input9 = GUICtrlCreateInput("", 192, 264, 41, 21) $Label12 = GUICtrlCreateLabel("Email:", 40, 296, 32, 17) $Input10 = GUICtrlCreateInput("", 264, 264, 41, 21) $Label13 = GUICtrlCreateLabel("Money Made:", 40, 328, 69, 17) $Lable14 = GUICtrlCreateLabel("Notes:", 40, 360, 35, 17) $Label14 = GUICtrlCreateLabel("Zip:", 240, 232, 22, 17) $Input11 = GUICtrlCreateInput("", 80, 296, 153, 21) $Combo3 = GUICtrlCreateCombo("$5", 120, 328, 57, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo3 = GUICtrlSetData(-1, "$10 | $15 | $20 | $25 | $30 | $35 | $40 | $45 | $50 | $60 | $65 | $70 | $75 | $80 | $85 | $90 | $95 | $100") $Edit1 = GUICtrlCreateEdit("", 24, 384, 577, 137) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Save", 24, 536, 75, 25) $Button2 = GUICtrlCreateButton("Cancel", 112, 536, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 GUIDelete ( $Form2 ) Return Case $Button1 IniWrite($sIniFile, "Add Job", "First Name" GUICtrlRead($Input3)) EndSwitch WEnd EndFunc
-
I've seen bots for games, cheats for games, little snippets to do daily computer tasks. What I want to see, is complete software written in AutoIt. I'm talking about decent software programs that would normally be programmed in VB or Basic. The reason? I just want to see the limits of autoit, and interested in seeing some creativity.