Jump to content

GUI beginner attempt, cash register


Recommended Posts

Here is the thesis:

I need like 400 articles, size should be imo a few MB at most.

Each has its code (6 numbers), name, quantity at the store room (that changes as I sell some of them), and that's it.

For example:

Product name: Coca Cola 0,25l

Code: 018719

Quantity: 312 (bottles)

On the first page of this thread, a user kylomas

pasted a script with the database located outside the script, an .ini file. It is the post number #18.

Here's my question: could those values be changed in that file, while the program is running, without the need to tab windows, or use winactivate (xyz.ini), etc.

Because everything I have been doing in Excel, I had to write the script to tab, then winactivate that excel window, then send mouse to certain coordinates or/and type something, and then tab back.

I don't know if I explained good what I meant....

So, the point is to change certain values in that .ini file without even opening that window, when the programm runs.

Tabbing and typing a code to send 342342565 times the mouse somewhere, click 7234051414 times to click something etc, is bad imo....

Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

 

Here's my question: could those values be changed in that file, while the program is running, without the need to tab windows, or use winactivate (xyz.ini), etc.

Yes.  INI files are opened in the 'background'.  They are never opened in a way you can see them.

; This is the INI file we will write to.  It will be created on the Desktop.
Local $sIni = @DesktopDir & "\AutoIt-Test.ini"

; Demonstrate creating a new section using a string as input.
IniWrite($sIni, "Coca Cola", "Code", "018719")
IniWrite($sIni, "Coca Cola", "Quantity", "312")
IniWrite($sIni, "Coca Cola", "QuantityType", "0,25l Bottles")

;or

IniWrite($sIni, "Coca Cola", "Code", "018719")
IniWrite($sIni, "Coca Cola", "Quantity", "312")
IniWrite($sIni, "Coca Cola", "ContainerSize", "0,25l Bottles")

;or

IniWrite($sIni, "Coca Cola 0,25l Bottles", "Code", "018719")
IniWrite($sIni, "Coca Cola 0,25l Bottles", "Quantity", "312")
Edited by NewPlaza
Link to comment
Share on other sites

I see the function IniWrite consists of 4 parameters...
 
Would it be good to name as many as possible as variables, for example, code, quantity, quantity type, price, etc...
 
Could we for example have a script like this, with these as variables:
 
$Coca_Cola, $Code_Coca_Cola, $Quantity_Coca_Cola
 
; This is the INI file we will write to.  It will be created on the Desktop.
Local $sIni = @DesktopDir & "\AutoIt-Test.ini"


; Demonstrate creating a new section using a string as input.
IniWrite($sIni, "$Coca_Cola", "Code" & $Code_Coca_Cola)
IniWrite($sIni, "$Coca_Cola", "Quantity" & $Quantity_Coca_Cola)
IniWrite($sIni, "$Coca_Cola", "QuantityType", $Quantity_Coca_Cola & "0,25l Bottles")
I'm asking because I'm curious as how would I change the quantity of bottles in my storeroom if the "Quantity" is decleared without a "$" if, let's say a truck comes, and brings new 200 bottles, and I must enter it into the computer...
 
Does the .ini file behave like an autoit script? Could for example, a loop be made in the .ini file, so that it is running when the program is running?
Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

An ini file is a text file, it doesn't "run" at all.

Why would you need to include the code type in the key name? You're writing it into the section named by the code type already, they won't overlap as long as the section names are different. I'm not saying you can't, but why would you want to?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

An ini file is a text file, it doesn't "run" at all.

Why would you need to include the code type in the key name? You're writing it into the section named by the code type already, they won't overlap as long as the section names are different. I'm not saying you can't, but why would you want to?

 

Ah I got it now I think... All items can have "code", but as long as the section (item) is different, they wont interfere. 

But shouldn't the code be a variable, because NewPlaza typed this line: 

IniWrite($sIni, "Coca Cola", "Code", "018719")

Let's say, I wanna change the code in that .ini file, when the program is running, from code 018719, to 100001, and I make a GUIButton in the script and everything where I could actually type a new code.

But how would I "call" for that code if it doesn't have a "$" near it, and it's only some constant.

Could it be something like this?

...........
.......
............
........
somewhere in a coca cola GUI:

$replace_code_coca_cola = GUICreateInput ("type your new code here", "", "", "", "")

IniWrite($sIni, "Coca Cola", "Code", $replace_code_coca_cola)
Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

Yes, it will be a variable. At the time I had none.  So, let's make some up.....

; This is the INI file we will write to.  It will be created on the Desktop.
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)

 

Could it be something like this?

........... ....... ............ ........ somewhere in a coca cola GUI:
$replace_code_coca_cola = GUICreateInput ("type your new code here", "", "", "", "")
IniWrite($sIni, "Coca Cola", "Code", $replace_code_coca_cola)

That's correct.. This would be better -> IniWrite($sIni, $Section, "Code", $replace_code_coca_cola)

Edited by NewPlaza
Link to comment
Share on other sites

Yes, that's exactly what I meant !

Now I could really interact GUI and .ini file.

Btw, today I googled about how to make a bill template, and the solution I saw probobly best to be used it to use excel, and it says that a code can be made in an excel document.

BUT.....unless I'm wrong, the code must be written only in Visual Basic, and I don't have a clue about that :(

Anything I'm wrong about it and/or any good news I didn't know?

Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

How to create a name of a GUI button, so that's written in 2 lines or so?

I've been trying, but doesn't work...

Think I'm closest here:

$no_alcohol = GUICtrlCreateButton("Non-alcoholic drinks", 20, 20, 200 & "{ENTER}", 200)

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

Try it using the $BS_MULTILINE style on the button when you create it. I've never used it myself but it seems like it might work.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Ehm, needed this to be centered, probobly there is a shorter way:

$no_alcohol = GUICtrlCreateButton(@CrLf & @CrLf & @CrLf & "Non-alcoholic" & @CrLf & "drinks", 20, 20, 200, 200, $BS_MULTILINE)
;
;
;
;
;
; IMPORTANT: Has 6 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

; 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(@CrLf & @CrLf & @CrLf & "Non-alcoholic" & @CrLf & "drinks", 20, 20, 200, 200, $BS_MULTILINE)
GUICtrlSetFont(-1, 12, 800)
GUICtrlSetBkColor(-1, $colors_green)

$alcohol = GUICtrlCreateButton("Alcoholic drinks", 240, 20, 200 & "{ENTER}", 200)
GUICtrlSetFont(-1, 12, 800)
GUICtrlSetBkColor(-1, $colors_green)



;GUI_3:
$GUI_non_alcoholic= GUICreate("Non-alcoholic drinks", 400, 300, Default, Default) ;==> draws GUI
GUISetBkColor(0x000000)
GUISetFont(14, 400, "", "Cambria")


#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:
$finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80)


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 $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

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

Please take a look at the helpfile on all styles you can apply on the controls (hint: $SS_CENTER).

Br, FireFox.

 

Googled etc, no chance, tried "centerimage", "center", "bitor", everything... Nevermind that, I adapted the script and put names only "Alcohol" and "Non-alcohol".

I'm about to make a GUI and table in it, which shows all wares and their current quantities.

But please, why do I have to click Exit (Izlaz) on the 1. GUI several times, as well as "Warehouse" button?

Is it because of my pc? I have Intel i3.

;
;
;
;
;
; 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>


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, $GUI_2)
GUICtrlSetFont (-1, 16, 800)
GUICtrlSetBkColor (-1, $colors_green)



;GUI_7:
$GUI_storehouse = GUICreate("Storehouse", 1400, 900, Default, Default) ;==> draws GUI
GUISetBkColor(0x000000)
GUISetFont(14, 400, "", "Cambria")


#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:
$finish = GUICtrlCreateButton("Finish", 40, 740, 1720, 80)


Do
    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)
        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
Until GUIGetMsg() = -3

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

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
Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

Btw, there are some examples on the forum.

 

Ok mister, I will google and find sites, since you are too evil to help my problem directly ;)

Edited by CroatianPig

YES, I know I ask facepalm questions.

YES, I know you asked the God why I had to register to the forum where normal people are.

YES, I know everything!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...