Modify

Opened 16 years ago

Closed 16 years ago

#1449 closed Bug (Fixed)

GUICtrlDelete(), GUICtrlCreateDummy()

Reported by: anonymous Owned by: Jon
Milestone: 3.3.5.3 Component: AutoIt
Version: 3.3.4.0 Severity: None
Keywords: GUICtrlDelete GUICtrlCreateDummy Cc:

Description

Not sure If GUICtrlDelete() should delete a GUICtrlCreateDummy() created control. If not, its at leased documented this way.

;; AutoIt(3.3.4.0)&(3.3.5.1).
;; Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X86 OS:X86)
#cs - local output.
	GUICtrlCreateDummy = 3
	GUICtrlDelete = 0
	GUICtrlCreateDummy = 4
	GUICtrlDelete = 0
#ce
Global $iResult
GUICreate('test')
$iResult = GUICtrlCreateDummy()
ConsoleWrite('GUICtrlCreateDummy = ' & $iResult & @CRLF)
$iResult = GUICtrlDelete($iResult)
ConsoleWrite('GUICtrlDelete = ' & $iResult & @CRLF)
$iResult = GUICtrlCreateDummy()
ConsoleWrite('GUICtrlCreateDummy = ' & $iResult & @CRLF)
$iResult = GUICtrlDelete($iResult)
ConsoleWrite('GUICtrlDelete = ' & $iResult & @CRLF)

Attachments (0)

Change History (4)

comment:1 by Valik, 16 years ago

I consider this a bug. The following script demonstrates that the dummy control is not deleted. I cannot think of any valid reason why the delete request should be ignored:

Opt("GUIOnEventMode", 1)
GUICreate("Test")
GUISetState(@SW_SHOW)	; Required
Local $idDummy = GUICtrlCreateDummy()
GUICtrlSetOnEvent($idDummy, "OnDummy")
GUICtrlSendToDummy($idDummy)	; Test the event works.
GUICtrlDelete($idDummy)	; Delete the control.
GUICtrlSendToDummy($idDummy)	; The event SHOULD NOT fire but it does.

Func OnDummy()
	MsgBox(4096, "", "Called")
EndFunc	; OnDummy()

comment:2 by Jon, 16 years ago

Found this comment in the source code:

case AUT_GUI_DUMMY:
	return 0;            // Can't delete these yet

Not sure why...

comment:3 by Jon, 16 years ago

Can't see any reason this code needed to be there. Maybe it was supposed to be "break" rather than "return". Removing and marking as fixed.

comment:4 by Jon, 16 years ago

Milestone: 3.3.5.3
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [5663] in version: 3.3.5.3

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.