Heroic Posted December 25, 2007 Posted December 25, 2007 (edited) Hello. I am on new project and i was wondering. If someone could possibly make me a script or show me what to do by making GUI_DISABLE become GUI_ENABLE by a check box being ticked (enabled) and disabled when unchecked.?. Thank you. Edited December 25, 2007 by Heroic
star2 Posted December 25, 2007 Posted December 25, 2007 (edited) #include <guiconstants.au3> $main = GUICreate ("main" , 150 , 100) $exit = GUICtrlCreateButton ("Exit" , 10 , 70 ,100,25) $enable = GUICtrlCreateButton ("Enable" , 10 , 10 ,100,25) $disable = GUICtrlCreateButton ("Disable" , 10 , 40 ,100,25) GUISetState () $second = GUICreate ("state gui" , 200 , 80) $m = GUICtrlCreateLabel ("", 20 , 30 , 150,20) GUISetState (@SW_HIDE) While 1 $msg = GUIGetMsg () $a = WinGetPos ($main) Select Case $msg = $exit Exit Case $msg = $enable GUISetState (@SW_SHOW, $second) WinMove ($second,"" , $a[0]-150,$a[1],150,80,1) GUISetState (@SW_ENABLE, $second) GUICtrlSetData ($m , "The Child Gui now is Enabled") Case $msg = $disable GUISetState (@SW_DISABLE, $second) GUICtrlSetData ($m , "The Child Gui now is Enabled") EndSelect WEnd hope this will help but u really should look in the help file and the forum first Edited December 25, 2007 by star2 [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
Heroic Posted December 25, 2007 Author Posted December 25, 2007 star2 said: #include <guiconstants.au3> $main = GUICreate ("main" , 150 , 100) $exit = GUICtrlCreateButton ("Exit" , 10 , 70 ,100,25) $enable = GUICtrlCreateButton ("Enable" , 10 , 10 ,100,25) $disable = GUICtrlCreateButton ("Disable" , 10 , 40 ,100,25) GUISetState () $second = GUICreate ("state gui" , 200 , 80) $m = GUICtrlCreateLabel ("", 20 , 30 , 150,20) GUISetState (@SW_HIDE) While 1 $msg = GUIGetMsg () $a = WinGetPos ($main) Select Case $msg = $exit Exit Case $msg = $enable GUISetState (@SW_SHOW, $second) WinMove ($second,"" , $a[0]-150,$a[1],150,80,1) GUISetState (@SW_ENABLE, $second) GUICtrlSetData ($m , "The Child Gui now is Enabled") Case $msg = $disable GUISetState (@SW_DISABLE, $second) GUICtrlSetData ($m , "The Child Gui now is Enabled") EndSelect WEnd hope this will help but u really should look in the help file and the forum first thanks, but it seems to only work with notepad open. I'll see what i can do with my program by adjusting your code.
star2 Posted December 25, 2007 Posted December 25, 2007 sorry typo but it was edited now it's OK [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
Heroic Posted December 25, 2007 Author Posted December 25, 2007 (edited) Edit: View Below. Edited December 26, 2007 by Heroic
Heroic Posted December 26, 2007 Author Posted December 26, 2007 hi again. i still have a problem with my exists code. What the problem seems to be, whatever i try, i cannot get this button to become disabled when the $easyenable check box is unchecked. expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\SciTE\Koda\Forms\MSN.kxf $body = GUICreate("Simple Status - v.BETA.1.00.2 NORLS", 697, 167, 193, 133) $statuslist = GUICtrlCreateCombo("Default", 8, 8, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_BORDER)) GUICtrlSetData(-1, "Online|Busy|Be right Back|Away|Out to Lunch|In a call|Appear Offline|Sign-Out") GUICtrlSetFont(-1, 8, 400, 0, "Verdana") GUICtrlSetCursor (-1, 0) $easystatus = GUICtrlCreateGroup("'Easy Status'", 8, 40, 385, 97) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $online = GUICtrlCreateButton("Online", 16, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $busy = GUICtrlCreateButton("Busy", 104, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $away = GUICtrlCreateButton("Away", 192, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $brb = GUICtrlCreateButton("Be right Back", 16, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $out = GUICtrlCreateButton("Out to Lunch", 104, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $inacall = GUICtrlCreateButton("In a call", 192, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $appearoff = GUICtrlCreateButton("Appear Offline", 280, 64, 89, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $signout = GUICtrlCreateButton("Sign-Out", 280, 96, 89, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") GUICtrlCreateGroup("", -99, -99, 1, 1) $customstate = GUICtrlCreateInput("Custom Status", 120, 8, 153, 24, BitOR($ES_AUTOHSCROLL,$WS_BORDER)) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $set = GUICtrlCreateButton("Set", 280, 8, 105, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $enableeasy = GUICtrlCreateCheckbox("Enable Easy Status", 400, 112, 153, 25) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $warning = GUICtrlCreateLabel("Reminder: This program is in BETA stage." & @CRLF &"Not all functions are 100% working", 400, 48, 276, 68) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $file = GUICtrlCreateMenu("File") $options = GUICtrlCreateMenu("Options", $file) $about = GUICtrlCreateMenuItem("View 'About'", $options) $closesimple = GUICtrlCreateMenuItem("Close Simple Status", $options) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit If GUICtrlRead($enableeasy) = $GUI_CHECKED Then GUICtrlSetState($signout,$GUI_ENABLE) ElseIf GUICtrlRead($enableeasy) = $GUI_UNCHECKED Then GUICtrlSetState($signout, $GUI_DISABLE) EndIf EndSwitch WEnd sorry for the bump. this is really annoying.
martin Posted December 26, 2007 Posted December 26, 2007 Heroic said: hi again. i still have a problem with my exists code. What the problem seems to be, whatever i try, i cannot get this button to become disabled when the $easyenable check box is unchecked. expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\SciTE\Koda\Forms\MSN.kxf $body = GUICreate("Simple Status - v.BETA.1.00.2 NORLS", 697, 167, 193, 133) $statuslist = GUICtrlCreateCombo("Default", 8, 8, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_BORDER)) GUICtrlSetData(-1, "Online|Busy|Be right Back|Away|Out to Lunch|In a call|Appear Offline|Sign-Out") GUICtrlSetFont(-1, 8, 400, 0, "Verdana") GUICtrlSetCursor (-1, 0) $easystatus = GUICtrlCreateGroup("'Easy Status'", 8, 40, 385, 97) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $online = GUICtrlCreateButton("Online", 16, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $busy = GUICtrlCreateButton("Busy", 104, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $away = GUICtrlCreateButton("Away", 192, 64, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $brb = GUICtrlCreateButton("Be right Back", 16, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $out = GUICtrlCreateButton("Out to Lunch", 104, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $inacall = GUICtrlCreateButton("In a call", 192, 96, 81, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $appearoff = GUICtrlCreateButton("Appear Offline", 280, 64, 89, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $signout = GUICtrlCreateButton("Sign-Out", 280, 96, 89, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") GUICtrlCreateGroup("", -99, -99, 1, 1) $customstate = GUICtrlCreateInput("Custom Status", 120, 8, 153, 24, BitOR($ES_AUTOHSCROLL,$WS_BORDER)) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $set = GUICtrlCreateButton("Set", 280, 8, 105, 25, 0) GUICtrlSetFont(-1, 6, 400, 0, "Verdana") $enableeasy = GUICtrlCreateCheckbox("Enable Easy Status", 400, 112, 153, 25) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $warning = GUICtrlCreateLabel("Reminder: This program is in BETA stage." & @CRLF &"Not all functions are 100% working", 400, 48, 276, 68) GUICtrlSetFont(-1, 8, 400, 0, "Verdana") $file = GUICtrlCreateMenu("File") $options = GUICtrlCreateMenu("Options", $file) $about = GUICtrlCreateMenuItem("View 'About'", $options) $closesimple = GUICtrlCreateMenuItem("Close Simple Status", $options) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit If GUICtrlRead($enableeasy) = $GUI_CHECKED Then GUICtrlSetState($signout,$GUI_ENABLE) ElseIf GUICtrlRead($enableeasy) = $GUI_UNCHECKED Then GUICtrlSetState($signout, $GUI_DISABLE) EndIf EndSwitch WEnd sorry for the bump. this is really annoying. Try this after your Koda bit Global $signoutstate = 0; While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If GUICtrlRead($enableeasy) = $GUI_CHECKED Then if $signoutstate <> $GUI_ENABLE Then GUICtrlSetState($signout,$GUI_ENABLE) $signoutstate = $GUI_ENABLE EndIf ElseIf $signoutstate <> $GUI_DISABLE Then GUICtrlSetState($signout,$GUI_DISABLE) $signoutstate = $GUI_DISABLE EndIf 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.
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