Wish Wishes for the Designer

Toky Olivier

Active Member
Licensed User
Longtime User
Hi,
For B4J designer, I have some wishes if it's possible.
- Add "Container" type for custom views so that it can contains another views, can have children (very good for BANano as you can move/delete etc easily views with thiers children)
- When adduing View to the Designer: add it in the middle of current view port (or if "Container" widget is implemented, in the middle of selected view in the designer). Every time, new View is added at position: left = 100, top = 100 and it's far if I have wide design. I have to scroll to find newly added view and have to drag to current view port of the designer.

Thank you so much!
 

Toky Olivier

Active Member
Licensed User
Longtime User
Yes but in the designer, your view cannot have children, cannot be parent. You cannot put another view "IN" a view already in the designer.
 

klaus

Expert
Licensed User
Longtime User
I do not understand.
In the Designer you can add other views onto a Panel.
You can also change the Parent of any view.

1648998185174.png

pnlTest is a child of Main.
Button1 is a child of Main
Button2 is a child of pnlTest.
In the image above you see that you can change the parent view.
The greyed item in the list is the parent.
You see also the structure in the Views Tree.
 

Toky Olivier

Active Member
Licensed User
Longtime User
I do not understand.
In the Designer you can add other views onto a Panel.
You can also change the Parent of any view.

View attachment 127454
pnlTest is a child of Main.
Button1 is a child of Main
Button2 is a child of pnlTest.
In the image above you see that you can change the parent view.
The greyed item in the list is the parent.
You see also the structure in the Views Tree.
I talk about Custom Views. If I use pane, yes, it's parent and can have children but for Custom Views (used in BANano for example), how to set it as a Container and can hold another views?

2022-04-04 06_17_03-Login - (VKPAE) Visual Designer.png


Note that you can also change parents, in more sophisticated ways, by dragging views in the views tree on the left side.
I did this and use this to move backward or foreward, not to set parents. My concern is how to set a Custom View to be as a Pane so that it can hold another views.
 

Mashiane

Expert
Licensed User
Longtime User
Banano custom views do not work like normal b4x views when used in the abstract designer and cannot have parent child relationships normally. When you place a custom view inside another, then one becomes parent and the other a child, this is not reflected on the tree as such as documented for Banano.

What you can do is to split your layouts if they are big and use Banano.loadlayoutappend to join them together, that is how I do it at times, whilst generating members on the same class module.

Another option is to have a property named parentid, whith that you can place a custom view anywhere and when the app runs it builds the parent child relationship itself. You just adjust some code in the custom view to do that. You can see the source code for bvad3 on how I did that. This though works when you add the views in sequence as they seem to follow some zorder or something.

Good luck.
 

Mashiane

Expert
Licensed User
Longtime User
If you need a custom view to be a parent for all others, you can create a custom view that is just a div tag for Banano and use that and place other components inside it when creating your UI.

If you can't do that, you can just create layouts and then join them with Banano.loadlayoutappend.

Also on the tree list you can drag and drop a component before another to make it a parent.
 

Toky Olivier

Active Member
Licensed User
Longtime User
Banano custom views do not work like normal b4x views when used in the abstract designer and cannot have parent child relationships normally. When you place a custom view inside another, then one becomes parent and the other a child, this is not reflected on the tree as such as documented for Banano.

What you can do is to split your layouts if they are big and use Banano.loadlayoutappend to join them together, that is how I do it at times, whilst generating members on the same class module.

Another option is to have a property named parentid, whith that you can place a custom view anywhere and when the app runs it builds the parent child relationship itself. You just adjust some code in the custom view to do that. You can see the source code for bvad3 on how I did that. This though works when you add the views in sequence as they seem to follow some zorder or something.

Good luck.
I know and I do like that but what Is very nice is to have "Container" type for "Custom views", some thing in the code like
B4X:
#Region Custom View Attributes
    #CustomViewType: Container 'if it's container: it can be like "Pane" in jFX and can hold anther "Custom View"
#End Region
So that in the designer (In the code I know how do it and it's what I do), I can put another "Custom views" in it as children and I can Move/Delete together in the Designer within theirs parent.

But I think that what I propose is too difficult to understand, unfortunately. May be my english too. Even @alwaysbusy put this in "LoadLayout" sub:
2022-04-04 12_13_37-BANanoTabler - B4J.png

And this is exactly what I request if possible. Make it possible in B4J custom views so that It will be easy to manage in the designer too. Algorithm in BANano do the job (thank you @alwaysbusy) but having it implemented is better for user who design his website. But it's ONLY my advice. Thank you all. I propose to delete this thread if it doesn't have any use.
 
Top