CODICE
#comments-start
Programmata da: Andrea Trupia Alias antru
#comments-end
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Calcolatrice", 295, 235, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 8, 217, 21)
$CE = GUICtrlCreateButton("CE", 232, 0, 49, 41, 0)
$1=GUICtrlCreateButton("1", 8, 48, 57, 41, 0)
$2=GUICtrlCreateButton("2", 72, 48, 57, 41, 0)
$3=GUICtrlCreateButton("3", 136, 48, 57, 41, 0)
$4=GUICtrlCreateButton("4", 8, 96, 57, 41, 0)
$5=GUICtrlCreateButton("5", 72, 96, 57, 41, 0)
$6=GUICtrlCreateButton("6", 136, 96, 57, 41, 0)
$7=GUICtrlCreateButton("7", 8, 144, 57, 41, 0)
$8=GUICtrlCreateButton("8", 72, 144, 57, 41, 0)
$9=GUICtrlCreateButton("9", 136, 144, 57, 41, 0)
$0=GUICtrlCreateButton("0", 8, 192, 57, 41, 0)
$virgola=GUICtrlCreateButton(".", 72, 192, 57, 41, 0)
$uguale=GUICtrlCreateButton("=", 136, 192, 57, 41, 0)
$piu=GUICtrlCreateButton("+", 224, 48, 57, 41, 0)
$meno=GUICtrlCreateButton("-", 224, 96, 57, 41, 0)
$per=GUICtrlCreateButton("x", 224, 144, 57, 41, 0)
$diviso=GUICtrlCreateButton("/", 224, 192, 57, 41, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
$leggi = GUICtrlRead ($Input1)
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $1
GUICtrlSetData ($Input1, $leggi&"1")
Case $2
GUICtrlSetData ($Input1, $leggi&"2")
Case $3
GUICtrlSetData ($Input1, $leggi&"3")
Case $4
GUICtrlSetData ($Input1, $leggi&"4")
Case $5
GUICtrlSetData ($Input1, $leggi&"5")
Case $6
GUICtrlSetData ($Input1, $leggi&"6")
Case $7
GUICtrlSetData ($Input1, $leggi&"7")
Case $8
GUICtrlSetData ($Input1, $leggi&"8")
Case $9
GUICtrlSetData ($Input1, $leggi&"9")
Case $0
GUICtrlSetData ($Input1, $leggi&"0")
Case $virgola
GUICtrlSetData ($Input1, $leggi&".")
Case $uguale
$esegui=Execute($leggi)
GUICtrlSetData ($Input1, $esegui)
If $leggi = "" Then
MsgBox(48,"ATTENZIONE","immetti il primo efficiente,l'operatore logico ed il secondo coefficente")
EndIf
Case $diviso
GUICtrlSetData($Input1,$leggi&"/")
If $leggi = "" Then
MsgBox(48,"ATTENZIONE","immetti il primo esponente prima dell'operatore logco")
EndIf
Case $piu
GUICtrlSetData ($Input1, $leggi&"+")
If $leggi = "" Then
MsgBox(48,"ATTENZIONE","immetti il primo esponente prima dell'operatore logco")
EndIf
Case $meno
GUICtrlSetData ($Input1, $leggi&"-")
If $leggi = "" Then
MsgBox(48,"ATTENZIONE","immetti il primo esponente prima dell'operatore logco")
EndIf
Case $per
GUICtrlSetData ($Input1, $leggi&"*")
If $leggi = "" Then
MsgBox (48, "ATTENZIONE", "Immetti il primo efficiente, l'operatore logico ed il secondo coefficiente!")
EndIf
Case $diviso
GUICtrlSetData ($Input1, $leggi&"/")
Case $CE
GUICtrlSetData($Input1,"")
EndSwitch
WEnd