Wish Designer's features

Cableguy

Expert
Licensed User
Longtime User
A thought on number one...

No anchors is just not possible... Why?
Because any view is placed relative to a 0 (zero) point, usually set by the views parent. A view with no anchors would have to have a meaningless left and top values... Which is... Impossible!
Default anchors are top and left, because it's where the parents zero points are!
 

Cableguy

Expert
Licensed User
Longtime User
that is, it is possible; and also it is useful to get the result you can see here.
as said in the linked page, they are "anchored to the nearest boundary", so none doesn't really exist!
 

LucaMs

Expert
Licensed User
Longtime User
as said in the linked page, they are "anchored to the nearest boundary", so none doesn't really exist!


It exists and it is useful in the case I linked. Try to obtain the layout I published there without a designer's script.

It does not means that the View will stay anchored to the nearest boundary (which should mean mantaining a fixed distance from); the View will be placed at a proportional distance from all boundaries (edges?).
 

LucaMs

Expert
Licensed User
Longtime User
Please, try to realize the layout as I did (at that time) using VS AND AS I POSTED THERE:

The three central buttons have anchor set to None, so they remain at center even if you change the form size.
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Again, NONE means nothing.
In your case you should ask for anchor CENTER that's what you ask in your example..
Then how should Button5 and Button6 be placed?
With a distance to the CENTER or %x to the center?
Distance of Left, Middle or right to the center?
That's why I say that NONE means nothing.
 

LucaMs

Expert
Licensed User
Longtime User
Again, NONE means nothing.
Well, say it to Microsoft

In your case you should ask for anchor CENTER
That was an example. However in that example there isn't a View at center, but 3 views which "mantain proportional distances from the 4 edges".

If you use MS VS you can try and see how it works and what I mean.



b4a - central buttons with default anchoring (top-left)
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Anchors are simple and useful. They are not supposed to solve all problems. This is exactly why there is also a built-in designer script engine. You can easily implement such a layout with the designer script.
You can also set the minimum width and height with the designer script:
B4X:
'set min width
Button1.Width = Max(Button1.Width, 30dip)
'or
Button1.Width = Max(Button1.Width, Panel2.Width / 3)
'or
If ActivitySize < 5 Then mw = 30dip Else mw = 60dip
Button1.Width = Max(Button1.Width, mw)

For further discussions please start a new thread in the questions forum.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…