Page 1 of 1

Group controls and move them together

Posted: Thu May 17, 2018 4:55 pm
by concentra
Hi.

I it possible to group a set of controls and move them together on a dialog ?
Like defining a group of ( say + button + get ) and move them together on the dialog in only one command ?

Regards.

Maurício Faria

Re: Group controls and move them together

Posted: Fri May 18, 2018 10:06 pm
by nageswaragunupudi
Yes. You need to create the Group control and other controls in the ON INIT clause.

Sample:

Code: Select all

#include "fivewin.ch"

function Main()

   local oDlg, oGroup

   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL
   ACTIVATE DIALOG oDlg CENTERED ON INIT DlgControls( oDlg )

return nil

function dlgcontrols( oDlg )

   local oGroup

   @ 20,20 SAY "First" SIZE 100,20 PIXEL OF oDlg

   @ 50,20 GROUP oGroup TO 150,170 PIXEL OF oDlg

   @ 10,10 BUTTON "OK" SIZE 60,20 PIXEL OF oGroup ;
      ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .t. )

   @ 40,10 SAY "Inside" SIZE 100,20 PIXEL OF oGroup

return nil
 

Re: Group controls and move them together

Posted: Thu May 24, 2018 10:23 am
by concentra
Thanks.