It took me a day and a night to understand what you mean by "do nothing". But... when the language barrier between a noob (I) and a professional (Kevin) has no importance, I understand the fact that "do nothing" means that if something exists... do something, if something does not exist... "do nothing". So...
A perfectly functional dynamically generated STATIC!!! layout! Of course, a real professional can make it better. But...
The week after that (until today), I fought with the second approach of the same functional layout, without "do nothing". And here I'm stuck.
I try to use @Kevinkun CompCreator - OnClick and OffClick procedures. The OffClick procedure I think that I understand it. But the OnClick procedure, I don't understand how to implement them, correctly in that case.
Also, I try another three extensions that seem to be simplest to use, without luck
Can/have time/want somebody to correct my errors on the above .aia?! In that case, I will understand where my understanding of logic fails or my lack of AI2 culture must be improved (on what I need for my project, I'll never be a professional on AI2).
above are two images and two .aia as an example. Deactivate_Activate_DoNothing.aia work as expected, generate 4 "small cells" with some info on them about the layout and a button on every 4 cells. when touching any of the 4 buttons from any cells, deactivate all 4 buttons from the small cells, and "it opens" a new "overlapped cell" with some info and a button. when I touch that button, it closes the overlapped cell and re-activates all 4 buttons from the 4 small cells.
generate an arrangement with 4 cells and a button on every cell -> click one of the 4 buttons -> deactivate the 4 buttons from small cells and display overlapped cell with a button -> click overlapped cell button -> close the overlapped cell and reactivate the 4 buttons from the small 4 cells.
in the first .aia above, all works as expected.
in the second .aia, the second image, Deactivate_Activate_OnOff.aia, I try to obtain the same result using the OffClick and OnClick methods implemented on the CompCreator, to use those methods correctly between two or three procedures.
Thank you very much @Kevinkun , from your help/examples on this thread, I learned a lot.
Now I have two questions. Below I create an example of what I want to achieve.
1 - Did I correctly use the DragAndDrop together with CompCreator?! If yes, why did it crash the companion without any error message when I wanted to drag an arrangement, I moved it about 10 pixels and dropped it in himself.
2 - As you can see in the blocks when I click on the button, I want to create with a template and CompCreator, in Vertical Arrangement 8 a replica of what I drew with squares in Vertical Arrangement 1.
For that, I need to "read" the template/JSON from VerticalArrangement1, the million dollars question is how can I do that?!
I know that can't be an empty string, It is just an exemplification of what I need.
What I think, is the fact that the layout that VerticalArrangement1 has as dynamically generated, can be the same as a statical one. What can be used to obtain JSON data from a statical arrangement?
Oh... no, no, no. The layout for the app is just working more beautifully than ever I can expect, due to your help !!! This is not another approach for the app layout!!!
This is a possible approach to how can I draw connectors! There are hundreds or more connector types/shapes.
I already can draw any type of connector with CompCreator!!! In a let's say... "static mode". I use some complicated logic to give to some procedures that have CompCreator and KevinKunEnhance inside, and in function of those numbers and some CheckBoxes, it creates almost any type of connector!!! So... I already have a technique/method to draw connectors!!!
But this approach (visual-based drawing of connectors) is a dream for a collaborative approach, anyone will have the possibility to draw any type of connector visually!!!
For that reason, I want to learn how to use the JSON/templates on my app.
Below you can see the basic test for layout and the first-ever L12-ECU connector, all drawn with CompCreator!
On this test I have all that I need for the moment for layout, The sliders are synchronized, the big cell can be moved on all parts of the screen, and can be "pinned" to not move from error when I touch the slider... "unpinned"... and so on.
This is not a problem about CompCreator, but this DragAndDrop extension.
But I dont't think it 's necessary to remove the component after moving it, since it will moved from its original place to desitination.
If you really want to remove it, maybe you need to un-register this componnet for drag first.
Of course, it is not a problem with CompCreator, it is a problem with DragAndDrop because I try to remove a "thing" from a list (a global variable list with all generated arrangements) and it gives me the same error.
Let's ask @Ken about this problem. Anyway, I have a problem with DragAndDrop that crashes the companion if I use "Drag" and "Drop" in the same arrangement!
as you see... the first block is a native label that works as expected. but just in case... I test it with a dynamic label... to give you more... work... around that wonderful extension... it have years without any update...