Sign in to follow this  
Followers 0
bf2forlife

Hard to explain

8 posts in this topic

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

Share this post


Link to post
Share on other sites

Sorry, but what is calc() ???

Please post the function. :)

Greetz

Greenhorn

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I don't know the ImageList UDF and what it does, but have you tried

Case $1

calc(1.bmp)

Greetz

Greenhorn

Share this post


Link to post
Share on other sites

nah the

Case $1
calc(1.bmp)

wont work.

Share this post


Link to post
Share on other sites

Any help, please?

Share this post


Link to post
Share on other sites

do you want to create a Calculator ?


Always Keep Your Sig Small... Like me :D

Share this post


Link to post
Share on other sites

No, im trying to edit calculator

Share this post


Link to post
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
Sign in to follow this  
Followers 0