Page 1 of 1

DCPUSHBUTTON activated even though MODAL Dialog open

Posted: Fri Oct 28, 2016 10:36 am
by rsmarks
I am having a problem that occurs randomly and infrequently. Basically, the ACTION for a DCPUSHBUTTON (@ (B)MYPANAPP(486)) is to invoke a function that opens a MODAL DCREAD GUI dialog (@ MYPANADDITEM(1048)). Somehow, the DCPUSHBUTTON is being activated again while the MODAL window is still open. Any idea how this can happen? BTW, I added MYLOGSTATUS() to record the Called List show below if the push button is activated a second time before the DC_READGUI in MYPANADDITEM closes. I have never been personally present when this has happened and nothing I’ve tried duplicates the problem.

The DCPUSHBUTTON at line 486 is:
@ 20,1 DCPUSHBUTTON CAPTION ‘Add Item’ ACCELKEY xbeK_ALT_A SIZE 10,1.3 ;
ACTION {|| IIF(lAddOK,(lAddOK:=.F.,MyPanAddItem(),lAddOK:=.T.),MyLogStatus()) }

MyPanAddItem’s DCREAD at line 1048 is:
DCREAD GUI TITLE "Ticketed Item" OPTIONS GetOptions CLEAREVENTS ;
NOENTEREXIT TIMEOUT {MS_TimeOut,{|| ScreenSaver()}} ;
FIT MODAL SETAPPWINDOW APPWINDOW oRootWin OWNER SetAppWindow() ;
TO lReturn EVAL {|o| SetAppWindow(o), ;
o:setDisplayFocus:={|x,y,o| SetAppWindow(o)} }

The Called List is:
Called from MYLOGSTATUS (2437)
Called from (B)MYPANAPP (486)
Called from DC_XBPPUSHBUTTON:ACTION (2521)
Called from (B)DC_XBPPUSHBUTTON:INIT (2057)
Called from (B)DC_XBPPUSHBUTTON:INIT (2058)
Called from XBPPUSHBUTTON:HANDLEEVENT (1522)
Called from DC_GETLIST:EVENTLOOP (4721)
Called from DC_GETLIST:READGUI (3879)
Called from DC_READGUI (113)
Called from MYPANADDITEM (1048)
Called from (B)MYPANAPP (486)
Called from _PROCESSHOTKEY (5341)
Called from DC_GETLIST:EVENTLOOP (4788)
Called from DC_GETLIST:READGUI (3879)
Called from DC_READGUI (113)
Called from MYPANAPP (546)
Called from MYMENURUN (499)
Called from MAIN (346)

Re: DCPUSHBUTTON activated even though MODAL Dialog open

Posted: Sat Oct 29, 2016 7:06 am
by zolifree
I think the problem is the same that I had months ago, and it is solved here:
http://bb.donnay-software.com/donnay/vi ... f=2&t=1922

From the error log it is clear the button was pressed by hotkey.
I think form the new window the user pressed the ALT+A, and the window opened agan.

Re: DCPUSHBUTTON activated even though MODAL Dialog open

Posted: Fri Nov 11, 2016 4:48 pm
by rsmarks
I thought that at first, except I also have the same problem without the hot key being pressed:
Called from MYLOGSTATUS (2437)
Called from (B)MYPANAPP (486)
Called from DC_XBPPUSHBUTTON:ACTION (2521)
Called from (B)DC_XBPPUSHBUTTON:INIT (2057)
Called from (B)DC_XBPPUSHBUTTON:INIT (2058)
Called from XBPPUSHBUTTON:HANDLEEVENT (1522)
Called from DC_GETLIST:EVENTLOOP (4721)
Called from DC_GETLIST:READGUI (3879)
Called from DC_READGUI (113)
Called from MYPANADDITEM (1048)
Called from (B)MYPANAPP (486)
Called from DC_XBPPUSHBUTTON:ACTION (2521)
Called from (B)DC_XBPPUSHBUTTON:INIT (2057)
Called from XBPPUSHBUTTON:HANDLEEVENT (1522)
Called from DC_GETLIST:EVENTLOOP (4712)
Called from DC_GETLIST:READGUI (3879)
Called from DC_READGUI (113)
Called from MYPANAPP (546)
Called from MYMENURUN (499)
Called from MAIN (346)

However, I will give the correction a try, too