Jump to content

Recommended Posts

Hi,

I tried GUICtrlGetState to see if a checkbox is enabled or disabled and it returns 0 instead of a valid control state id. Doing the same thing on a button correctly returns 128 or $GUI_DISABLE.

As I understand it, GUIRead can be used to check for $GUI_CHECKED/$GUI_UNCHECKED and GUICtrlGetState to check for $GUI_ENABLE/$GUI_DISABLE for checkboxes and radio controls.

Thanks

Edited by pacman
Link to post
Share on other sites

Hi,

I tried GUICtrlGetState to see if a checkbox is enabled or disabled and it returns 0 instead of a valid control state id. Doing the same thing on a button correctly returns 128 or $GUI_DISABLE.

As I understand it, GUIRead can be used to check for $GUI_CHECKED/$GUI_UNCHECKED and GUICtrlGetState to check for $GUI_ENABLE/$GUI_DISABLE for checkboxes and radio controls.

Thanks

<{POST_SNAPBACK}>

under the current beta is working perfect.

Can you put a sample of your script showing the problem? :)

Link to post
Share on other sites

OK, here's some sample code to illustrate the problem I am having:

AutoItSetOption("GUICoordMode", 1)
AutoItSetOption("GUIResizeMode", 1)

#include <GUIConstants.au3>

GUICreate("Test", 400, 300, -1, -1)

$chkTest1 = GUICtrlCreateCheckbox(" Test 1", 85, 60, 370, 15)
GUICtrlSetState(-1, $GUI_CHECKED)
$chkTest2 = GUICtrlCreateCheckbox(" Test 2", 85, 100, 370, 15)
GUICtrlSetState(-1, $GUI_DISABLE)
$chkTest3 = GUICtrlCreateCheckbox(" Test 3", 85, 140, 370, 15)
GUICtrlSetState(-1, $GUI_HIDE)
$btnTest = GUICtrlCreateButton("Test", 85, 180, 70, 30)

GUISetState(@SW_SHOW)

While 1
   $msg = GUIGetMsg()
   Select
   Case $msg = $GUI_EVENT_CLOSE
      ExitLoop
   Case $msg = $btnTest
      GUICtrlSetState($chkTest3, $GUI_SHOW)
      MsgBox(4096, "", "Test1 control state = " & GUICtrlGetState($chkTest1) & @CRLF & _
                       "Test2 control state = " & GUICtrlGetState($chkTest2) & @CRLF & _
                       "Test3 control state = " & GUICtrlGetState($chkTest3))
EndSelect
Wend
GUIDelete()

Clicking on Test sets the state of $chkTest3 to $GUI_SHOW to make it visible

Test1 control state = 80 ($GUI_SHOW+$GUI_ENABLE)

Test2 control state = 128 ($GUI_DISABLE) - should it be ($GUI_SHOW+$GUI_DISABLE)?

Test3 control state = 16 ($GUI_SHOW) - should it be ($GUI_SHOW+$GUI_ENABLE)?

I am using the latest unstable released by Jon yesterday.

Thanks

Edited by pacman
Link to post
Share on other sites

OK, here's some sample code to illustrate the problem I am having:

Clicking on Test sets the state of $chkTest3 to $GUI_SHOW to make it visible

Test1 control state = 80 ($GUI_SHOW+$GUI_ENABLE)

Test2 control state = 128 ($GUI_DISABLE) - should it be ($GUI_SHOW+$GUI_DISABLE)?

Test3 control state = 16 ($GUI_SHOW) - should it be ($GUI_SHOW+$GUI_ENABLE)?

I am using the latest unstable released by Jon yesterday.

Thanks

<{POST_SNAPBACK}>

I see you are wondering changing the state from hide to show does not give back the $gui_show+$gui_enable. the answer is hide is not managing the enable/disable state, you never set the enable/disable state for this checkbox so you cannot get the enable/disable state.

It is true the state is enable because we see the button.

I don't know if we will change to report a state visible which have not been set.

for the time being just check is disable and assume if not it is enabled;

Sorry for the trouble :)

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...