Jump to content

CalculatorMR


AZJIO
 Share

Recommended Posts

  • 8 months later...
  • 2 weeks later...

HERE IS AN UPDATE IT ADDS A TOTAL OF 6 VARIABLES AND PRESSING (ESC) TERMINATES THE PROGRAM.

ALSO PRESSING (ENTER) PERFORMS THE CALCULATION.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\au3.ico
#AutoIt3Wrapper_Outfile=..\..\..\Documents and Settings\Dave1\Desktop\evaluate it.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $a, $b, $C, $X, $Y, $Z

#Region ### START Koda GUI section ### Form=
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Evaluate the Expression", 533, 354, 192, 114)
GUISetBkColor(0xA6CAF0)

$Label1 = GUICtrlCreateLabel("Answer:", 180, 16, 88, 28)
GUICtrlSetFont(-1, 12, 800, 0, "Georgia")



$Label2 = GUICtrlCreateLabel("Enter Expression Here", 112, 100, 244, 27)
GUICtrlSetFont(-1, 12, 800, 0, "Century")



$Input2 = GUICtrlCreateInput("", 72, 288, 106, 24) ; $A
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")

$Input5 = GUICtrlCreateInput("", 72, 320, 106, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")



$Input3 = GUICtrlCreateInput("", 232, 288, 106, 24) ; $B
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")

$Input6 = GUICtrlCreateInput("", 232, 320, 106, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")


$Input4 = GUICtrlCreateInput("", 384, 288, 106, 24) ;$C
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")

$Input7 = GUICtrlCreateInput("", 384, 320, 106, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")


$Label1 = GUICtrlCreateLabel("A =", 32, 288, 34, 28)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")
$Label4 = GUICtrlCreateLabel("X =", 32, 320, 29, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")


$Label2 = GUICtrlCreateLabel("B =", 192, 288, 34, 28)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")
$Label5 = GUICtrlCreateLabel("Y =", 192, 320, 29, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")


$Label3 = GUICtrlCreateLabel("C =", 344, 288, 34, 28)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")
$Label6 = GUICtrlCreateLabel("Z =", 344, 320, 29, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")


$Output = GUICtrlCreateLabel($b, 100, 48, 270, 28)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")
GUICtrlSetBkColor(-1, 0xFFFFFF)



$Input1 = GUICtrlCreateInput("", 10, 145, 500, 28)
GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")



$Button1 = GUICtrlCreateButton("Evaluate", 200, 180, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)

HotKeySet("{ESC}", "Terminate")

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

HotKeySet("{Enter}", "Button1Click")






#EndRegion ### END Koda GUI section ###
While 1
    Sleep(100)
WEnd

Global $a, $Input1, $b1, $b, $C
Func Button1Click()
    $b1 = GUICtrlRead($Input1)
    If $b1 = "END" Then
        Exit
    ElseIf $b1 = "CLR" Then
        $Output = ""
    EndIf

    $a = GUICtrlRead($Input2)
    $b = GUICtrlRead($Input3)
    $C = GUICtrlRead($Input4)
    $X = GUICtrlRead($Input5)
    $Y = GUICtrlRead($Input6)
    $Z = GUICtrlRead($Input7)

    $Output = GUICtrlCreateLabel(Execute($b1), 100, 48, 270, 28)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial Black")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
EndFunc   ;==>Button1Click

post-38053-0-03067000-1304048078_thumb.g

Edited by DaveB
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...