Create substack as part of a card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 719
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Create substack as part of a card
Hello all smart people.
I have the following problem, maybe any of you much smarter developers can help me.
Problem:
I have a card in my stack that has a lot of fields and code in it. I need to have multiple version of this card because for each version a few fields and some code is different. This means that if I change something in the generic part of this card I need to do this for all others as well.
My Idea was to use SubStacks that hover over this card as if it is part of the card, and for each different situation call a different substack that lays over this card (as if it is part of the card). This way I only have to make and open different substacks for each different situation and keep the main card the same which makes it easier to change and maintain.
I have tried this but could not make is so that a substack looks like it is part of an existing card (e.g. no border lines, no Top and so on, link it to a position in the main card).
Do any of you have some tips or even better an example for me?
Regards,
Paul
I have the following problem, maybe any of you much smarter developers can help me.
Problem:
I have a card in my stack that has a lot of fields and code in it. I need to have multiple version of this card because for each version a few fields and some code is different. This means that if I change something in the generic part of this card I need to do this for all others as well.
My Idea was to use SubStacks that hover over this card as if it is part of the card, and for each different situation call a different substack that lays over this card (as if it is part of the card). This way I only have to make and open different substacks for each different situation and keep the main card the same which makes it easier to change and maintain.
I have tried this but could not make is so that a substack looks like it is part of an existing card (e.g. no border lines, no Top and so on, link it to a position in the main card).
Do any of you have some tips or even better an example for me?
Regards,
Paul
Re: Create substack as part of a card
On the "master" card, if the common fields will all reflect any changes on the other cards then select the "shared text" option in the property inspector.
Group all the common fields and objects. Select the "behave as a background" option in the property inspector.
Then any NEW cards you create will have those common objects included.
On the other cards, delete any "duplicated" objects.
Then in the edit menu choose "place" and select the "background group". This will add those same common objects to any cards that are pre-existing, as opposed to the automatic inclusion on new cards.
Then the rest of the objects on each card will be individual to that card, but all the common stuff can easily be maintained.
Group all the common fields and objects. Select the "behave as a background" option in the property inspector.
Then any NEW cards you create will have those common objects included.
On the other cards, delete any "duplicated" objects.
Then in the edit menu choose "place" and select the "background group". This will add those same common objects to any cards that are pre-existing, as opposed to the automatic inclusion on new cards.
Then the rest of the objects on each card will be individual to that card, but all the common stuff can easily be maintained.
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Create substack as part of a card
Sparkout is likely spot on, but assumes that the same fixed group of controls are constant throughout, and only fixed outliers need to be different. if so, that is certainly the best and most robust method.
If not, it is possible to identify certain controls, perhaps by including some "tag" in their names, and clone those whenever you make a new card. Then any other controls will be the ones that are locally different, and you will know which ones they are, because if you loop through all controls on the new card, you can get a list of untagged ones.
Craig
If not, it is possible to identify certain controls, perhaps by including some "tag" in their names, and clone those whenever you make a new card. Then any other controls will be the ones that are locally different, and you will know which ones they are, because if you loop through all controls on the new card, you can get a list of untagged ones.
Craig
Re: Create substack as part of a card
hi @mrcoollion
Another idea would be to create a group with the controls that are common. Then create one for each variant and all you have to do is. On the same card, hide and show groups as needed
Another idea would be to create a group with the controls that are common. Then create one for each variant and all you have to do is. On the same card, hide and show groups as needed
-
- Posts: 719
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Create substack as part of a card
Thanks for all the idea's
Using "shared text" option in the property inspector and group all the common fields and objects and select the "behave as a background" option in the property inspector was not an option because i already have a template card set up this way.
However after some tinkering what I tried to do I have partly achieved (see attached stack).
The only snag is that any window can still come between the substack and main stack.
For me this is not a big issue but it would be nice if this could be prevented.
Also I cannot seem to change the background color of the SubStack_01 (changed it once cannot change it back???)
SubStack_02 has the same color (default) as the card it is layered on so therefore I put a button on it to see something appearing.
Any ideas to improve this are very welcome.
Friendly greetings
Paul
Using "shared text" option in the property inspector and group all the common fields and objects and select the "behave as a background" option in the property inspector was not an option because i already have a template card set up this way.
However after some tinkering what I tried to do I have partly achieved (see attached stack).
The only snag is that any window can still come between the substack and main stack.
For me this is not a big issue but it would be nice if this could be prevented.
Also I cannot seem to change the background color of the SubStack_01 (changed it once cannot change it back???)
SubStack_02 has the same color (default) as the card it is layered on so therefore I put a button on it to see something appearing.
Any ideas to improve this are very welcome.
Friendly greetings
Paul
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Create substack as part of a card
Paul,
Can you use the "mode" property to set the "order" of the "topStacks"? If you meant a window from another application, I do not think so, but within LC you can surely manage this.
Craig
Can you use the "mode" property to set the "order" of the "topStacks"? If you meant a window from another application, I do not think so, but within LC you can surely manage this.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Create substack as part of a card
Using substacks to simulate card additions sounds like trouble to me, there are too many things that could go wrong. If you can't use the ideas posted here, use groups instead. They will appear as part of the card and do what you want.
I don't understand how your existing template is involved though, so maybe I'm off track.
I don't understand how your existing template is involved though, so maybe I'm off track.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Create substack as part of a card
Another important point.
If you can possibly know that this sort of thing is going to be part of your stack, it really helps to set up the background groups at the very outset. That way you do not have to "place" controls all day.
But again, unless the "fixed" group of controls is, er, fixed, and only the outliers change, then you have to fiddle around constantly. In that case you need a plan to identify the changelings. You might also consider using behaviors to execute common code. At least these sit "outside" the card paradigm.
Craig
If you can possibly know that this sort of thing is going to be part of your stack, it really helps to set up the background groups at the very outset. That way you do not have to "place" controls all day.
But again, unless the "fixed" group of controls is, er, fixed, and only the outliers change, then you have to fiddle around constantly. In that case you need a plan to identify the changelings. You might also consider using behaviors to execute common code. At least these sit "outside" the card paradigm.
Craig
-
- Posts: 719
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Create substack as part of a card
Again thanks for all the valuable tips.