Jump to content
Sign in to follow this  
bills

Can't set a new value through GUICtrlCreateInput

Recommended Posts

bills

Hi guys

Im trying to set a new timevalue for $time here but when i change the value i get "25"?

Can anyone see what i have done wrong?

$time = "15000"

Opt("GUIOnEventMode",1)
GUICreate("Välj sajter och länder", 400, 200)

$o_bedbox1 = GUICtrlCreateCheckbox("Login Bedroom?", 10, 10)

$o_checkbox1 = GUICtrlCreateCheckbox("Österrike", 10, 30)
$o_checkbox2 = GUICtrlCreateCheckbox("Finland", 90, 30)
$o_checkbox3 = GUICtrlCreateCheckbox("Holland", 170, 30)
$o_checkbox4 = GUICtrlCreateCheckbox("Norge", 250, 30)
$o_checkbox5 = GUICtrlCreateCheckbox("Polen", 330, 30)
$o_checkbox6 = GUICtrlCreateCheckbox("Spanien", 10, 50)
$o_checkbox7 = GUICtrlCreateCheckbox("Sverige", 90, 50)
$o_checkbox8 = GUICtrlCreateCheckbox("Sweiz", 170, 50)
$o_checkbox9 = GUICtrlCreateCheckbox("Storbritanien", 250, 50)

$o_bedbox2 = GUICtrlCreateCheckbox("Login Bedroom_Sev?", 10, 80)

$o_checkbox10 = GUICtrlCreateCheckbox("Finland", 10, 100)
$o_checkbox11 = GUICtrlCreateCheckbox("Norge", 90, 100)
$o_checkbox12 = GUICtrlCreateCheckbox("Polen", 170, 100)
$o_checkbox13 = GUICtrlCreateCheckbox("Spanien", 250, 100)
$o_checkbox14 = GUICtrlCreateCheckbox("Sverige", 330, 100)

$o_bedbox3 = GUICtrlCreateCheckbox("Login Bedroom_Vint?", 10, 130)

$o_checkbox15 = GUICtrlCreateCheckbox("Finland", 10, 150)
$o_checkbox16 = GUICtrlCreateCheckbox("Norge", 90, 150)
$o_checkbox17 = GUICtrlCreateCheckbox("Spanien", 170, 150)
$o_checkbox18 = GUICtrlCreateCheckbox("Sverige", 250, 150)

GUICtrlCreateLabel("Hur lång tid vill du visa varje sida? Ange millisek, dvs 15000 = 15 sek", 10, 180)
$timeinput = GUICtrlCreateInput("", 335, 175, 36)

$button1=GUICtrlCreateButton("OK", 373, 173, 25)
GUICtrLSetOnEvent($button1,"OK")

GUISetOnEvent($GUI_EVENT_CLOSE,"Quit")
GUISetState()

Func OK()
    $time = $timeinput
EndFunc

Func Quit()
    WinClose("Cellsynt")
    Exit
EndFunc

While 1
    If Not WinActive("Välj sajter och länder") Then
        ExitLoop
    EndIf
WEnd

MsgBox(0,"Information","Vald visningstid:" & $time, 5)

Also how do i set it to minimize when the button "OK" is clicked?

//Bill

Edited by bills

Share this post


Link to post
Share on other sites
bills

Global Const $WM_SYSCOMMAND = 0x0112
Global Const $SC_MINIMIZE = 0xF020

$gui = GUICreate("Välj sajter och länder", 400, 200)
...
SendMessage($gui, $WM_SYSCOMMAND, $SC_MINIMIZE, 0)
...
$time = GUICtrlRead($timeinput)
Im getting an error from the SendMessage part:

==> Unknown function name.:

SendMessage($gui, $WM_SYSCOMMAND, $SC_MINIMIZE, 0)

^ ERROR

But the timepart work! :) Thanks

EDIT:

Was missing the _ in _SendMessage :)

Thanks works great! :)

Edited by bills

Share this post


Link to post
Share on other sites
gamepin126

Might wanna check out WinSetState()

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  

×