O$4 - Copy a continer object

Mischa mischa at omnislab.com
Thu Mar 12 17:52:08 EDT 2015


Hi Michael,

Did some trials on myself because it's an interesting problem ;) but also
ended up with $makelist. It seems that sending each object of scrollbox1 the
message to add itself to scrollbox2 does not work. So if you are using it
more often, subwindows would be more convenient.

Best greetings
Mischa

---------------------------------------------------
  T H E   O M N I S   L /\ B     www.omnislab.com
---------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Michael
Mantkowski
Gesendet: Donnerstag, 12. März 2015 22:32
An: 'OmnisDev List - English'
Betreff: RE: O$4 - Copy a continer object

Hi Mischa,

Agreed.  After a lot of hit and miss I came up with this.  Seems to work
fine.  But only one level deep.

;  Copy Main Object
Set reference lvOrigRef to $cinst.$objs.Box1.$ref
Do $cinst.$objs.$add(lvOrigRef) Returns lvRef
Calculate lvRef.$left as 100
Calculate lvRef.$top as 100

;  Copy bobj items
Begin reversible block
    Set current list lvObjList
End reversible block
Calculate lvObjList as lvOrigRef.$bobjs.$makelist($ref)
Redefine list {lvObjRef}
For each line in list from 1 to #LN step 1
    Do lvRef.$bobjs.$add(lvObjList.lvObjRef) Returns lvObjRef
End For

;  Copy obj items
Calculate lvObjList as lvOrigRef.$objs.$makelist($ref)
Redefine list {lvObjRef}
For each line in list from 1 to #LN step 1
    Do lvRef.$objs.$add(lvObjList.lvObjRef) Returns lvObjRef
End For

*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************



-----Original Message-----
From: omnisdev-en-bounces at lists.omnis-dev.com
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Mischa
Sent: Thursday, March 12, 2015 5:26 PM
To: 'OmnisDev List - English'
Subject: Re: O$4 - Copy a continer object

Hi Michael,

I think, the reason why it fails is that the objects are not 'really'
contained in the scrollbox (or any other container object), as you can see
in the class. Only when the window is instantiated, Studio tells them to act
as inside objects. You could either try some $sendall magic, or (my
preferred way) use subwindows instead - this works because the objects are
actually inside the subwindow class.

hth
Mischa

---------------------------------------------------
  T H E   O M N I S   L /\ B     www.omnislab.com
---------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Michael
Mantkowski
Gesendet: Donnerstag, 12. März 2015 16:53
An: 'OmnisDev List - English'
Betreff: O$4 - Copy a continer object

I am trying to make a copy of a ScrollBox that contains several objects.

Using the code below, I get the scroll box, but none of the items that are
in the original.

Am I doing something wrong?

Set reference lvOrigRef to $cinst.$objs.Box1.$ref
Do $cinst.$objs.$add(lvOrigRef) Returns lvRef
Calculate lvRef.$name as lvRef.$ident
Calculate lvRef.$left as 100
Calculate lvRef.$top as 100

*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************


_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list