[Autoit] Calcolatrice

« Older   Newer »
  Share  
greywolf92
view post Posted on 28/1/2009, 20:58




Ecco ultimata la mia prima calcolatrice in Autoit:

Source:
SPOILER (click to view)
CODICE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.0.0
Author: GreyWolf92

#ce ----------------------------------------------------------------------------
#include <EzSkin.au3>
#include <Misc.au3>
#include <GUIConstants.au3>

; EzSkinGUICreate( "title" [, width [, height [, left [, top [, style [, ExStyle [, parent [, gui_icon = True [, drag_window = True ]]]]]]]]] )
;        If Left or/and Top = -2 then active Random Position
;        If Style += $SS_RIGHT (Right-aligns the Caption), If Style += $SS_CENTER (Center-aligns the Caption)
EzSkinGuiCreate("Calcolatrice", 480, 220, 364, 389)
; EzSkinSetIconTips( ToolTips = "tip1|tip2|tip3" [, cursorStyle = -1 [, winhandle = "" ]] )
;EzSkinSetIconTips("Example 1|Example 2|Example 3")
       
$Label1 = EzSkin_GUICtrlCreateLabel("Calcolatrice By GreyWolf", 165, 20, 268, 33)
$Input1 = EzSkin_GUICtrlCreateInput("", 24, 48, 49, 21)
$Input2 = EzSkin_GUICtrlCreateInput("", 80, 48, 49, 21)
; EzSkinCreateButton( "text", left, top [, width [, height [, Style [, ExStyle [, Icon = -1 [, File = "shell32.dll" ]]]]]])
; Note: If the parameter ExStyle += $LVS_EX_SNAPTOGRID (0x00080000),
;                you can cross the coordinates limit in the top of the window, imposed by the Menu and the ToolBar buttons.
$addizione = EzSkinCreateButton("Addizione", 24, 80, 105, 25, 0)
$sottrazione = EzSkinCreateButton("Sottrazione", 24, 112, 105, 25, 0)
$moltiplicazione = EzSkinCreateButton("Moltiplicazione", 24, 144, 105, 25, 0)
$divisione = EzSkinCreateButton("Divisione", 24, 176, 107, 25, 0)
$Input3 = EzSkin_GUICtrlCreateInput("", 336, 48, 49, 21)
$Coseno = EzSkinCreateButton("Coseno", 272, 80, 73, 25, 0)
$Seno = EzSkinCreateButton("Seno", 368, 80, 75, 25, 0)
$Quadrato = EzSkinCreateButton("Quadrato", 272, 112, 75, 25, 0)
$Cubo= EzSkinCreateButton("Cubo", 368, 112, 75, 25, 0)
$Radice = EzSkinCreateButton("Radice Quadr.", 272, 144, 75, 25, 0)
$logaritmo = EzSkinCreateButton("Logaritmo", 368, 144, 75, 25, 0)
EzSkinGUISetState(@SW_SHOW)

While 1
 $Msg = EzSkinGuiGetMsg ()

                       ; EzSkinGUItoTray( "title", "text", timeout [, option]) - same as TrayTip
       ;If @extended = 2 Then EzSkinGUItoTray("EzSkinGUItoTray", "Thanks to: Valuater, big_daddy and Joscpe, for this great job!", 10, 1)
                       ; EzSkinRollUpDown( [winhandle] )
       ;If @extended = 3 Then EzSkinRollUpDown()
Switch $msg
Case $addizione
       $raddizione = EzSkinCtrlRead($input1) + EzSkinCtrlRead($input2)
; EzSkinMsgBox( flag, "title", "text" [, timeout [, YoursOwnButtons = "button1|button2|button3" [, left [, top [, AllwaysActive = False ]]]]] )
;                If Left or/and Top = -2 then active Random Position
       EzSkinMsgBox(0,"Addizione","il risultato θ " & $raddizione)
Case $sottrazione
       $rsottrazione = EzSkinCtrlRead($input1) - EzSkinCtrlRead($input2)
       EzSkinMsgBox(0,"Sottrazione","il risultato θ " & $rsottrazione )
Case $moltiplicazione
       $rmoltiplicazione = EzSkinCtrlRead($input1) * EzSkinCtrlRead($input2)
   EzSkinMsgBox(0,"Moltiplicazione","il risultato θ " & $rmoltiplicazione)
Case $divisione
       $rdivisione = EzSkinCtrlRead($input1) / EzSkinCtrlRead($input2)
       EzSkinMsgBox(0,"Divisione","il risultato θ  " & $rdivisione)
Case $coseno
       $pi = 3.14159265358979
       $angolo = $pi / 180
       $rcoseno =  Cos( EzSkinCtrlRead($input3) * $angolo)
       EzSkinMsgBox(0,"coseno", "Il coseno θ " & $rcoseno)
Case $seno
       $pi = 3.14159265358979
       $angolo = $pi / 180
       $rseno =  Sin( EzSkinCtrlRead($input3) * $angolo)
       EzSkinMsgBox(0,"seno", "Il seno θ " & $rseno)
Case $quadrato
       $rquadrato = ( EzSkinCtrlRead($input3))*( EzSkinCtrlRead($input3))
       EzSkinMsgBox(0,"quadrato", "Il quadrato θ " & $rquadrato)
Case $cubo
       $rcubo =  ( EzSkinCtrlRead($input3)) *( EzSkinCtrlRead($input3)) *( EzSkinCtrlRead($input3))
       EzSkinMsgBox(0,"cubo", "Il cubo θ " & $rcubo)        
Case $radice
       $rradice =  Sqrt( EzSkinCtrlRead($input3))  
       EzSkinMsgBox(0,"radice", "La radice Quadrata θ " & $rradice)                
Case $logaritmo
       $rlogaritmo =  Log( EzSkinCtrlRead($input3))
       EzSkinMsgBox(0,"logaritmo", "Il logaritmo θ " & $rlogaritmo)                
Case $GUI_EVENT_CLOSE
        Exit
EndSwitch
Wend

Questa calcolatrice θ anche in grado di calcolare: seno e coseno di un angolo, il quadrato, il cubo, la radice quadrata e il logaritmo di un numero.
Ho aggiunto anche una skin blu usando ezskin.

image

Download qui

Edited by greywolf92 - 29/1/2009, 15:11
 
Top
† bird92 †
view post Posted on 29/1/2009, 00:09




non reisco a farla partire sotto l'emulatore wine su ubuntu... :(
non esiste l'autoit per linux vero? :'(
 
Top
greywolf92
view post Posted on 29/1/2009, 14:32




No non esiste... perς θ strano che non parte sotto wine... ho letto su internet che dovrebbe funzionare
 
Top
† bird92 †
view post Posted on 29/1/2009, 14:42




si infatti... non capisco :(
 
Top
*Kuja*
view post Posted on 29/1/2009, 14:58




bella..bravo complimenti
 
Top
† bird92 †
view post Posted on 29/1/2009, 15:04




almeno metti uno screen :)
 
Top
greywolf92
view post Posted on 29/1/2009, 15:12




Fatto
 
Top
*Kuja*
view post Posted on 31/1/2009, 18:15




grande ottimo adesso funziona
 
Top
*Kuja*
view post Posted on 27/11/2009, 18:59




cmq sisi autoit per linux esiste :P
 
Top
greywolf92
view post Posted on 27/11/2009, 19:09




CITAZIONE
cmq sisi autoit per linux esiste :P

O.o e da quando? Autoit utilizza la gui di Windows non penso proprio che esista per Linux... anzi, non funziona neanche con wine... :P
 
Top
*Kuja*
view post Posted on 27/11/2009, 19:34




bho un mio amico c'θ l'ha per linux :P
 
Top
bub
view post Posted on 27/3/2010, 23:42




non θ che puoi postare il source della libreria EzSkin.au3 mi faresti un favorone, in teoria la trovi in C:\programmi\include\EzSkin.au3
basta che fai edit script, selezioni tutto,copi e incolli qui e schiacci su aggiungi risposta.
 
Top
greywolf92
view post Posted on 28/3/2010, 12:55




Mi dispiace ma non ho piω modo di recuperarlo... prova a mandare un mp a murderess che dovrebbe averlo :)
 
Top
12 replies since 28/1/2009, 20:58   806 views
  Share