What "Can" be done in a Designer Script...

Gary Miyakawa

Active Member
Licensed User
Longtime User
I'm working/learning designer scripting. It's pretty much doing what I expected (once I figured out that you need to resize BEFORE you try to position) :sign0161:

My question is about what instruction set can be used in a script. I put an If statement in it and it "sort" of did something but not exactly what I expected....

I know we have variables AND you can do limited math on those variables (which isn't documented from what I can find)...

I guess my question is, What else can we do ? I'd love to have an IF in there so I could capture the width and limit how wide it could be.. I realize this can (and maybe should) be done as an activity but I'm just wondered.

Cheers,

Gary M
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
The available methods are listed here: Designer Scripts Tutorial

Conditions are currently not supported. In some cases you can use the variants scripts instead.

Since conditions (IF clause) is not available, how can I solve the following problem:

I have a layout that is based on 2 panels, side by side, with almost 50%x for each.

When it is landscape there is room for it, and the corrections for the size are done greatly for the designer script.

HOWEVER, when the tablet is changed to portrait the width is not enough to room both panels side by side and keep the layout showing ok.

If i could have an IF clause i could do something like "if width < 400" and make the second panel be placed on the botton of the other, changing to a layout were the 2 panels are on top of the other. The rest of the adjustment, that goes over the elements that are children of the panels use the standard designer script

What should i do in this case?

Thanks, Eduardo
 
Upvote 0

MrRey

Member
Licensed User
Longtime User
For that, it sounds like you would need to alter layout upon change in orientation. I'm not on my PC at the moment but there are various threads about layout & orientation issues.
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Take a look at the attached sample.

Many thanks for the example! It is exactly what I mean about the positioning of the panels.

I took a look and understood what you mean, on how to proceed.

I was wondering how to do that without the need to have specific design scripts.

My question now, considering your example, how is going to fit other sizes, if i have 3 layout variants?

I am new on these stuff, so I believe there is out there many other layout variants, but I only can test in 3 differents commonly and expect that the script makes the magic to adapt to others. Considering your example that represent the main layout variants, how is handled by b4a when load the layout and the device is little different?

Thanks again.
 
Upvote 0
Top