broodplank Posted February 17, 2007 Share Posted February 17, 2007 (edited) This udf creates a button that count from whatever you want to 1 and then enables the button (could be useful for trials to let the ppl wait some sec ) Usage: _WaitButton($text, $left, $top, $width, $height, $time) Example: _WaitButton("Try", 5, 5, 60, 20, 10) UDF: ;BY BROODPLANK Func _WaitButton($text, $left, $top, $width, $height, $time) $button = GUICtrlCreateButton($text, $left, $top, $width, $height, $WS_DISABLED) $i = $time + 1 Do $i -= 1 GUICtrlSetData($button, $i, $i) sleep(1000) if $i = 1 then GUICtrlSetData($button, $text) GUICtrlSetStyle($button, "") EndIf Until $i = 1 EndFunc Working Example: #include <Guiconstants.au3> $button = "" GUICreate("WAITBUTTON TEST", 200, 50) GUISetState() GUICtrlCreateLabel("Please wait until you can use this trial", 5, 5) _WaitButton("Try", 5, 25, 60, 20, 10) While 1 $msg = GUIGetMsg() if $msg = $gui_event_close then Exit if $msg = $button then MsgBox(0, "WAITBUTTON", "You can now use this button") WEnd Func _WaitButton($text, $left, $top, $width, $height, $time) $button = GUICtrlCreateButton($text, $left, $top, $width, $height, $WS_DISABLED) $i = $time + 1 Do $i -= 1 GUICtrlSetData($button, $i, $i) sleep(1000) if $i = 1 then GUICtrlSetData($button, $text) GUICtrlSetStyle($button, "") EndIf Until $i = 1 EndFunc Edited February 17, 2007 by broodplank Link to comment Share on other sites More sharing options...
_Kurt Posted February 18, 2007 Share Posted February 18, 2007 Simple, but I suppose this could be useful at some time. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
broodplank Posted February 21, 2007 Author Share Posted February 21, 2007 Simple, but I suppose this could be useful at some time.Kurtty for the feedback ;0 Link to comment Share on other sites More sharing options...
Ed_Maximized Posted February 22, 2007 Share Posted February 22, 2007 I like it!!! Sure I'll use it!!! Ed ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
Busti Posted February 24, 2007 Share Posted February 24, 2007 nice, here some improvement Func _WaitButton($text, $left, $top, $width, $height, $time) $button = GUICtrlCreateButton($text, $left, $top, $width, $height, $WS_DISABLED) GUICtrlSetData($button, $text) GUICtrlSetStyle($button, "") For $i = $time + 1 To 1 Step -1 GUICtrlSetData($button, $i, $i) Sleep(1000) Next EndFunc ;==>_WaitButton My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Thunder-man Posted May 14, 2007 Share Posted May 14, 2007 Hi, the Timer work by me not with autoit-v3.2.4.0 (Only with v3.2.2.0) Can some one test this... THX Link to comment Share on other sites More sharing options...
mrbond007 Posted May 14, 2007 Share Posted May 14, 2007 very usefull thanks Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight Link to comment Share on other sites More sharing options...
James Posted May 14, 2007 Share Posted May 14, 2007 Cool! Nice way of doing some stuff. I had made one of these before but found no use to post it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
poisonkiller Posted May 15, 2007 Share Posted May 15, 2007 Nice UDF, but could you change that Sleep(1000) function, cause it may stop some program actions. Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 That sleep() is there because it equals 1 second. So it will change the number every second Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Thunder-man Posted May 16, 2007 Share Posted May 16, 2007 The WaitButton works by my only on autoit-v3.2.2.0Not on V.autoit-v3.2.4.1autoit-v3.2.4.2Wy this? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now