Designer scripts

duneplodder

Active Member
Licensed User
Longtime User
I was delighted to see the new Designer Scripts in the Designer.

I'm trying to add a script to an existing project but it is proving a very slow process. I am working on a default 320 x 480 screen.

For example: I go into main Designer properties & from the drop down list box I select txData1. The left value is 110. I calculate that this is 110/320 x 100=34%
I switch to the Designer Scripts tab and enter txtData1.left=34%x
I then go back into Designer properties but it has defaulted to Activity, so I have to go into the drop down list then scroll down to txData1 to look for the txtData1.top value.
And so on.

Am I missing something?
It would be nice if all the properties for each view could be easily copied into the scripts tab to reduce all the switching backwards and forwards.
Better still would be the ability to enter %x & %y directly into Designer properties.

Also is it possible to calculate values within the script? I tried
tmp=txtData1.width/320
txtData1.width=tmp%x
but tmp%x was "not a valid identifier".

Any thoughts?
Thank you,
Robert
 

rfresh

Well-Known Member
Licensed User
Longtime User
You don't have to keep switching back and forth between the Abstract Designer screen and the Designer Scripts window. Do everything in the Designer Scripts window. Add your code there and press F5 to see the immediate effect. Then you can adjust your code and F5 again...repeat this cycle until the emulator or device screen is what you want.

Don't use the Abstract Designer screen to judge your component placement even tho they do move when you press F5. Start up an emulator or if you have the actual target device, connect to it via USB or Bluetooth or the Bridge. In the Designer connect to the device from the Tools menu.

You'll find using the new Designer Scripts is a lot faster to develop your screens with compared to B4A 1.8. There is some improvement tweaking Erel can do with this and many have made their suggestions/recommendations. The next version of the Designer Scripts should really be awesome!

There is a bug currently where by if you have code in the lower Designer Scripts window, you must have at least one line of code in the top window. It can be code that gets changed in the lower window (that's how I do it) but as long as it's in the top window, that's all that matters.
 
Last edited:
Upvote 0

duneplodder

Active Member
Licensed User
Longtime User
Hi rfresh,

All valid points for future projects, my problem is that at the moment I am trying to add scripts to existing projects where I've already spent a lot of time positioning views.
 
Upvote 0
Top