Jump to content



Photo

Checkbox and Input weht it work


  • Please log in to reply
5 replies to this topic

#1 SeaSky

SeaSky

    Seeker

  • New Members
  • 4 posts

Posted 01 May 2012 - 01:13 PM

Hi i went my Script went work Example when i chick on Checkbox1 and chick start write 1 and when i write 3 Sec in Input and chick start write 1 all 3 sec and when chick Stop All Stop
Plain Text         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Test", 423, 139, 731, 405, 0) GUISetBkColor(0x646464) $Checkbox1 = GUICtrlCreateCheckbox("1", 144, 0, 25, 17) $Checkbox2 = GUICtrlCreateCheckbox("2", 280, 0, 25, 17) $Checkbox3 = GUICtrlCreateCheckbox("5", 280, 24, 25, 17) $Checkbox4 = GUICtrlCreateCheckbox("8", 280, 48, 25, 17) $Checkbox5 = GUICtrlCreateCheckbox("3", 0, 24, 25, 17) $Checkbox6 = GUICtrlCreateCheckbox("4", 144, 24, 25, 17) $Checkbox7 = GUICtrlCreateCheckbox("6", 0, 48, 25, 17) $Checkbox8 = GUICtrlCreateCheckbox("7", 144, 48, 25, 17) $Checkbox9 = GUICtrlCreateCheckbox("0", 0, 0, 25, 17) $Checkbox10 = GUICtrlCreateCheckbox("9", 280, 72, 25, 17) $Input2 = GUICtrlCreateInput("", 216, 72, 33, 17) $Time = GUICtrlCreateLabel("Time", 176, 72, 27, 17) $Label1 = GUICtrlCreateLabel("Sec", 256, 72, 23, 17) $Input1 = GUICtrlCreateInput("", 72, 48, 33, 17) $Label2 = GUICtrlCreateLabel("Time", 32, 48, 27, 17) $Label3 = GUICtrlCreateLabel("Sec", 112, 48, 23, 17) $Input3 = GUICtrlCreateInput("", 352, 24, 33, 17) $Label4 = GUICtrlCreateLabel("Time", 312, 24, 27, 17) $Label5 = GUICtrlCreateLabel("Sec", 392, 24, 23, 17) $Input4 = GUICtrlCreateInput("", 216, 48, 33, 17) $Label6 = GUICtrlCreateLabel("Time", 176, 48, 27, 17) $Label7 = GUICtrlCreateLabel("Sec", 256, 48, 23, 17) $Input5 = GUICtrlCreateInput("", 216, 24, 33, 17) $Label8 = GUICtrlCreateLabel("Time", 176, 24, 27, 17) $Label9 = GUICtrlCreateLabel("Sec", 256, 24, 23, 17) $Input6 = GUICtrlCreateInput("", 352, 48, 33, 17) $Label10 = GUICtrlCreateLabel("Time", 312, 48, 27, 17) $Label11 = GUICtrlCreateLabel("Sec", 392, 48, 23, 17) $Input7 = GUICtrlCreateInput("", 352, 0, 33, 17) $Label12 = GUICtrlCreateLabel("Time", 312, 0, 27, 17) $Label13 = GUICtrlCreateLabel("Sec", 392, 0, 23, 17) $Input8 = GUICtrlCreateInput("", 72, 24, 33, 17) $Label14 = GUICtrlCreateLabel("Time", 32, 24, 27, 17) $Label15 = GUICtrlCreateLabel("Sec", 112, 24, 23, 17) $Input9 = GUICtrlCreateInput("", 216, 0, 33, 17) $Label16 = GUICtrlCreateLabel("Time", 176, 0, 27, 17) $Label17 = GUICtrlCreateLabel("Sec", 256, 0, 23, 17) $Input10 = GUICtrlCreateInput("", 72, 0, 33, 17) $Label18 = GUICtrlCreateLabel("Time", 32, 0, 27, 17) $Label19 = GUICtrlCreateLabel("Sec", 112, 0, 23, 17) $Input11 = GUICtrlCreateInput("", 72, 72, 33, 17) $Label20 = GUICtrlCreateLabel("Time", 40, 72, 27, 17) $Label21 = GUICtrlCreateLabel("Sec", 112, 72, 23, 17) $Label22 = GUICtrlCreateLabel("Time", 312, 72, 27, 17) $Input11 = GUICtrlCreateInput("", 352, 72, 33, 17) $Labe23 = GUICtrlCreateLabel("Sec", 392, 72, 23, 17) $Tab = GUICtrlCreateCheckbox("Tab", 0, 72, 41, 17) $Ctrl = GUICtrlCreateCheckbox("Ctrl", 144, 72, 33, 17) $Button1 = GUICtrlCreateButton("Start", 0, 96, 27, 17) $Button2 = GUICtrlCreateButton("Exit", 64, 96, 27, 17) $Button3 = GUICtrlCreateButton("Stop", 32, 96, 27, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd

Thanks ;)







#2 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,199 posts

Posted 01 May 2012 - 06:15 PM

i went my Script went work Example when i chick on Checkbox1 and chick start write 1 and when i write 3 Sec in Input and chick start write 1 all 3 sec and when chick Stop All Stop


which bit is causing you a problem? To respond to the start button you need to look in the help for GuiCtrlCreateButton, then to read the state of a checkbox and to read the contents on an input you need to look up GuiCtrlRead.
To get someone to write it all for you you need to look up praying for divine intervention.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#3 SeaSky

SeaSky

    Seeker

  • New Members
  • 4 posts

Posted 01 May 2012 - 06:33 PM

which bit is causing you a problem? To respond to the start button you need to look in the help for GuiCtrlCreateButton, then to read the state of a checkbox and to read the contents on an input you need to look up GuiCtrlRead.
To get someone to write it all for you you need to look up praying for divine intervention.

yes i know it now and i make Checkbox work when i add

While 1 $msg = GUIGetMsg() Select   Case $msg = $Button1         $send1 = GUICtrlRead($1)        While 1     Send($send1)      WEnd     Case $msg = $GUI_EVENT_CLOSE    GUIDelete()    ExitLoop EndSelect   WEnd

but i don't know how make Time Work and Stop work so i need help Only in Time and Stop Button i will Try to so i know i will not get many help

#4 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,199 posts

Posted 01 May 2012 - 08:17 PM

OK, I think I understand.

When you click the button you have

while 1   send($send)


but you want that to stop the Send when the time in input11 has elepsed. Then there are several ways you could do that but here is one.

$period = Number(GuiCtrlRead($Input11)) ;asume time is in seconds $started = Timerinit while TimerDiff($started) < $period * 1000   send($send) wend

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#5 SeaSky

SeaSky

    Seeker

  • New Members
  • 4 posts

Posted 01 May 2012 - 09:55 PM

OK, I think I understand.

When you click the button you have

while 1   send($send)


but you want that to stop the Send when the time in input11 has elepsed. Then there are several ways you could do that but here is one.

$period = Number(GuiCtrlRead($Input11)) ;asume time is in seconds $started = Timerinit while TimerDiff($started) < $period * 1000   send($send) wend

thanks but see

$started = Timerinit
$started = Timerinit^ ERROR

#6 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,563 posts

Posted 01 May 2012 - 10:01 PM

that was just a typo.
it should have been TimerInit() as you would have easily discovered by looking in the help file.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users