Opened on Nov 24, 2014 at 2:13:42 AM
Closed on Aug 9, 2020 at 9:23:58 AM
Last modified on Aug 12, 2020 at 8:28:04 PM
#2943 closed Bug (Works For Me)
Disabled dummy control reacts on accelerators
| Reported by: | Owned by: | Jon | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.13.19 | Severity: | None |
| Keywords: | Cc: |
Description
I noticed that in previous versions (3.3.12.0) $GUI_DISABLE didn't have any effect on accelerators. This is fixed in the beta, but unfortunately not completely.
Testing 3.3.13.19, $GUI_DISABLE disables accelerators for controls like buttons, but not for dummy controls.
This should not work:
#include <GUIConstantsEx.au3>
GUICreate("Hit Enter in this GUI")
$idDummy = GUICtrlCreateDummy()
GUICtrlSetState($idDummy, $GUI_DISABLE)
Global $aArray[1][2] = [["{ENTER}", $idDummy]]
GUISetAccelerators($aArray)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $idDummy
MsgBox(0, "Dummy", "Entered")
EndSwitch
WEnd
Another thing that I think should not be possible and may be related to this is GUICtrlSendToDummy:
GUICtrlSendToDummy() triggers events on disabled dummy controls, which I guess shouldn't be possible as well.
Attachments (0)
Change History (6)
comment:2 by , on Nov 30, 2014 at 1:21:47 AM
But I can use and work with GUICtrlSetState and GUICtrlGetState on Dummy Controls without any problems o.O
comment:3 by , on Nov 30, 2014 at 1:28:29 AM
Quick example:
#include <GUIConstantsEx.au3>
GUICreate("Hit Enter in this GUI")
$idButton = GUICtrlCreateButton("hit me", 5, 5)
$idDummy = GUICtrlCreateDummy()
Global $aArray[1][2] = [["{ENTER}", $idDummy]]
GUISetAccelerators($aArray)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $idButton
If BitAND(GUICtrlGetState($idDummy), $GUI_DISABLE) = $GUI_DISABLE Then
GUICtrlSetState($idDummy, $GUI_ENABLE)
Else
GUICtrlSetState($idDummy, $GUI_DISABLE)
EndIf
MsgBox(0, "", "Dummy state is " & (BitAND(GUICtrlGetState($idDummy), $GUI_DISABLE) = $GUI_DISABLE ? "disabled" : "enabled"))
EndSwitch
WEnd
I guess the dummy control always should have the same behaviour as its native counterparts. That's why I reported the wrong behavior from my first example.
comment:5 by , on Aug 9, 2020 at 9:23:58 AM
| Resolution: | → Works For Me |
|---|---|
| Status: | assigned → closed |
Hi,
It works for me with current release
Cheers
comment:6 by , on Aug 12, 2020 at 8:28:04 PM
Confirmed.
Tested with modified script:
#include <GUIConstantsEx.au3> _Example() Func _Example() GUICreate("Hit Enter in this GUI") Local $idDummy = GUICtrlCreateDummy() Local $aArray[1][2] = [["{F10}", $idDummy]] GUICtrlSetState($idDummy, $GUI_DISABLE) GUISetAccelerators($aArray) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idDummy If BitAND(GUICtrlGetState($idDummy), $GUI_DISABLE) = $GUI_DISABLE Then GUICtrlSetState($idDummy, $GUI_ENABLE) Else GUICtrlSetState($idDummy, $GUI_DISABLE) EndIf MsgBox(0, "", "Dummy state is " & (BitAND(GUICtrlGetState($idDummy), $GUI_DISABLE) = $GUI_DISABLE ? "disabled" : "enabled")) EndSwitch WEnd EndFunc ;==>_Example

What you are actually saying is that Dummy controls do not honour the $GUI_* states. Which does not surprise me in the slightest as I imagine that they are but a simple entry in the internal AutoIt control array, and do not exist as far as Windows is concerned so there is nothing on which Windows can apply the state.
It seems to me that if you want to "disable/enable" dummy controls then you need to delete/recreate them as necessary.
M23