solid2005 Posted May 24, 2008 Posted May 24, 2008 (edited) CODE #include <GUIConstants.au3> #include <File.au3> Opt("GUIOnEventMode",1) ; New GUISetState (1) ; will display an dialog box with 1 checkbox GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered Local $button_1, $button_2, $button_3 $button_1 = GUICtrlCreateButton ("B&utton 1", 30, 250, 120, 40) GUICtrlSetOnEvent(-1,"Buttonclicked") $group_1 = GUICtrlCreateGroup ("Group 1", 10, 10, 50, 205) GUIStartGroup() $Checkbox1 = GUICtrlCreateCheckbox ("C", 20, 50) GUICtrlSetOnEvent(-1,"Check1Clicked_C") GUISetOnEvent($GUI_EVENT_CLOSE,"close") ; New) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Buttonclicked() EndFunc Func Check1Clicked_C() If BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED)=$GUI_CHECKED Then MsgBox(0,"Info","You check c:") EndIf EndFunc Func close () ; New MsgBox(0,"Info","Exiting") Exit EndFunc can you help me about this? autoit don't have example for checkbox with button example: i click c and d checkbox with button. the code will be delete test.txt to c: and d: Edited May 24, 2008 by solid2005
AlmarM Posted May 24, 2008 Posted May 24, 2008 (edited) I dont exacly know what u mean... Can you tell some more? I made this example. Mayby not what you want but... #include <GUIConstants.au3> #include <File.au3> $GUI = GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered $button_1 = GUICtrlCreateButton ("B&utton 1", 30, 250, 120, 40) $group_1 = GUICtrlCreateGroup ("Group 1", 10, 10, 50, 205) $Checkbox1 = GUICtrlCreateCheckbox ("C", 20, 50) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit Case $nMsg = $button_1 $Read = GUICtrlRead($Checkbox1) If ($Read = 1) Then MsgBox(0, "C", "You selected C") EndIf EndSelect WEnd Edited May 24, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
martin Posted May 24, 2008 Posted May 24, 2008 Eg. 1. I Check C and D checkbox = they will delete File in c and d (filename test.txt) 2. I click the button OK C and D will be function. that code i assign to themMaybe this sort of thing expandcollapse popup#include <GUIConstants.au3> #include <File.au3> Opt("GUIOnEventMode", 1); New GUICreate("My GUI radio") Local $button_1, $button_2, $button_3 $button_1 = GUICtrlCreateButton("B&utton 1", 30, 250, 120, 40) GUICtrlSetOnEvent(-1, "Buttonclicked") $group_1 = GUICtrlCreateGroup("Group 1", 10, 10, 50, 205) GUIStartGroup() $Checkbox1 = GUICtrlCreateCheckbox("C", 20, 50) GUICtrlSetOnEvent(-1, "Check1Clicked_C") $Checkbox2 = GUICtrlCreateCheckbox("D", 20, 80) GUISetOnEvent($GUI_EVENT_CLOSE, "close"); New) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Buttonclicked() EndFunc ;==>Buttonclicked If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then DoA() If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) = $GUI_CHECKED Then DoD() Func Check1Clicked_C() If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0, "Info", "You check c:") EndIf EndFunc ;==>Check1Clicked_C Func DoA() ;code.....) EndFunc Func DoD() ;code.... EndFunc Func close(); New MsgBox(0, "Info", "Exiting") Exit EndFunc ;==>close 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.
solid2005 Posted May 24, 2008 Author Posted May 24, 2008 (edited) CODE#include <GUIConstants.au3> #include <File.au3> Opt("GUIOnEventMode", 1); New GUICreate("My GUI radio") Local $button_1, $button_2, $button_3 $button_1 = GUICtrlCreateButton("B&utton 1", 30, 250, 120, 40) GUICtrlSetOnEvent(-1, "Buttonclicked") $group_1 = GUICtrlCreateGroup("Group 1", 10, 10, 50, 205) GUIStartGroup() $Checkbox1 = GUICtrlCreateCheckbox("C", 20, 50) GUICtrlSetOnEvent(-1, "Check1Clicked_C") $Checkbox2 = GUICtrlCreateCheckbox("D", 20, 80) $Delete = FileDelete ( "\TImer Shop.log" ) GUISetOnEvent($GUI_EVENT_CLOSE, "close"); New) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Buttonclicked() If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then DoA() If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) = $GUI_CHECKED Then DoD() EndFunc ;==>Buttonclicked Func Check1Clicked_C() If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0, "Info", "You check c:") EndIf EndFunc ;==>Check1Clicked_C Func DoA() $Delete = FileDelete ( "C:\" ) EndFunc Func DoD() $Delete = FileDelete ( "D:\" ) EndFunc Func close(); New MsgBox(0, "Info", "Exiting") Exit EndFunc ;==>close waaaa all my drive c and d delete like format ?_? Edited May 24, 2008 by solid2005
ProgAndy Posted May 24, 2008 Posted May 24, 2008 O_O If you want do delete one File, you have to specify it ... FileDelete ( "D:\test.txt" ) FileDelete ( "C:\test.txt" ) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
AlmarM Posted May 24, 2008 Posted May 24, 2008 Any shortcut to what exactly? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
solid2005 Posted May 25, 2008 Author Posted May 25, 2008 Nope I Want to use this func $Delete = FileDelete ( "\TImer Shop.log" ) Func DoA() FileDelete ( "C:\$Delete" ) EndFunc Func DoD() FileDelete ( "D:\$Delete" ) EndFunc is this ok!?
ProgAndy Posted May 25, 2008 Posted May 25, 2008 No. You have to make a String Variable and then use it:$Delete = "\TImer Shop.log" Func DoA() FileDelete ( "C:" & $Delete) EndFunc Func DoD() FileDelete ( "D:" & $Delete) EndFunc *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
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