Page 1 of 1

Keeping DC_Popcalc() Always On Top

Posted: Sat Feb 23, 2013 7:50 am
by GeneB
Could someone please tell me how to keep the popup DC_Popcalc() always on top?
I would assume that would also be the way to keep a DCFINDBROWSE window always on top?

Thanks.
GeneB

Re: Keeping DC_Popcalc() Always On Top

Posted: Sat Feb 23, 2013 10:39 am
by rdonnay
I am assuming you mean that you want it to be MODAL.

In order for modality to work, it needs to have an owner.
By default, the owner is SetAppWindow().

Whenever you are using a popup, you should make sure that the calling window is the SetAppWindow().

Look at the below example:

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], n := 123.45

@ 0,0 DCSAY 'Enter a number' GET n ;
      POPUP {|n|DC_Popcalc(n)} ;
      SAYSIZE 0 SAYBOTTOM

DCREAD GUI FIT TITLE 'Pop Calc test' SETAPPWINDOW

RETURN nil

PROC appsys ; return

Re: Keeping DC_Popcalc() Always On Top

Posted: Sat Feb 23, 2013 3:29 pm
by GeneB
SETAPPWINDOW in the parameters of Main() solved it.

Muchisimas gracias.
GeneB