Jump to content
Son zamanlarda artan kullanıcı hesap hırsızlıkları sebebiyle tüm kullanıcılara şifre sıfırlama maili gönderilmiştir. Lütfen güveli şifreler seçiniz. Mevcut e-mail adresinize erişemiyorsanız, en aşağıdaki destek linkinden bize ulaşınız. ×

Autoitde Hesap Makinası Çalışmam


johncher
 Share

Recommended Posts

[codebox]
$Form1 = GUICreate("Form1", 194, 220, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 26, 177, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Input2 = GUICtrlCreateInput("", 9, 56, 177, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
;$Input3 = GUICtrlCreateInput("", 9, 556, 177, 24)

$Button1 = GUICtrlCreateButton("+", 114, 82, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("-", 114, 115, 34, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("*", 114, 148, 34, 31)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("/", 114, 179, 34, 31)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton("1", 7, 82, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button6 = GUICtrlCreateButton("2", 42, 82, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button7 = GUICtrlCreateButton("3", 77, 82, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button8 = GUICtrlCreateButton("4", 7, 115, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button9 = GUICtrlCreateButton("5", 42, 115, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button10 = GUICtrlCreateButton("6", 77, 115, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button11 = GUICtrlCreateButton("7", 7, 147, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button12 = GUICtrlCreateButton("8", 42, 147, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button13 = GUICtrlCreateButton("9", 77, 147, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button14 = GUICtrlCreateButton("0", 7, 179, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button15 = GUICtrlCreateButton("00", 42, 179, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button16 = GUICtrlCreateButton("000", 76, 179, 34, 32)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button17 = GUICtrlCreateButton("C", 150, 83, 34, 96)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button18 = GUICtrlCreateButton("C", 150, 179, 34, 31)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$coder_by_mistik = GUICtrlCreateLabel("coder_by_mistik", 91, 3, 95, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUISetState(@SW_SHOW)


GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit

Case $Button5
$s=1
bas()
Case $Button6
$s=2
bas()
Case $Button7
$s=3
bas()
Case $Button8
$s=4
bas()
Case $Button9
$s=5
bas()
Case $Button10
$s=6
bas()
Case $Button11
$s=7
bas()
Case $Button12
$s=8
bas()
Case $Button13
$s=9
bas()
Case $Button14
$s=0
bas()
Case $Button15
$s=0
bas()
bas()
Case $Button16
$s=0
bas()
bas()
bas()


case $Button17
GUICtrlSetData($Input2, "")
GUICtrlSetData($Input1, "")
case $Button18
GUICtrlSetData($Input2, "")
GUICtrlSetData($Input1, "")
Case $Button1
$t=1
islem()
Case $Button2
$t=2
islem()
Case $Button3
$t=3
islem()
Case $Button4
$t=4
islem()


EndSwitch
WEnd

func islem()
$sn2 = GUICtrlRead($Input2)
$sn1 = GUICtrlRead($Input1)
if $sn1="" Then
Else
GUICtrlSetData($Input2, $sn1)
GUICtrlSetData($Input1, "")

if $sn2="" Then
Else
if $t=1 then $s =$sn2 + $sn1
if $t=2 then $s =$sn2 - $sn1
if $t=3 then $s =$sn2 * $sn1
if $t=4 then $s =$sn2 / $sn1
GUICtrlSetData($Input2, $s)
EndIf
EndIf

EndFunc

func bas()
if GUICtrlRead($Input1)="" Then
GUICtrlSetData($Input1, $s)
Else
$i1=GUICtrlRead($Input1)
GUICtrlSetData($Input1, $i1&$s)
EndIf
EndFunc
[/codebox]

çok iyi bir ornek diyemem ama bu kadar yapabildim. Hatasız çalışıyor. saygılar Edited by johncher
Link to comment
Share on other sites

Buyrun Arkadaşlar Buda Benim Hesap Makinem :)
BlueLife bu nasıl olmuş ?



[code] #NoTrayIcon

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=e:\program files\autoit3\scite\koda\forms\form1.kxf
$Form1_1 = GUICreate("Hesap Makinesi", 222, 305, 192, 128)
GUISetBkColor(0x800080)
$islem1 = GUICtrlCreateLabel("- - - - - - - - - - - - ", 32, 16, 150, 17)
GUICtrlSetLimit($islem1,14,0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$islem2 = GUICtrlCreateLabel("- - - - - - - - - - - - ", 32, 40, 153, 17,$ES_LEFT)
GUICtrlSetLimit($islem2,14,0)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$islem = GUICtrlCreateLabel("+", 8, 56, 10, 17)
GUICtrlSetColor(-1, 0x808080)
$___ = GUICtrlCreateLabel("_____________________", 24, 51, 130, 17)
GUICtrlSetColor(-1, 0x00FF00)
$C = GUICtrlCreateButton("C", 152, 136, 59, 25, $WS_GROUP)
$CE = GUICtrlCreateButton("CE", 88, 136, 59, 25, $WS_GROUP)
$sil = GUICtrlCreateButton("Geri ( Sil )", 8, 136, 75, 25, $WS_GROUP)
$MC = GUICtrlCreateButton("-1", 8, 176, 43, 25, $WS_GROUP)
$MR = GUICtrlCreateButton("MR", 8, 208, 43, 25, $WS_GROUP)
$MS = GUICtrlCreateButton("MS", 8, 240, 43, 25, $WS_GROUP)
$Marti = GUICtrlCreateButton("M+", 8, 272, 43, 25, $WS_GROUP)
$1 = GUICtrlCreateButton("1", 56, 240, 35, 25, $WS_GROUP)
$2 = GUICtrlCreateButton("2", 96, 240, 35, 25, $WS_GROUP)
$3 = GUICtrlCreateButton("3", 136, 240, 35, 25, $WS_GROUP)
$4 = GUICtrlCreateButton("4", 56, 208, 35, 25, $WS_GROUP)
$5 = GUICtrlCreateButton("5", 96, 208, 35, 25, $WS_GROUP)
$6 = GUICtrlCreateButton("6", 136, 208, 35, 25, $WS_GROUP)
$7 = GUICtrlCreateButton("7", 56, 176, 35, 25, $WS_GROUP)
$8 = GUICtrlCreateButton("8", 96, 176, 35, 25, $WS_GROUP)
$9 = GUICtrlCreateButton("9", 136, 176, 35, 25, $WS_GROUP)
$bool = GUICtrlCreateButton("/", 176, 176, 35, 25, $WS_GROUP)
$carp = GUICtrlCreateButton("*", 176, 208, 35, 25, $WS_GROUP)
$cikart = GUICtrlCreateButton("-", 176, 240, 35, 25, $WS_GROUP)
$0 = GUICtrlCreateButton("0", 56, 272, 35, 25, $WS_GROUP)
$topla = GUICtrlCreateButton("+", 96, 272, 35, 25, $WS_GROUP)
$virgul = GUICtrlCreateButton(",", 136, 272, 35, 25, $WS_GROUP)
$esittir = GUICtrlCreateButton("=", 176, 270, 35, 25, $WS_GROUP)
$esittirLabel5 = GUICtrlCreateLabel("=", 8, 72, 11, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$sonuc = GUICtrlCreateLabel("- - - - - - - - - - - - ",32, 72, 150, 17)
GUICtrlSetLimit($sonuc,14,0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Input = GUICtrlCreateInput("", 8, 96, 201, 21, BitOR($ES_RIGHT,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit($Input,14,0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)

Dim $Form1_1_AccelTable[13][2] = [["1", $1],["2", $2],["3", $3],["4", $4],["5", $5],["6", $6],["7", $7],["8", $8],["9", $9],["0", $0],["+",$topla],[",",$virgul],["Delete",$CE]]
GUISetAccelerators($Form1_1_AccelTable)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $1
GUICtrlSetData($Input,"1",$ES_RIGHT)

Case $2
GUICtrlSetData($Input,"2",$ES_RIGHT)

Case $3
GUICtrlSetData($Input,"3",$ES_RIGHT)

Case $4
GUICtrlSetData($Input,"4",$ES_RIGHT)

Case $5
GUICtrlSetData($Input,"5",$ES_RIGHT)

Case $6
GUICtrlSetData($Input,"6",$ES_RIGHT)

Case $7
GUICtrlSetData($Input,"7",$ES_RIGHT)

Case $8
GUICtrlSetData($Input,"8",$ES_RIGHT)

Case $9
GUICtrlSetData($Input,"9",$ES_RIGHT)

Case $0
GUICtrlSetData($Input,"0",$ES_RIGHT)

Case $sil
GUICtrlSetData($Input,"")
Case $CE
GUICtrlSetData($Input,"")
GUICtrlSetData($islem1,"- - - - - - - - - - - - ")
GUICtrlSetData($islem2,"- - - - - - - - - - - - ")
GUICtrlSetData($sonuc,"- - - - - - - - - - - - ")
Case $C
GUICtrlSetData($Input,"")
Case $topla
GUICtrlSetData($islem,"+")
GUICtrlSetData($islem1,GUICtrlRead($Input))
GUICtrlSetData($Input,"")

Case $cikart
GUICtrlSetData($islem,"-")
GUICtrlSetData($islem1,GUICtrlRead($Input))
GUICtrlSetData($Input,"")

Case $carp
GUICtrlSetData($islem,"*")
GUICtrlSetData($islem1,GUICtrlRead($Input))
GUICtrlSetData($Input,"")

Case $bool
GUICtrlSetData($islem,"/")
GUICtrlSetData($islem1,GUICtrlRead($Input))
GUICtrlSetData($Input,"")


Case $esittir

If GUICtrlRead($islem) = "+" Then
GUICtrlSetData($islem2,GUICtrlRead($Input))
GUICtrlSetData($sonuc,GUICtrlRead($islem1)+GUICtrlRead($islem2))
GUICtrlSetData($Input,"")
ElseIf GUICtrlRead($islem) = "-" Then
GUICtrlSetData($islem2,GUICtrlRead($Input))
GUICtrlSetData($sonuc,GUICtrlRead($islem1)-GUICtrlRead($islem2))
GUICtrlSetData($Input,"")
ElseIf GUICtrlRead($islem) = "*" Then
GUICtrlSetData($islem2,GUICtrlRead($Input))
GUICtrlSetData($sonuc,GUICtrlRead($islem1)*GUICtrlRead($islem2))
GUICtrlSetData($Input,"")
ElseIf GUICtrlRead($islem) = "/" Then
GUICtrlSetData($islem2,GUICtrlRead($Input))
GUICtrlSetData($sonuc,GUICtrlRead($islem1)/GUICtrlRead($islem2))
GUICtrlSetData($Input,"")
EndIf

Case $virgul
GUICtrlSetData($Input,",",$ES_RIGHT)
If GUICtrlRead($Input) = ",," Then
MsgBox(0,"Uyarı","Bir işlemde en fazla 1 karakter kullanılabilir.")
GUICtrlSetData($Input,",")
EndIf

EndSwitch
WEnd
Func CiFTEVRGL () ; Herzaman Kontrol Et :)
If GUICtrlRead($Input) = ",," Then
MsgBox(0,"Uyarı","Bir işlemde en fazla 1 karakter kullanılabilir.")
GUICtrlSetData($Input,",")
EndIf
EndFunc
Func Error()
If @error = 1 Then MsgBox(0,"HATA","Bir Hata Oluştu")
If @error > 0 Then MsgBox(0,"HATA","Bir Hata Oluştu")
If @error = 0 Then MsgBox(0,"HATA","Bir Hata Oluşmadı :) Sevin :))")
EndFunc[/code]

Link to comment
Share on other sites

@asmazh

Arayüz güzel, lakin ben toplama yapamadım :)
1 + 2 yapacaktım. + ya basınca kutudaki siliniyor...

Edit: Yukarıda yazıyormuş :)
Genelde kutudan okumaya alışmısız. Yukarıdaki yazıda tam belirgin olmadığından gözümden kaçmış!
Sonuç olarak fazla incelemesemde güzel olmuş :good:

Edited by blue_life
Link to comment
Share on other sites

İşlem Yapılırken

ÖRNEĞİN : 1 + 3 yapmak istiyoruz öncelikle "1" e basıyoruz sonra "+" ya basıyoruz 1 "input" dan siliniyor "label1" e alınıyor sonra 2. rakamımızı yani "3" ü yazıyoruz ve eşittire basıyoruz. Bundan ibaret... :)
Bİ GÖZ ATTIĞINIZ İÇİN TEŞEKKÜR EDERİM.

Link to comment
Share on other sites

[quote name='blue_life' date='11 March 2011 - 13:35 ' timestamp='1299851138' post='978227']
Güzel :good: Böyle çalışmalar yaptıkça zamanla ister istemez kendini geliştirirsin.
Bu arada eşittir nerde?
[/quote]

ustam toplama işlemi sonusu icin + çıkarma için - gibi hangi işlemse ona basınca sonucu veriyor

= ayrıca dusundum ama toplamaya basınca onu secip eşittire basınca o işlemi yapmalı ama onu nasıl yapabilecegimi kafamı toparlayıp ortaya koyamadım :)

Link to comment
Share on other sites

[quote name='blue_life' date='11 March 2011 - 13:35 ' timestamp='1299851138' post='978227']
Güzel :good: Böyle çalışmalar yaptıkça zamanla ister istemez kendini geliştirirsin.
Bu arada eşittir nerde?
[/quote]

ustam toplama işlemi sonusu icin + çıkarma için - gibi hangi işlemse ona basınca sonucu veriyor

= ayrıca dusundum ama toplamaya basınca onu secip eşittire basınca o işlemi yapmalı ama onu nasıl yapabilecegimi kafamı toparlayıp ortaya koyamadım :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...