Sign in to follow this  
Followers 0
computergroove

GUICtrlSetData question

5 posts in this topic

#1 ·  Posted (edited)

 This isnt working. When I add a value to $Input Box11 I want to push $SetAll and have the value get set to all the other input boxes. Then I want $Input11 to get reset to blank.  What am I doing wrong?

$Form1 = GUICreate("AVC", 377, 280, 192, 114,0,$WS_EX_TOPMOST)
$Input1 = GUICtrlCreateInput("0", 24, 40, 49, 21)
$Input2 = GUICtrlCreateInput("0", 24, 72, 49, 21)
$Input3 = GUICtrlCreateInput("0", 24, 104, 49, 21)
$Input4 = GUICtrlCreateInput("0", 24, 136, 49, 21)
$Input5 = GUICtrlCreateInput("0", 24, 168, 49, 21)
$Input6 = GUICtrlCreateInput("0", 240, 40, 49, 21)
$Input7 = GUICtrlCreateInput("0", 240, 72, 49, 21)
$Input8 = GUICtrlCreateInput("0", 240, 104, 49, 21)
$Input9 = GUICtrlCreateInput("0", 240, 136, 49, 21)
$Input10 = GUICtrlCreateInput("0", 240, 168, 49, 21)
$Input11 = GUICtrlCreateInput("", 240, 200, 49,21)
$Pause = GUICtrlCreateButton("Pause", 24, 216, 97, 25)
$SetAll = GUICtrlCreateButton("Set All", 180, 200, 50, 24)

While 1
    ClickStuff()
    $nMsg = GUIGetMsg()

    Switch $nMsg

        Case $Pause
            $Paused = Not $Paused
            If $Paused Then
                ToolTip('Paused', 0, 0)
                GUICtrlSetData($Pause, "Unpause")
            Else
                 ToolTip("")
                 GUICtrlSetData($Pause, "Pause")
            EndIf

        Case $SetAll
                $Data = GUICtrlRead($Input11)
                GUICtrlSetData($Input1,$Data)
                GUICtrlSetData($Input2,$Data)
                GUICtrlSetData($Input3,$Data)
                GUICtrlSetData($Input4,$Data)
                GUICtrlSetData($Input5,$Data)
                GUICtrlSetData($Input6,$Data)
                GUICtrlSetData($Input7,$Data)
                GUICtrlSetData($Input8,$Data)
                GUICtrlSetData($Input9,$Data)
                GUICtrlSetData($Input10,$Data)
                GUICtrlSetData($Input11,"")

        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

EDIT - When I add MsgBox("","",$Data) after the $Data = GUICtrlRead($Input11) and it doesn't pull up a msgbox when I hit the button.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It seems to work (exept your code is unusable)... What is ClickStuff() ?

$Form1 = GUICreate("AVC", 377, 280, 192, 114,0)
$Input1 = GUICtrlCreateInput("0", 24, 40, 49, 21)
$Input2 = GUICtrlCreateInput("0", 24, 72, 49, 21)
$Input3 = GUICtrlCreateInput("0", 24, 104, 49, 21)
$Input4 = GUICtrlCreateInput("0", 24, 136, 49, 21)
$Input5 = GUICtrlCreateInput("0", 24, 168, 49, 21)
$Input6 = GUICtrlCreateInput("0", 240, 40, 49, 21)
$Input7 = GUICtrlCreateInput("0", 240, 72, 49, 21)
$Input8 = GUICtrlCreateInput("0", 240, 104, 49, 21)
$Input9 = GUICtrlCreateInput("0", 240, 136, 49, 21)
$Input10 = GUICtrlCreateInput("0", 240, 168, 49, 21)
$Input11 = GUICtrlCreateInput("", 240, 200, 49,21)
$Pause = GUICtrlCreateButton("Pause", 24, 216, 97, 25)
$SetAll = GUICtrlCreateButton("Set All", 180, 200, 50, 24)

GUISetState()

While 1
    $nMsg = GUIGetMsg()

    Switch $nMsg

        Case $Pause
            $Paused = Not $Paused
            If $Paused Then
                ToolTip('Paused', 0, 0)
                GUICtrlSetData($Pause, "Unpause")
            Else
                 ToolTip("")
                 GUICtrlSetData($Pause, "Pause")
            EndIf

        Case $SetAll
                $Data = GUICtrlRead($Input11)
                GUICtrlSetData($Input1,$Data)
                GUICtrlSetData($Input2,$Data)
                GUICtrlSetData($Input3,$Data)
                GUICtrlSetData($Input4,$Data)
                GUICtrlSetData($Input5,$Data)
                GUICtrlSetData($Input6,$Data)
                GUICtrlSetData($Input7,$Data)
                GUICtrlSetData($Input8,$Data)
                GUICtrlSetData($Input9,$Data)
                GUICtrlSetData($Input10,$Data)
                GUICtrlSetData($Input11,"")

        Case -3
            Exit
    EndSwitch
WEnd
Edited by jguinch

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

 

It seems to work (exept your code is unusable)... What is ClickStuff() ?

$Form1 = GUICreate("AVC", 377, 280, 192, 114,0)
$Input1 = GUICtrlCreateInput("0", 24, 40, 49, 21)
$Input2 = GUICtrlCreateInput("0", 24, 72, 49, 21)
$Input3 = GUICtrlCreateInput("0", 24, 104, 49, 21)
$Input4 = GUICtrlCreateInput("0", 24, 136, 49, 21)
$Input5 = GUICtrlCreateInput("0", 24, 168, 49, 21)
$Input6 = GUICtrlCreateInput("0", 240, 40, 49, 21)
$Input7 = GUICtrlCreateInput("0", 240, 72, 49, 21)
$Input8 = GUICtrlCreateInput("0", 240, 104, 49, 21)
$Input9 = GUICtrlCreateInput("0", 240, 136, 49, 21)
$Input10 = GUICtrlCreateInput("0", 240, 168, 49, 21)
$Input11 = GUICtrlCreateInput("", 240, 200, 49,21)
$Pause = GUICtrlCreateButton("Pause", 24, 216, 97, 25)
$SetAll = GUICtrlCreateButton("Set All", 180, 200, 50, 24)

GUISetState()

While 1
    $nMsg = GUIGetMsg()

    Switch $nMsg

        Case $Pause
            $Paused = Not $Paused
            If $Paused Then
                ToolTip('Paused', 0, 0)
                GUICtrlSetData($Pause, "Unpause")
            Else
                 ToolTip("")
                 GUICtrlSetData($Pause, "Pause")
            EndIf

        Case $SetAll
                $Data = GUICtrlRead($Input11)
                GUICtrlSetData($Input1,$Data)
                GUICtrlSetData($Input2,$Data)
                GUICtrlSetData($Input3,$Data)
                GUICtrlSetData($Input4,$Data)
                GUICtrlSetData($Input5,$Data)
                GUICtrlSetData($Input6,$Data)
                GUICtrlSetData($Input7,$Data)
                GUICtrlSetData($Input8,$Data)
                GUICtrlSetData($Input9,$Data)
                GUICtrlSetData($Input10,$Data)
                GUICtrlSetData($Input11,"")

        Case -3
            Exit
    EndSwitch
WEnd

Just a label I added to mask my script. Like I said it isn't working for me. When I click the button nothing happens.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Can you run it locally? Does it work or does it just look like it works?

Edit - It works when I disable ClickStuff(). Something in that function is making it not work. Thanks.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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