Screenshots of the upcoming "designer scripts" feature

Erel

B4X founder
Staff member
Licensed User
The next version will include a new feature named "designer scripts".

This is really a new feature. I'm not familiar with any IDE (Visual Studio, Eclipse, etc...) that includes such a feature.

The visual designer includes two modes: regular mode and script mode.
In script mode the visual designer allows you to write code and immediately see the results on both the abstract designer and the emulator / connected device (there is no need to compile your application and reinstall it).

The idea is to create the "rough" layout with the visual designer and then add the "fine tunings" with the more powerful and flexible script code.

The script engine is quite simple however it well serves its purpose to allow you to easily adjust the layout.

The abstract designer together with the scripts engine allow you to easily and quickly test your layout on different screens and resolutions.


Another advantage of this feature is better separation between the UI code / design and the logic code.

When the program is compiled the scripts are compiled together with the rest of the program.

I will write more about this new feature before the release.

Just to demonstrate it, lets assume that we want to build a layout with an EditText and two buttons at the bottom of the screen. The buttons are attached to the right side and the EditText view fills the entire available width.

The first screenshot shows the "rough" layout on a Galaxy Nexus and the standard phone layout:

SS-2012-03-01_17.27.41.png


In the second screenshot the designer is in "script mode":

SS-2012-03-01_17.47.51.png


You can see that the views are now located in exactly the correct position. We can choose different layouts in the abstract designer and immediately see how our layout will look on other screens.
 

salmander

Active Member
Licensed User
awsumm....thanks Erel.
Just a question, not related to the thread but regarding next release.
can you make B4A to support Mac OSX please?
 
Upvote 0

thedesolatesoul

Expert
Licensed User
This is brilliant.
This is exactly how I code my layouts, but now I will be able to see the results immediately on different screen resolutions.
So now it is possible to anchor your views to any side.
Do you have something like Align, in which you set one view, and align the remaining views to the first one, for e.g. AlignLefts(View1, View2).
And also something to create a list of views going downwards for e.g.
SetTops(View1, View2, View3, Gap) so all views are placed with the same left/right alignments and their Tops are separated by a gap.
Regardless, this is already useful as I can remove all my GUI code from the activities.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Do you have something like Align, in which you set one view, and align the remaining views to the first one, for e.g. AlignLefts(View1, View2).
This can be done easily with:
B4X:
Button1.Left = Button2.Left

SetTops(View1, View2, View3, Gap) so all views are placed with the same left/right alignments and their Tops are separated by a gap.
This is an interesting idea.

can you make B4A to support Mac OSX please?
It will not be in the next version. I do hope to eventually add support for Mac and Linux. However it more or less requires a full rewrite.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
You are right Erel. Infact the use of Right and Bottom will be very useful otherwise I always had to set the Left by
B4X:
v.Left = 100%x - v.Width- 1dip
Also, SetLeftAndRight is a godsend. You may want also SetTopAndBottom too.

I was just thinking out in VB6 terms, when I used to Align controls, or set the width/height by selecting them all, and from the menu: Make same Width, or Align Lefts. So it just helps in setting all the properties in one line.

I know Android probably doesnt expose Right and Bottom, but they could be helpful in building dynamic layouts during runtime as well.

okay...dont want to delay your release with more wishes ;)

thanks!
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Awesome! What happens with our current projects? will the scripts section just be empty or will the code transfer over?

Sent from my DROIDX
 
Upvote 0

Theera

Well-Known Member
Licensed User
It means that the new feather "designer scripts",It make our easily change size of application fit for vary size of device?

Best Regards
Theera
 
Last edited:
Upvote 0

rbsoft

Active Member
Licensed User
Great feature!

Rolf
 
Upvote 0

corwin42

Expert
Licensed User
This looks great.

Just a few questions:

1. Is it possible to change other properties of views like the visibility? So it would be possible to hide some controls for smartphone size layouts an display them on tablets? This would be very nice.

2. I think this won't work with homescreen widgets. For better support of different screen sizes in widgets do you still have the first wish from this thread on your todo list? I think it shouldn't be too hard to implement.

And the most important question: When do you expect the first beta to be released. :)
 
Last edited:
Upvote 0

JohnK

Active Member
Licensed User
In another threaad you said that you were also solving the Z-Order from another angle, and I think it was this feature:
Erel said:
Next version will include a new feature named "designer scripts". It actually tries to solve the same problem in an opposite way.

It will allow you to add (simple) code to the layout file. The advantage of this code is that you can immediately see the results in the abstract designer and WYSIWYG designer (emulator / device). You will not need to compile and install the application after each change.
I do not see how this will solve the Z-Order issue? The code would appear to operate after the designed has added the views.

I am pretty new to Basic4Android. Is there a location that you publish projected release dates, and what you are planning to include in the next release?
 
Upvote 0
Top