I kinda have a handle on layouts and scripting for different screen sizes but I was wondering how this would work with views that are added in code.
There is no real good reason I can think of not to use Layouts for everything, except for views like the Table as this is not one of the built-in Views.
Say I arrange a few views on a screen using a layout and leave a scroll area where I will put a table in, the table I create purely in code and add it to Scroll.Panel, will it also adhere to the Autoscale setting I have set in a designer script?
Klaus - If I have some views added in the designer and scripted properly, and then add eg. a Table view in code, in what order should things happen with respect to:
it depends on what you mean with scripted properly.
You should not use AutoScale in the DesignerScripts.
In the Main module you should first load the layout(s) and then scale all views with ScaleAll:
.Loadlayout
ScaleAll(Activity, True)
The difference between ScaleAll and ScaleAllDS.
ScaleAllDS scales with the same equations like AutoScaleAll in the DesignerScripts.
ScaleAll scales with two scale factors one for each direction x and y.
You find a detailed explanation about the difference in chapter 8.10.3 AutoScale more advanced examples in the Beginner's Guide.
Thank you Klaus, your input (as well as the other guys on this forum) is just brilliant.
You say I shouldn't use AutoScale in the DS, should I still use the script for positioning views?
I'm thinking that after I LoadLayout, the views are not scaled (no AutoScale) but are positioned by the script, if I then call scale.ScaleAll surely this will mess with the postioning? By that I mean I would expect to need to do the order as follows:
What exactly do you want to do ?
Is pnlMain already scaled or not ?
If pnlMain is scaled you should scale only txt1 with ScaleView(txt1) and reposition it afterwards if necessary.
Because if pnlMain is scaled and you call ScaleAll(pnlMain, True) pnlMain will be rescaled and be wrong !