Page 1 of 1

add/move/put into to group

Posted: Wed Aug 26, 2015 10:01 pm
by rinzwind
is it possible to move an existing field/button into a new or existing group by code?
The IDE allows you to create a new group for an existing control. But you can't do it in code... as far as I see.
thanks

Re: add/move/put into to group

Posted: Wed Aug 26, 2015 10:18 pm
by jmburnod
Hi rinzwind ,
Yes :D
Something like that :

Code: Select all

on mouseup
   put the id of btn "MyBtnForCopy" into tBtnForCopyID
   copy btn id tBtnForCopyID to group "myGroup"
   delete btn id tBtnForCopyID
end mouseUp
Best regards
Jean-Marc

Re: add/move/put into to group

Posted: Wed Aug 26, 2015 10:22 pm
by Klaus
HI rinzwind,

check this working script from a little test I just made:

Code: Select all

on mouseUp
   lock screen
   select fld 1
   cut
   start editing grp "g1"
   paste
   stop editing bg "g1"
   unlock screen
end mouseUp
Please note the little difference between "start" and "stop".
The first requires GROUP the latter BACKGROUND!?
Don't ask, no idea :D


Best

Klaus

Re: add/move/put into to group

Posted: Wed Aug 26, 2015 10:22 pm
by rinzwind
Aah copy and delete. Not as nice as move but its a good workarround. Thanks!

Re: add/move/put into to group

Posted: Wed Aug 26, 2015 10:29 pm
by jmburnod
What about this :

Code: Select all

on mouseup
   put the loc of group "myGroup" into tLocDest
   put the id of btn "MyBtnForCopy" into tBtnForCopyID
   move btn id tBtnForCopyID to tLocDest
   copy btn id tBtnForCopyID to group "myGroup"
   delete btn id tBtnForCopyID
end mouseUp

Re: add/move/put into to group

Posted: Thu Aug 27, 2015 12:37 pm
by Klaus
rinzwind wrote:Aah copy and delete. Not as nice as move but its a good workarround. Thanks!
My solution come as near to "moving" as possible :D
No deletion neccessary.