Page 1 of 1

Setpos with a modal window

Posted: Wed Mar 30, 2011 1:57 pm
by wkedv
Hi Roger,

A nonmodal window i can adjust in the Appwindow exact on pos 0,0 from the parent,
but with a nonmodal there i dont know how to do, that i can it make like in a nonmodal window.

The conflict is, in a nonmodal i can set in DCREADGUI the option ** APWINDOW oParentDlg ** and the window will be positioned on the parent.

With modal the opened window is every time at the appdesktop.

See my attached sample.

Plse help me.

thanks and regards Kurt.

Re: Setpos with a modal window

Posted: Wed Mar 30, 2011 2:43 pm
by rdonnay
I think this will work for you:

Code: Select all

Function tw2( oDlgtest)

Local GetList := {}, GetOptions, oDlgtw2, oget, cget, oStatic

cget := space(15)

@ .1,.1 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 50,5.000 OBJECT oStatic

@ 2,05 DCSAY "Test-1 " PARENT oStatic
@ 2,20 DCGET cget OBJECT oget PARENT oStatic

DCGETOPTIONS HIDE

DCREAD GUI FIT ;
		MODAL ;
      OPTIONS GetOptions ;
      SETAPPWINDOW ;
      ADDBUTTONS ;
      TITLE 'Test-modal' ;
      SETFOCUS @oget ;
      EVAL {|o,a| a := DC_CalcAbsolutePosition({0,0},oDlgTest), ;
                  o:setPos({a[1]+5,a[2]+5}), ;
                  o:show()}

RETURN nil

Re: Setpos with a modal window

Posted: Wed Mar 30, 2011 3:03 pm
by wkedv
Hi Roger,

many thanks for your prompt help.

it works fine

Thanks and regards Kurt