Jump to content

CroatianPig

Active Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by CroatianPig

  1. I agree with everything, but it's not easy... Specially because I'm learning to programm only using the internet. I asked many people who have some knowledge about programming about AutoIt, they haven't even heard of it. So, I have to do it alone, no one can show me in real life what something does, and it would be much easier, but ok, I'm not complaning. I know there is alot of work and learning, and I'm ready for that. Someone advised me to download MySQL, instead of SQLite, as he said SQLite is very limited. I'm watching tutorials, and some german forum site about AutoIt mixing with MySQL. Alot of work..................
  2. If I wanted a sql type database for server database, is it free? I am googling, it directs me to the Microsoft site, and I don't see it's free.
  3. Ok I will try, but seriously, is there some programming language which would be better for this? I googled a bit, got results about java, msql, etc etc... Because at the end I will have to be able to do "fiscalisation", and I'm not sure if I can do it with autoit... No idea how to explain it, but I will try.... So, law is that all bills must have unique code recieved from the national tax administration, in Ministry of finances... It's basically 2 lines of a long code and it looks like this: http://www.datalab.hr/index.php?id=5145 So, for any bill that is paid by cash, the program quickly connects to some website, probobly enters the bill price and tax, and returns the code back and you print the bill. I probobly explained horribly, ask me please whatever is not clear.
  4. Is it possible to have theoretically endless number of products, which I would enter? Because using GuiCtrlCreateListViewItem(...) seems as if I would have to program each row? Let's say, I have 400 products all together, and often I must put new products in. And should I do it in my script: ; ; ; ; ; This is the INI file we will write to. It will be created on the Desktop. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <Table.au3> Global Const $SS_CENTER = 1 Global Const $SS_CENTERIMAGE = 1 Global $GUI_2 = 9999 Global $storehouse = 9999 Global $GUI_new_item = 9999 Global $no_alcohol = 9999 Global $storehouse_exit = 9999 Local $sIni = @DesktopDir & "\AutoIt-Test.ini" Local $Section = "Coca Cola" Local $Code = "018719" Local $Quantity = "312"; It would be best to keep intergers from strings. Local $QuantityType = "0,25l Bottles"; It would be best to keep intergers from strings. ;Demonstrate creating a new section using a string as input. IniWrite($sIni, $Section, "Code", $Code) IniWrite($sIni, $Section, "Quantity", $Quantity) IniWrite($sIni, $Section, "QuantityType", $QuantityType) Global $colors_green = 0x00FF00 Global $colors_yellow = 0xFFFF00 Global $colors_red = 0xFF0000 Global $colors_black = 0x000000 ;GUI_1: $GUI_1= GUICreate("BEN", 400, 300, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_1_buttons: $GUI_1_start= GUICtrlCreateButton("Ulaz", 20, 25, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_green) $GUI_1_exit= GUICtrlCreateButton("Izlaz", 20, 155, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_yellow) ;GUISetState() gui_1() Func gui_1() GUISetState() While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $GUI_1 Switch $msg[0] ; Now check for the messages for $hGUI1 Case $GUI_1_start gui_2() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_1_exit ExitLoop EndSwitch Case $GUI_2 Switch $msg[0] ; Now check for the messages for $hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($GUI_2) GUICtrlSetState($GUI_1_start, $GUI_ENABLE) Case $storehouse gui_3() ;MsgBox("", "MsgBox", "Test from Gui 2") EndSwitch Case $GUI_new_item Switch $msg[0] Case $storehouse_exit GUIDelete($GUI_new_item) GUICtrlSetState($GUI_2, $GUI_ENABLE) EndSwitch EndSwitch WEnd EndFunc Func gui_2() $GUI_2= GUICreate("Main window", 1800, 900, Default, Default) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $storehouse = GUICtrlCreateButton ("Storehouse", 1260, 20, 300, 300) GUICtrlSetFont (-1, 16, 800) GUICtrlSetBkColor (-1, $colors_green) $finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80) GUISetState() EndFunc ;GUI_insert_new_item Func gui_3() $GUI_new_item = GUICreate("Insert new item", 1400, 900, Default, Default) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") $storehouse_exit = GUICtrlCreateButton("Exit", 1180, 680, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) GUISetState() EndFunc #cs ;GUI_2_labels: GUICtrlCreateLabel("I", 200, 10, 450, 100) GUICtrlSetFont(-1, 16, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Wares", 45, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Prices", 350, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) ;GUICtrlCreateLabel("2:", 490, 20, 450, 100) ;GUICtrlSetFont(-1, 20, 800) ;GUICtrlSetColor(-1, $colors_green) ;GUI_2_combos+inputs: Global $checkbox_1 = GUICtrlCreateCheckbox("", 10, 105, 20, 20) Global $item_1 = GUICtrlCreateCombo("1", 40, 100, 300, Default) ; create first item GUICtrlSetData(-1, "2|3|4|5|6|7|8|", "1") ; add other item snd set a new default GUICtrlSetFont(-1, 12, 600) Global $quantity_1= GUICtrlCreateInput( '', 345, 100, 160, 31) GUICtrlSetLimit(-1,10) #ce GUICtrlSetFont(-1, 12, 600) ;GUI_2_buttons: or a separate "table" file?
  5. Well, actually I would need a table in which I could put endless number of items (in rows), and so I could delete or edit any of them, which would be saved in .ini file. It should have like 10 columns (code, name, quantity, buying price, selling price, tax percentage, special mark,...). How should I start that?
  6. Ok, I thought to make a table in the warehouse GUI... I've been to this link: '?do=embed' frameborder='0' data-embedContent>> , downloaded table.au3 and the script, worked, but then I saw the code of the table... OH MY GOD ! It looks like 20 pages of coding... How to start it? Any good link (youtube, page, forum thread) as to how to start table from 0, I mean for a beginner...
  7. Dude, you are like a Jesus, seriously. But not the way you think. Jesus needed to help the man who was hungry, so instead of giving him a fish and feeding him for the day, he showed him how to catch a fish, and fed him for a lifetime. So please, for once, dont be a Jesus, be a human, and answer my question
  8. Please, all suggests and advices are welcome ! In case it looks ugly, I KNOW, I wanted to make something work for the first time, then put decorations.
  9. I did it ! Here, it can go indefinitely long, but question please ! Maybe the first non-facepalm question I ask... First, here is the script: ; ; ; ; ; ; IMPORTANT: Has 7 GUI-s: ; 1. GUI 1 is just to start ; 2. GUI 2 is the main window where products should be chosen ; 3. GUI 3 is where all the non-alcoholic drinks are ; 4. GUI 4 is where all alcoholic drinks are ; 5. GUI 5 IS A GUI WITH VARIABLE INPUT, for quantity, and price ; 6. GUI 6 is where a new product should be entered ; 7. GUI 7 is where a person can see the storehouse wares (to know for example, which items to order) ; This is the INI file we will write to. It will be created on the Desktop. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> Global Const $SS_CENTER = 1 Global Const $SS_CENTERIMAGE = 1 Global $GUI_2 = 9999 Global $storehouse = 9999 Global $GUI_storehouse = 9999 Global $no_alcohol = 9999 Global $storehouse_exit Local $sIni = @DesktopDir & "\AutoIt-Test.ini" Local $Section = "Coca Cola" Local $Code = "018719" Local $Quantity = "312"; It would be best to keep intergers from strings. Local $QuantityType = "0,25l Bottles"; It would be best to keep intergers from strings. ;Demonstrate creating a new section using a string as input. IniWrite($sIni, $Section, "Code", $Code) IniWrite($sIni, $Section, "Quantity", $Quantity) IniWrite($sIni, $Section, "QuantityType", $QuantityType) Global $colors_green = 0x00FF00 Global $colors_yellow = 0xFFFF00 Global $colors_red = 0xFF0000 Global $colors_black = 0x000000 ;GUI_1: $GUI_1= GUICreate("BEN", 400, 300, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_1_buttons: $GUI_1_start= GUICtrlCreateButton("Ulaz", 20, 25, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_green) $GUI_1_exit= GUICtrlCreateButton("Izlaz", 20, 155, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_yellow) ;GUISetState() gui_1() Func gui_1() GUISetState() While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $GUI_1 Switch $msg[0] ; Now check for the messages for $hGUI1 Case $GUI_1_start gui_2() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_1_exit ExitLoop EndSwitch Case $GUI_2 Switch $msg[0] ; Now check for the messages for $hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($GUI_2) GUICtrlSetState($GUI_1_start, $GUI_ENABLE) Case $no_alcohol gui_3() ;MsgBox("", "MsgBox", "Test from Gui 2") EndSwitch Case $GUI_storehouse Switch $msg[0] Case $storehouse_exit GUIDelete($GUI_storehouse) GUICtrlSetState($GUI_2, $GUI_ENABLE) EndSwitch EndSwitch WEnd EndFunc Func gui_2() $GUI_2= GUICreate("Main window", 1800, 900, Default, Default) $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUISetState() EndFunc ;==>gui2 Func gui_3() $GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default) $storehouse_exit = GUICtrlCreateButton("Exit", 20, 20, 200, 200) GUISetState() EndFunc ;==>gui2 #cs ;GUI_2: $GUI_2= GUICreate("Main window", 1800, 900, Default, Default) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") ;GUI_2_buttons: $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $alcohol = GUICtrlCreateButton("Alcohol", 240, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $storehouse = GUICtrlCreateButton ("Storehouse", 1260, 20, 300, 300) GUICtrlSetFont (-1, 16, 800) GUICtrlSetBkColor (-1, $colors_green) #ce $finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80) ;GUI_7: ;$GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default) ;==> draws GUI ;GUISetBkColor(0x000000) ;GUISetFont(14, 400, "", "Cambria") ;GUI_7_buttons: ;$exit_storehouse = GUICtrlCreateButton("Exit", 20, 20, 200, 200) ;GUICtrlSetFont(-1, 16, 800) ;GUICtrlSetBkColor(-1, $colors_green) #cs ;GUI_2_labels: GUICtrlCreateLabel("I", 200, 10, 450, 100) GUICtrlSetFont(-1, 16, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Wares", 45, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Prices", 350, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) ;GUICtrlCreateLabel("2:", 490, 20, 450, 100) ;GUICtrlSetFont(-1, 20, 800) ;GUICtrlSetColor(-1, $colors_green) ;GUI_2_combos+inputs: Global $checkbox_1 = GUICtrlCreateCheckbox("", 10, 105, 20, 20) Global $item_1 = GUICtrlCreateCombo("1", 40, 100, 300, Default) ; create first item GUICtrlSetData(-1, "2|3|4|5|6|7|8|", "1") ; add other item snd set a new default GUICtrlSetFont(-1, 12, 600) Global $quantity_1= GUICtrlCreateInput( '', 345, 100, 160, 31) GUICtrlSetLimit(-1,10) #ce GUICtrlSetFont(-1, 12, 600) ;GUI_2_buttons: Ok, so, we have $msg[0] and $msg[1] Why doesn't it work if I put $msg[2] in the 3. GUI (storehouse)? Don't I need a new array value for each new GUI? My question rocks, I know, thank you, oh boy, now I'm all blushing and shy....
  10. I got it working with 2 GUI-s. ; ; ; ; ; ; IMPORTANT: Has 7 GUI-s: ; 1. GUI 1 is just to start ; 2. GUI 2 is the main window where products should be chosen ; 3. GUI 3 is where all the non-alcoholic drinks are ; 4. GUI 4 is where all alcoholic drinks are ; 5. GUI 5 IS A GUI WITH VARIABLE INPUT, for quantity, and price ; 6. GUI 6 is where a new product should be entered ; 7. GUI 7 is where a person can see the storehouse wares (to know for example, which items to order) ; This is the INI file we will write to. It will be created on the Desktop. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> Global Const $SS_CENTER = 1 Global Const $SS_CENTERIMAGE = 1 Global $GUI_2 = 9999, $storehouse = 9999 Global $GUI_storehouse = 9999, $exit_storehouse = 9999 Local $sIni = @DesktopDir & "\AutoIt-Test.ini" Local $Section = "Coca Cola" Local $Code = "018719" Local $Quantity = "312"; It would be best to keep intergers from strings. Local $QuantityType = "0,25l Bottles"; It would be best to keep intergers from strings. ;Demonstrate creating a new section using a string as input. IniWrite($sIni, $Section, "Code", $Code) IniWrite($sIni, $Section, "Quantity", $Quantity) IniWrite($sIni, $Section, "QuantityType", $QuantityType) Global $colors_green = 0x00FF00 Global $colors_yellow = 0xFFFF00 Global $colors_red = 0xFF0000 Global $colors_black = 0x000000 ;GUI_1: $GUI_1= GUICreate("BEN", 400, 300, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_1_buttons: $GUI_1_start= GUICtrlCreateButton("Ulaz", 20, 25, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_green) $GUI_1_exit= GUICtrlCreateButton("Izlaz", 20, 155, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_yellow) ;GUISetState() gui_1() Func gui_1() GUISetState() While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $GUI_1 Switch $msg[0] ; Now check for the messages for $hGUI1 Case $GUI_1_start gui_2() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_1_exit ExitLoop EndSwitch Case $GUI_2 Switch $msg[0] ; Now check for the messages for $hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($GUI_2) GUICtrlSetState($GUI_1_start, $GUI_ENABLE) Case $storehouse MsgBox("", "MsgBox", "Test from Gui 2") EndSwitch EndSwitch WEnd EndFunc Func gui_2() $GUI_2= GUICreate("Main window", 1800, 900, Default, Default) $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUISetState() EndFunc ;==>gui2 ;GUI_2: $GUI_2= GUICreate("Main window", 1800, 900, Default, Default) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") ;GUI_2_buttons: $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $alcohol = GUICtrlCreateButton("Alcohol", 240, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $storehouse = GUICtrlCreateButton ("Storehouse", 1260, 20, 300, 300) GUICtrlSetFont (-1, 16, 800) GUICtrlSetBkColor (-1, $colors_green) $finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80) ;GUI_7: ;$GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default) ;==> draws GUI ;GUISetBkColor(0x000000) ;GUISetFont(14, 400, "", "Cambria") ;GUI_7_buttons: ;$exit_storehouse = GUICtrlCreateButton("Exit", 20, 20, 200, 200) ;GUICtrlSetFont(-1, 16, 800) ;GUICtrlSetBkColor(-1, $colors_green) #cs ;GUI_2_labels: GUICtrlCreateLabel("I", 200, 10, 450, 100) GUICtrlSetFont(-1, 16, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Wares", 45, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Prices", 350, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) ;GUICtrlCreateLabel("2:", 490, 20, 450, 100) ;GUICtrlSetFont(-1, 20, 800) ;GUICtrlSetColor(-1, $colors_green) ;GUI_2_combos+inputs: Global $checkbox_1 = GUICtrlCreateCheckbox("", 10, 105, 20, 20) Global $item_1 = GUICtrlCreateCombo("1", 40, 100, 300, Default) ; create first item GUICtrlSetData(-1, "2|3|4|5|6|7|8|", "1") ; add other item snd set a new default GUICtrlSetFont(-1, 12, 600) Global $quantity_1= GUICtrlCreateInput( '', 345, 100, 160, 31) GUICtrlSetLimit(-1,10) #ce GUICtrlSetFont(-1, 12, 600) ;GUI_2_buttons: The point is that a user can always get from any GUI to any GUI indefinitely times, ie. never to be stuck in a script. Now I will try to put the 3. GUI (warehouse).
  11. This is the script from that page: #include <GUIConstantsEx.au3> Global $hGUI2 = 9999, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements gui1() Func gui1() $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) $hButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30) $hButton2 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUISetState() While 1 $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array Switch $aMsg[1] ; check which GUI sent the message Case $hGUI1 Switch $aMsg[0] ; Now check for the messages for $hGUI1 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<< ExitLoop Case $hButton1 MsgBox("", "MsgBox 1", "Test from Gui 1") Case $hButton2 GUICtrlSetState($hButton2, $GUI_DISABLE) gui2() EndSwitch Case $hGUI2 Switch $aMsg[0] ; Now check for the messages for $hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($hGUI2) GUICtrlSetState($hButton2, $GUI_ENABLE) Case $hButton3 MsgBox("", "MsgBox", "Test from Gui 2") EndSwitch EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUISetState() EndFunc ;==>gui2 The [0] isnt decleared, only [1], but it works.
  12. What happens when function ends? Does it continue at that line, or it returns 1 step after we started the function? Example... What's the next that happens here? ..... ..... ...... bla bla bla While 1 Switch bla bla bla Case bla bla func() Msgbox (1) <------------ EndSwitch WEnd Func func() bla bla bla EndFunc Msgbox (2) <----------- After the function ends, will I get the msgbox 1 or 2? 1 right?
  13. Ok I go read again. This ok? http://www.autoitscript.com/wiki/Managing_Multiple_GUIs
  14. Ok, I see I will have to learn what arrays are, and how they work. What's the minimum number of GUI-s that would require GUISetState with array? Edano did on the first page a script with 2 GUI-s, but no arrays. Means 3 require an array?
  15. What beta? Link please. I got newest autoit.......... P.S. Found but.... Note: The beta can be unstable – always check the forums. oO Ok, got it working. Should I always write code in beta? And your both GUI-s open at once on start... I need to open 2. and 3. if certain buttons are pressed
  16. I can't actually start it... Error: can't open include file <MsgBoxConstants.au3> And $MB_SYSTEMMODAL not decleared as variable... P.S. I will write that script again, and put it later. If possible, tell me which exact line has a mistake. Ty, laterzzz
  17. So, can you tell me, what's actually wrong with this scipt I made? Is it one or more mistakes? I did every step for 3 times, and the previous script I made the exact same way, worked ! How??? Btw, I deleted everything half an hour ago, because I was mad like 100 devils. I must install the program again, and write it all over again. Great... Btw, do you sometimes explode totally because of programming?
  18. I missunderstood then. Btw, is it ok and polite to talk about other programs and programming languages, because this is an official AutoIt forum? I ask because I started it by asking something, but don't know if it's ok...
  19. Is this from some link? I found this yesterday, but as I said, for 3 GUI-s, complete different story than 2. http://www.autoitscript.com/wiki/Managing_Multiple_GUIs
  20. Yes, I have only best words for everyone here, 10 people or so helped alot. As I said, I would never blame anyone else for my own fails.
  21. Yes, my friend who does websites etc, told me that php is "all in the browser", but I thought if I could scroll the page, I could practically put endless number or windows, tables, inputs, labels, buttons... And replace the GUI with a giant offline webpage. But no idea, it's too complicated anyway. I underestimated programming quite alot. I rock at maths and physics, but this is much more, and I become an emo kid when something trivial is blocking me. But now I have an idea, which could be 10 times easier to make for a person like myself. I could make a GUI with scrollbars that could have size, let's say: 1800 pixels horizontal and 10 000 pixels vertical, to avoid loops which are in looping loops, and all inside a loop. The warehouse, inputs, etc, etc, etc could be all in 1 GUI. Would that be too demanding for processors nowadays? With colors, fonts...
  22. I joke often, but not this time. I never blame anyone else. I say openly I'm too retarded for this, whether atm or chronically. May I ask why you think it's a joke? :-)
  23. I was joking. But this is f***** ridiculus what a difference is to make a script with 2 GUI-s and 3 GUI-s. I'm so mad... ; ; ; ; ; ; IMPORTANT: Has 7 GUI-s: ; 1. GUI 1 is just to start ; 2. GUI 2 is the main window where products should be chosen ; 3. GUI 3 is where all the non-alcoholic drinks are ; 4. GUI 4 is where all alcoholic drinks are ; 5. GUI 5 IS A GUI WITH VARIABLE INPUT, for quantity, and price ; 6. GUI 6 is where a new product should be entered ; 7. GUI 7 is where a person can see the storehouse wares (to know for example, which items to order) ; This is the INI file we will write to. It will be created on the Desktop. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> Global Const $SS_CENTER = 1 Global Const $SS_CENTERIMAGE = 1 Local $sIni = @DesktopDir & "\AutoIt-Test.ini" Local $Section = "Coca Cola" Local $Code = "018719" Local $Quantity = "312"; It would be best to keep intergers from strings. Local $QuantityType = "0,25l Bottles"; It would be best to keep intergers from strings. ; Demonstrate creating a new section using a string as input. IniWrite($sIni, $Section, "Code", $Code) IniWrite($sIni, $Section, "Quantity", $Quantity) IniWrite($sIni, $Section, "QuantityType", $QuantityType) #include <GUIConstantsEx.au3> Global $colors_green = 0x00FF00 Global $colors_yellow = 0xFFFF00 Global $colors_red = 0xFF0000 Global $colors_black = 0x000000 ;GUI_1: $GUI_1= GUICreate("BEN", 400, 300, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_1_buttons: $GUI_1_start= GUICtrlCreateButton("Ulaz", 20, 25, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_green) $GUI_1_exit= GUICtrlCreateButton("Izlaz", 20, 155, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_yellow) GUISetState() ;GUI_2: $GUI_2= GUICreate("Main window", 1800, 900, Default, Default, $GUI_1) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") ;GUI_2_buttons: $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $alcohol = GUICtrlCreateButton("Alcohol", 240, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $storehouse = GUICtrlCreateButton ("Storehouse", 1260, 20, 300, 300) GUICtrlSetFont (-1, 16, 800) GUICtrlSetBkColor (-1, $colors_green) $finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80) ;GUI_7: ;$GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default, $GUI_2) ;==> draws GUI ;GUISetBkColor(0x000000) ;GUISetFont(14, 400, "", "Cambria") ;GUI_7_buttons: ;$exit_storehouse = GUICtrlCreateButton("Exit", 20, 20, 200, 200) ;GUICtrlSetFont(-1, 16, 800) ;GUICtrlSetBkColor(-1, $colors_green) #cs ;GUI_2_labels: GUICtrlCreateLabel("I", 200, 10, 450, 100) GUICtrlSetFont(-1, 16, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Wares", 45, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Prices", 350, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) ;GUICtrlCreateLabel("2:", 490, 20, 450, 100) ;GUICtrlSetFont(-1, 20, 800) ;GUICtrlSetColor(-1, $colors_green) ;GUI_2_combos+inputs: Global $checkbox_1 = GUICtrlCreateCheckbox("", 10, 105, 20, 20) Global $item_1 = GUICtrlCreateCombo("1", 40, 100, 300, Default) ; create first item GUICtrlSetData(-1, "2|3|4|5|6|7|8|", "1") ; add other item snd set a new default GUICtrlSetFont(-1, 12, 600) Global $quantity_1= GUICtrlCreateInput( '', 345, 100, 160, 31) GUICtrlSetLimit(-1,10) #ce GUICtrlSetFont(-1, 12, 600) ;GUI_2_buttons: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE If WinActive($GUI_1) Then Exit If WinActive($GUI_2) Then GUISetState(@SW_HIDE, $GUI_2) GUISetState(@SW_ENABLE, $GUI_1) WinActivate($GUI_1) ;If WinActive($GUI_3) ;GUISetState(@SW_HIDE, $GUI_3) ;GUISetState(@SW_HIDE, $GUI_2) ;GUISetState(@SW_ENABLE, $GUI_1) EndIf Case $GUI_1_start GUISetState(@SW_DISABLE, $GUI_1) GUISetState(@SW_HIDE, $GUI_1) GUISetState(@SW_ENABLE, $GUI_2) GUISetState(@SW_SHOW, $GUI_2) WinActivate($GUI_2) Case $GUI_1_exit Exit Case $storehouse _gui_storehouse() ;GUISetState (@SW_HIDE, $GUI_2) ;GUISetState(@SW_ENABLE, $GUI_storehouse) ;GUISetState(@SW_SHOW, $GUI_storehouse) ;WinActivate($GUI_storehouse) ;Switch GUIGetMsg() ;Case $exit_storehouse ;GUISetState(@SW_HIDE, $GUI_storehouse) ;GUISetState(@SW_SHOW, $GUI_2) ;WinActivate ($GUI_2) ;EndSwitch ;Case $finish ;$exit_confirm= MsgBox(4, "Confirm finish", "Print the bill?") ;Switch $exit_confirm ;Case $exit_confirm = 6 ;Exit ;Case $exit_confirm = 7 ;Exit ;EndSwitch Exit EndSwitch WEnd Func _gui_storehouse() $GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") $exit_storehouse = GUICtrlCreateButton("Exit", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) GUISetState() EndFunc I think there is no bread for me here, for now I will continue to pay the programmer 300 EUR per year for my program. I think I will uninstall AutoIt and try something easier to learn to code, Visual Basic or PHP, and then return when I'm better at programming.
  24. Ok mister, I will google and find sites, since you are too evil to help my problem directly
  25. Works now, but can't exit "storehouse" gui now... Ridiculus omg... ; ; ; ; ; ; IMPORTANT: Has 7 GUI-s: ; 1. GUI 1 is just to start ; 2. GUI 2 is the main window where products should be chosen ; 3. GUI 3 is where all the non-alcoholic drinks are ; 4. GUI 4 is where all alcoholic drinks are ; 5. GUI 5 IS A GUI WITH VARIABLE INPUT, for quantity, and price ; 6. GUI 6 is where a new product should be entered ; 7. GUI 7 is where a person can see the storehouse wares (to know for example, which items to order) ; This is the INI file we will write to. It will be created on the Desktop. #include <ButtonConstants.au3> Local $sIni = @DesktopDir & "\AutoIt-Test.ini" Local $Section = "Coca Cola" Local $Code = "018719" Local $Quantity = "312"; It would be best to keep intergers from strings. Local $QuantityType = "0,25l Bottles"; It would be best to keep intergers from strings. ; Demonstrate creating a new section using a string as input. IniWrite($sIni, $Section, "Code", $Code) IniWrite($sIni, $Section, "Quantity", $Quantity) IniWrite($sIni, $Section, "QuantityType", $QuantityType) #include <GUIConstantsEx.au3> Global $colors_green = 0x00FF00 Global $colors_yellow = 0xFFFF00 Global $colors_red = 0xFF0000 Global $colors_black = 0x000000 ;GUI_1: $GUI_1= GUICreate("BEN", 400, 300, Default, Default) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_1_buttons: $GUI_1_start= GUICtrlCreateButton("Ulaz", 20, 25, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_green) $GUI_1_exit= GUICtrlCreateButton("Izlaz", 20, 155, 360, 120) GUICtrlSetFont(-1, 40, 800) GUICtrlSetBkColor(-1, $colors_yellow) GUISetState() ;GUI_2: $GUI_2= GUICreate("Main window", 1800, 900, Default, Default, $GUI_1) GUISetBkColor($colors_black) GUISetFont(14, 400, "", "Cambria") ;GUI_2_buttons: $no_alcohol = GUICtrlCreateButton("Non-alcohol", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $alcohol = GUICtrlCreateButton("Alcohol", 240, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) $storehouse = GUICtrlCreateButton ("Storehouse", 1260, 20, 300, 300) GUICtrlSetFont (-1, 16, 800) GUICtrlSetBkColor (-1, $colors_green) $finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80) ;GUI_7: $GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default, $GUI_2) ;==> draws GUI GUISetBkColor(0x000000) GUISetFont(14, 400, "", "Cambria") ;GUI_7_buttons: $exit_storehouse = GUICtrlCreateButton("Exit", 20, 20, 200, 200) GUICtrlSetFont(-1, 16, 800) GUICtrlSetBkColor(-1, $colors_green) #cs ;GUI_2_labels: GUICtrlCreateLabel("I", 200, 10, 450, 100) GUICtrlSetFont(-1, 16, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Wares", 45, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) GUICtrlCreateLabel("Prices", 350, 60, 450, 50) GUICtrlSetFont(-1, 12, 800) GUICtrlSetColor(-1, $colors_green) ;GUICtrlCreateLabel("2:", 490, 20, 450, 100) ;GUICtrlSetFont(-1, 20, 800) ;GUICtrlSetColor(-1, $colors_green) ;GUI_2_combos+inputs: Global $checkbox_1 = GUICtrlCreateCheckbox("", 10, 105, 20, 20) Global $item_1 = GUICtrlCreateCombo("1", 40, 100, 300, Default) ; create first item GUICtrlSetData(-1, "2|3|4|5|6|7|8|", "1") ; add other item snd set a new default GUICtrlSetFont(-1, 12, 600) Global $quantity_1= GUICtrlCreateInput( '', 345, 100, 160, 31) GUICtrlSetLimit(-1,10) #ce GUICtrlSetFont(-1, 12, 600) ;GUI_2_buttons: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE If WinActive($GUI_1) Then Exit If WinActive($GUI_2) Then GUISetState(@SW_HIDE, $GUI_2) GUISetState(@SW_SHOW, $GUI_1) WinActivate($GUI_1) ;If WinActive($GUI_3) ;GUISetState(@SW_HIDE, $GUI_3) ;GUISetState(@SW_HIDE, $GUI_2) ;GUISetState(@SW_ENABLE, $GUI_1) EndIf Case $GUI_1_start GUISetState(@SW_HIDE, $GUI_1) GUISetState(@SW_SHOW, $GUI_2) WinActivate($GUI_2) Case $GUI_1_exit Exit Case $storehouse GUISetState (@SW_HIDE, $GUI_2) GUISetState(@SW_SHOW, $GUI_storehouse) WinActivate($GUI_storehouse) Switch GUIGetMsg() Case $exit_storehouse If WinActive($GUI_storehouse) Then GUISetState (@SW_HIDE, $GUI_storehouse) GUISetState(@SW_SHOW, $GUI_2) WinActivate($GUI_2) EndIf EndSwitch Case $finish $exit_confirm= MsgBox(4, "Confirm finish", "Print the bill?") Switch $exit_confirm Case $exit_confirm = 6 Exit Case $exit_confirm = 7 Exit EndSwitch Exit EndSwitch WEnd
×
×
  • Create New...