Designer Scripts and SetLayout

rgately

Member
Licensed User
Longtime User
I wish that it were possible to use .SetLayout in Designer Scripts. It would make the code more compact, easier to read and easier to create from scratch than the other(longer) alternatives.

This is how I did it in Designer Scripts...
B4X:
pnlSpeechOptions.left=1%x : pnlSpeechOptions.top=2%y : lSpeechOptions.Width=98%x : pnlSpeechOptions.height=25%x

and this is how I'd like to do it...
B4X:
pnlSpeechOptions.SetLayout(1%x, 2%y, 98%x, 25%x)

I'm still at the early stage of figuring out how to use Designer Scripts - so hopefully I'm not missing something obvioius.
 

rgately

Member
Licensed User
Longtime User
Erel,

Thanks for suggesting that I use: SetLeftAndRight and SetTopAndBottom. I knew they were there, but I wanted to be able to write code in Designer Scripts that could be copied and used elsewhere in the program. The only properties that I found for setting the size and position that would run in both places is: left, top, width and height. I have a subroutine that checks orientation and runs the appropriate size/position code. The same code works in both the sub routine and Designer Scripts. I'm just not sure yet which place it will end up.

Whether the code is in Designer Script or in a subroutine, it still takes up a lot of screen space considering that I am setting the size and position of every view. The SetLayout takes up considerably less space and is easier to type. But I will get by and move ahead.


Here are a couple more issues with Designer Scripts that I noticed...

It appears that there is no horizontal scrollbar to let me move the text from left to right. Not having a scrollbar makes it difficult to get to the text that is off of the right or left side of the edit window.

Also, there appears to be no means of block commenting. It makes me want to do my coding in the main code window where I have more control.

Another problem I have with Designer Scripts is that it does not let me see portions of a panel that is extended below the Abstract Designer. If I cannot see the results when I press the Run Script button then it defeats its purpose and forces me to run the app in order to see the changes.
If I was not using Designer Scripts, I could specify a negative top value to raise the panel and adjust the views.

I still have much to learn about Designer Scripts, scaling, percentage and resolutions.

Thanks for a great product and great support
 
Last edited:

rgately

Member
Licensed User
Longtime User
Thanks for mentioning: "You can resize the abstract designer window."

I tried using SetTopAndBottom, SetRightAndLeft, HorizontalCenter, Etc. and like what they do. I was thinking that it would be useful if they were also properties on the Designer/Main tab/Properties list. I'd also like the properties made available for use in the code modules as well.

Am I right to assume that I should choose, one or the other, Abstract Designer or Designer Scripts for setting the size and position of the views? Because if I use Designer Scripts the Abstract Designer cannot be used for making changes because it is locked.

I would strongly prefer using the Abstract Designer versus Designer Scripts for doing my layout.


I'm still trying to wrap my head around Designer Scripts, Resolutions, Scale, Portrait/Landscape and Etc. and when I'm ready, I will post the more generalize questions in the proper questions forum.
 

zeuspower

Member
Licensed User
Longtime User
Ok ! I have my new laptop 64bit win7

installed the java jdk 7
installed the android sdk
set my JAVA_HOME enviroment variable
set the paths inside the IDE of b4a

but I am getting this :

B4X:
Compiling code.                         0.14
Compiling layouts code.                 0.06
Generating R file.                      0.12
Compiling generated Java code.          Error
javac 1.7.0_10
javac: file not found: src\o\ntoulapas_slide\designerscripts\*.java
Usage: javac <options> <source files>
use -help for a list of possible options

my app-code runs perfectly on my office pc -32bit win7

Whats wrong ?


(o ntoulapas is the name of my application,means a big bodybuilder body like a closet in Greek :D )
 
Top