rudi Posted February 15, 2010 Share Posted February 15, 2010 Hi.Checkboxes FAIK can have three states:1.) checked2.) unchecked3.) neither checked nor unchecked. The Checkbox then is "filled with gray". From the help files I expected that one to be called "INDETERMINATED".; autoit 3.3.4.0 #include <GUIConstantsEx.au3> $w = 300 $h = 80 GUICreate("test", $w, $h) GUICtrlCreateCheckbox("indeterminate", 20, 20, $w - 40, 20) GUICtrlSetState(-1, $GUI_INDETERMINATE) GUISetState() Sleep(3000)What I want to do:For a registry tweak I want to show, if the value is set active (checked), is set inactive (unchecked), or is not present ("grayed" checkbox, just the checkboxes status, NOT the checkbox control's status = $GUI_DISABLE)Howto?Other, better approaches?Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
KaFu Posted February 15, 2010 Share Posted February 15, 2010 Style $BS_AUTO3STATE needs to be set. #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $w = 300 $h = 80 GUICreate("test", $w, $h) GUICtrlCreateCheckbox("1", 20, 10, $w - 40, 20, $BS_AUTO3STATE) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateCheckbox("2", 20, 30, $w - 40, 20,$BS_AUTO3STATE) GUICtrlSetState(-1, $GUI_INDETERMINATE) GUICtrlCreateCheckbox("4", 20, 50, $w - 40, 20,$BS_AUTO3STATE) GUICtrlSetState(-1, $GUI_UNCHECKED) GUISetState() Sleep(10000) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 15, 2010 Share Posted February 15, 2010 The $BS_AUTO3STATE style needs to be added to the CheckBox function, and the ButtonConstants include too. I've edited the code a bit more than needed, but..; autoit 3.3.4.0 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $w = 300 $h = 80 GUICreate("test", $w, $h) GUICtrlCreateCheckbox("indeterminate", 20, 20, $w - 40, 20, $BS_AUTO3STATE) ;GUICtrlSetState(-1, $GUI_INDETERMINATE) ; commented so not indeterminate at first.. GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
KaFu Posted February 15, 2010 Share Posted February 15, 2010 The $BS_AUTO3STATE style needs to be addedSaw the problem with $BS_3STATE ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
rudi Posted February 19, 2010 Author Share Posted February 19, 2010 (edited) Hi. The $BS_AUTO3STATE style needs to be added to the CheckBox function, and the ButtonConstants include too. I've edited the code a bit more than needed, but.. ; autoit 3.3.4.0 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $w = 300 $h = 80 GUICreate("test", $w, $h) GUICtrlCreateCheckbox("indeterminate", 20, 20, $w - 40, 20, $BS_AUTO3STATE) ;GUICtrlSetState(-1, $GUI_INDETERMINATE) ; commented so not indeterminate at first.. GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() That's it -- almost... clicking the check box now cycles the states "Checked", "Unchecked", "Indeterminated Checked". How to get "indeterminated UNchecked" ? From the help file I worry that this "indeterminated unchecked" is not available with autoit? $BS_AUTO3STATE 0x0006: Creates a three-state check box in which the state cycles through selected, unavailable, and cleared each time the user selects the check box. Thanks, Rudi. Edited February 19, 2010 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 19, 2010 Share Posted February 19, 2010 ; autoit 3.3.4.0 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $w = 300 $h = 80 GUICreate("test", $w, $h) Local $Label = GUICtrlCreateLabel(" ", 10, 10) Local $Checkbox = GUICtrlCreateCheckbox("indeterminate", 30, 30, $w - 40, 20, $BS_AUTO3STATE) ;GUICtrlSetState(-1, $GUI_INDETERMINATE) ; commented so not indeterminate at first.. GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop GUICtrlSetData($Label, GUICtrlRead($Checkbox)) WEnd GUIDelete() - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
MHz Posted February 19, 2010 Share Posted February 19, 2010 Hi. That's it -- almost... clicking the check box now cycles the states "Checked", "Unchecked", "Indeterminated Checked". How to get "indeterminated UNchecked" ? From the help file I worry that this "indeterminated unchecked" is not available with autoit? $BS_AUTO3STATE 0x0006: Creates a three-state check box in which the state cycles through selected, unavailable, and cleared each time the user selects the check box. Thanks, Rudi. Hi, From MSDN BS_3STATE Creates a button that is the same as a check box, except that the box can be grayed as well as checked or cleared. Use the grayed state to show that the state of the check box is not determined. BS_AUTO3STATE Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, indeterminate, and cleared. IMO, indeterminate means uncertain to determine state thus it is checked with doubt (greyed). "indeterminated unchecked" does not seem logical to exist. Holger did some functions to set pictures in the checkboxes to set a tri-state which may come as useful for this. Search for TristateTreeViewLib.au3 if you are interested. 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