Jump to content

Hard to explain


Recommended Posts

Well.. I got script like this

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $1
calc(1)

Case $2
calc(2)

Case $3
calc(3)

Case $4
calc(4)

Case $5
calc(5)

Case $6
calc(6)

Case $7
calc(7)

Case $8
calc(8)

Case $9
calc(9)

Case $o
calc('nul')

Case $deel
calc('/')

Case $keer
calc('*')

Case $is
calc('get')

Case $plus
calc('+')

Case $min
calc('-')

Case $c
calc('.')

Case $clear
GUICtrlSetData($som, '' )

EndSwitch
WEnd

I got images as same name as the Case $'s Im wondering can u turn images to those "calc"s. The images r .bmp's.

something like this 1.bmp = calc('1'). Thanks

Link to comment
Share on other sites

func calc($num)
if $num='get' then 
get()
Else
if $num='nul' then
GUICtrlSetData($som, GUICtrlRead($som)&0)
Else
GUICtrlSetData($som, GUICtrlRead($som)&$num)
EndIf

EndIf
EndFunc

Its from calculator, (not made by me)

Here is the whole script:

#Include <ImageSearch.au3>
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Lc", 116, 225, 193, 125)
GUISetBkColor(0xFFFF00)
$1 = GUICtrlCreateButton("1", 8, 40, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$2 = GUICtrlCreateButton("2", 40, 40, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$3 = GUICtrlCreateButton("3", 72, 40, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$4 = GUICtrlCreateButton("4", 8, 72, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$5 = GUICtrlCreateButton("5", 40, 72, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$6 = GUICtrlCreateButton("6", 72, 72, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$7 = GUICtrlCreateButton("7", 8, 104, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$8 = GUICtrlCreateButton("8", 40, 104, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$9 = GUICtrlCreateButton("9", 72, 104, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$o = GUICtrlCreateButton("0", 40, 136, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$min = GUICtrlCreateButton("-", 8, 136, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$plus = GUICtrlCreateButton("+", 72, 136, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$som = GUICtrlCreateInput("", 8, 8, 89, 21)
$clear = GUICtrlCreateButton('c', 97, 8, 20, 20 )
$deel = GUICtrlCreateButton("/", 8, 168, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$keer = GUICtrlCreateButton("x", 40, 168, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$c = GUICtrlCreateButton(",", 72, 168, 27, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
$is = GUICtrlCreateButton("=", 8, 200, 92, 25, 0)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
;GUICtrlSetColor(-1, 0x800000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $1
calc(1)

Case $2
calc(2)

Case $3
calc(3)

Case $4
calc(4)

Case $5
calc(5)

Case $6
calc(6)

Case $7
calc(7)

Case $8
calc(8)

Case $9
calc(9)

Case $o
calc('nul')

Case $deel
calc('/')

Case $keer
calc('*')

Case $is
calc('get')

Case $plus
calc('+')

Case $min
calc('-')

Case $c
calc('.')

Case $clear
GUICtrlSetData($som, '' )

EndSwitch
WEnd

func calc($num)
if $num='get' then 
get()
Else
if $num='nul' then
GUICtrlSetData($som, GUICtrlRead($som)&0)
Else
GUICtrlSetData($som, GUICtrlRead($som)&$num)
EndIf

EndIf
EndFunc

func get()
$p = Execute(GUICtrlRead($som))
if @error then
GUICtrlSetData($som, 'error' )
Else
GUICtrlSetData($som, $p )
Send(GUICtrlRead($som))
EndIf

EndFunc
Edited by bf2forlife
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...