star2 Posted May 13, 2007 Posted May 13, 2007 as you can see from the pic I've put any time I use the [ IF ] for enabling / disabling ctrls this flickering happens is there any way to work it out?#include <Constants.au3> #include <GUIConstants.au3> GUICreate ("TEST", 300,110) $read_one = GUICtrlCreateInput ("",10,10,270,25) $put_1 = GUICtrlCreateInput ("",10,40,270,25) $put_3 = GUICtrlCreateInput ("",10,75,270,25) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead ($read_one) <> "" Then GUICtrlSetState ($put_1,$GUI_ENABLE) GUICtrlSetState ($put_3,$GUI_ENABLE) Else GUICtrlSetState ($put_1,$GUI_DISABLE) GUICtrlSetState ($put_3,$GUI_DISABLE) EndIf WEnd [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]
Rick Posted May 13, 2007 Posted May 13, 2007 (edited) You need another another switch...... theres probably lots of ways of doing it, but heres one.... #include <Constants.au3> #include <GUIConstants.au3> GUICreate ("TEST", 300,110) $read_one = GUICtrlCreateInput ("",10,10,270,25) $put_1 = GUICtrlCreateInput ("",10,40,270,25) $put_3 = GUICtrlCreateInput ("",10,75,270,25) GUISetState () $IsnotEmpty=0 While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case $IsnotEmpty=1 AND GUICtrlRead ($read_one) <> "" GUICtrlSetState ($put_1,$GUI_ENABLE) GUICtrlSetState ($put_3,$GUI_ENABLE) $IsnotEmpty=0 Case $IsnotEmpty=0 AND GUICtrlRead ($read_one) = "" GUICtrlSetState ($put_1,$GUI_DISABLE) GUICtrlSetState ($put_3,$GUI_DISABLE) $IsnotEmpty=1 EndSelect Wend Edited May 13, 2007 by Rick Who needs puzzles when we have AutoIt!!
star2 Posted May 13, 2007 Author Posted May 13, 2007 You need another another switch......theres probably lots of ways of doing it, but heres one....thank you so muchstill didn't know what the problem with the old way !!but your way is very good thanks [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]
star2 Posted May 13, 2007 Author Posted May 13, 2007 can anyone tell me what's wrong here? #include <GUIConstants.au3> GUICreate ("test",350,160) GUISetFont (10) GUICtrlCreateLabel ("test-1 ",10,70) GUICtrlSetFont (-1,12,600) GUICtrlCreateLabel ("test-2 ",220,70) GUICtrlSetFont (-1,12,600) $check_1 = GUICtrlCreateCheckbox ("testing 2",10,40) $put_1 = GUICtrlCreateInput ("",10,100,200,25,$WS_DISABLED) $put_2 = GUICtrlCreateInput ("",220,100,70,25,$WS_DISABLED) $do = GUICtrlCreateButton ("Do",300,100,40,25) GUICtrlSetFont (-1,12,600) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case GUICtrlRead($check_1) = 1 GUICtrlSetState($put_1, $GUI_ENABLE) GUICtrlSetState($put_2, $GUI_ENABLE) Case GUICtrlRead($check_1)=0 GUICtrlSetState($put_1, $WS_DISABLED) GUICtrlSetState($put_2, $WS_DISABLED) EndSelect If $msg = $do Then If BitAND(GUICtrlRead($check_1),$GUI_CHECKED) = 1 Then MsgBox (-1,"info","checked") Else MsgBox (-1,"info","un-checked") EndIf EndIf WEnd [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]
Developers Jos Posted May 13, 2007 Developers Posted May 13, 2007 #include <GUIConstants.au3> GUICreate("test", 350, 160) GUISetFont(10) GUICtrlCreateLabel("test-1 ", 10, 70) GUICtrlSetFont(-1, 12, 600) GUICtrlCreateLabel("test-2 ", 220, 70) GUICtrlSetFont(-1, 12, 600) $check_1 = GUICtrlCreateCheckbox("testing 2", 10, 40) $put_1 = GUICtrlCreateInput("", 10, 100, 200, 25, $GUI_DISABLE) $put_2 = GUICtrlCreateInput("", 220, 100, 70, 25, $GUI_DISABLE) $do = GUICtrlCreateButton("Do", 300, 100, 40, 25) GUICtrlSetFont(-1, 12, 600) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case GUICtrlRead($check_1) = 1 GUICtrlSetState($put_1, $GUI_ENABLE) GUICtrlSetState($put_2, $GUI_ENABLE) Case GUICtrlRead($check_1) = 4 GUICtrlSetState($put_1, $GUI_DISABLE) GUICtrlSetState($put_2, $GUI_DISABLE) EndSelect If $msg = $do Then If BitAND(GUICtrlRead($check_1), $GUI_CHECKED) = 1 Then MsgBox(-1, "info", "checked") Else MsgBox(-1, "info", "un-checked") EndIf EndIf WEnd SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
star2 Posted May 13, 2007 Author Posted May 13, 2007 thanks but what about the flickering? [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]
Developers Jos Posted May 13, 2007 Developers Posted May 13, 2007 thanks but what about the flickering?Test if the control needs to be Enabled/Disabled and only change it when needed, not always like now .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
star2 Posted May 13, 2007 Author Posted May 13, 2007 Test if the control needs to be Enabled/Disabled and only change it when needed, not always like now ....but the condition should always be needed otherwise the control state will not mach the condition? [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]
Developers Jos Posted May 13, 2007 Developers Posted May 13, 2007 but the condition should always be needed otherwise the control state will not mach the condition?update your script with this and check to see if that what you want : Case GUICtrlRead($check_1) = 1 If Not BitAND(GUICtrlGetState($put_1), $GUI_ENABLE) then GUICtrlSetState($put_1, $GUI_ENABLE) If Not BitAND(GUICtrlGetState($put_2), $GUI_ENABLE) then GUICtrlSetState($put_2, $GUI_ENABLE) Case GUICtrlRead($check_1) = 4 If Not BitAND(GUICtrlGetState($put_1), $GUI_DISABLE) then GUICtrlSetState($put_1, $GUI_DISABLE) If Not BitAND(GUICtrlGetState($put_2), $GUI_DISABLE) then GUICtrlSetState($put_2, $GUI_DISABLE) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
star2 Posted May 13, 2007 Author Posted May 13, 2007 update your script with this and check to see if that what you want : Case GUICtrlRead($check_1) = 1 If Not BitAND(GUICtrlGetState($put_1), $GUI_ENABLE) then GUICtrlSetState($put_1, $GUI_ENABLE) If Not BitAND(GUICtrlGetState($put_2), $GUI_ENABLE) then GUICtrlSetState($put_2, $GUI_ENABLE) Case GUICtrlRead($check_1) = 4 If Not BitAND(GUICtrlGetState($put_1), $GUI_DISABLE) then GUICtrlSetState($put_1, $GUI_DISABLE) If Not BitAND(GUICtrlGetState($put_2), $GUI_DISABLE) then GUICtrlSetState($put_2, $GUI_DISABLE) ................. Beautiful .............. !!!!!!!!!!!!!! [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]
Richard Robertson Posted May 13, 2007 Posted May 13, 2007 The problem is that when you are changing the state of the control, it wants to redraw itself to reflect changes.
star2 Posted May 14, 2007 Author Posted May 14, 2007 The problem is that when you are changing the state of the control, it wants to redraw itself to reflect changes.this is not good we have to figure a way arround that? [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]
Developers Jos Posted May 14, 2007 Developers Posted May 14, 2007 (edited) this is not good we have to figure a way arround that?mmm.. the solution I gave does that very thing ....right ? Edited May 14, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
star2 Posted May 14, 2007 Author Posted May 14, 2007 mmm.. the solution I gave does that very thing ....right ?Absolutely rightI've tried to add another condition to itbut I found out that I'm a big loseranyway I'm still in the beginingsand still trying to learnbut what I really know that AI is greatcause I hated programing before I found out about how simple AI is [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]
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