Page 1 of 1

dc_working and modal

Posted: Fri Mar 07, 2025 2:46 am
by skiman
Hi,

I need a modal dialog with a button on it to cancel. I thought dc_working would fullfill this need.
However it seems as with dc_working a user can click on another part of the screen and the dc_working dialog goes into the background.

I changed the behaviour so with each dc_working(1) to update the dialog there is a oDlg:tofront() executed. This way the dc_working dialog displays again after each refresh.

Code: Select all

...
      IF DC_LangSet() == DCLANG_CHINESE .OR. .t.
        oDlg:cargo:SetCaption(Repl('||',nWORK_CURRCOL-nWORK_STCOL))
      ELSE
        oDlg:cargo:SetCaption(Repl(Chr(31)+Chr(31),nWORK_CURRCOL-nWORK_STCOL))
      ENDIF
     oDlg:tofront()   <<<<<<<--------------------- new line added, brings it to front.
      IF Valtype(aWORK_CANCEL) = 'L'
         DO WHILE nEvent # xbeP_None .AND. nEvent # 0
            nEvent := AppEvent( @mp1, @mp2, @oXbp, .01 )
            IF Valtype(oXbp) = 'O'
   ...

Re: dc_working and modal

Posted: Sat Mar 08, 2025 11:02 am
by rdonnay
Thanks Chris.

I just added it to my source.