Page 1 of 1

DCSETPARENT TO

Posted: Mon Oct 18, 2010 1:27 pm
by jdsoft
Hello,

I am looking for function to retrieve the current DCSETPARENT.
I am experiencing problems if there is a DCGROUP in a DCTABPAGE.
The code below does not work ok

Code: Select all

DCSETPARENT oTabPage
@ 1,1 DCGROUP oGroup CAPTION "A box"  SIZE 40,4
@ 1,1 DCSAY "Hello in groupbox" PARENT oGroup
@ 6,1 DCSAY "Hello in tabpage" 
But this does

Code: Select all

DCSETPARENT oTabPage
@ 1,1 DCGROUP oGroup CAPTION "A box"  SIZE 40,4
@ 1,1 DCSAY "Hello in groupbox" PARENT oGroup
DCSETPARENT oTabPage
@ 6,1 DCSAY "Hello in tabpage" 
Sometimes i build my Getlist in Procedures, that are not aware of parents. So this does not work.

Code: Select all

DCSETPARENT oTabPage
My_MakeGroup(GetList)
@ 6,1 DCSAY "Hello in tabpage" 
..
Procedure My_MakeGroup(GetList)
@ 1,1 DCGROUP oGroup CAPTION "A box"  SIZE 40,4
@ 1,1 DCSAY "Hello in groupbox" PARENT oGroup
Return
But the code below should do it, if the function DC_GETCURRENTPARENT() would exist ;)

Code: Select all

DCSETPARENT oTabPage
My_MakeGroup(GetList)
@ 6,1 DCSAY "Hello in tabpage" 
..
Procedure My_MakeGroup(GetList)
LOCAL oParent  :=  DC_GETCURRENTPARENT(GetList) 
@ 1,1 DCGROUP oGroup CAPTION "A box"  SIZE 40,4
@ 1,1 DCSAY "Hello in groupbox" PARENT oGroup
DCSETPARENT TO oParent
Return
Does this make any sense :?:

Regards,
Jack Duijf

Re: DCSETPARENT TO

Posted: Mon Oct 18, 2010 4:15 pm
by rdonnay
Jack -

This is very difficult.
I think I need to figure out why you are having a problem with DCGROUP.

Roger

Re: DCSETPARENT TO

Posted: Mon Oct 18, 2010 6:05 pm
by rdonnay
Jack -

Try removing the comment marker from in front of the following line of code in _dcgetbx.prg.

oOptions := oSetParent

Roger

Re: DCSETPARENT TO

Posted: Tue Oct 19, 2010 6:08 am
by RDalzell
Jack,

At the end of each DCTABPAGE I use:

DCSETPARENT TO

Never an issue after that.

Rick

Re: DCSETPARENT TO

Posted: Sat Oct 23, 2010 5:39 am
by John Hohensee
Take a look in User Contributions at my MakeOkCancel() and MakeButton() procedures
I use DCSETPARENT TO oBrow
the MakeOkCancel() or MakeButton()
followed with DCSETPARENT TO