- Jun 6, 2020
- 11,559
- 4,422
The soon to be released versions of B4A, B4i and B4J include a new feature named: designer script extensions. The new feature allows calling B4X code from the visual designer scripts.
Note that the B4X code is not executed at design time.
I believe that over time this new feature, with a supportive framework, will change the way we manage complex layouts.
Q: Which subs can be called from the designer script?
1. Subs in classes.
2. The subs signature must be a single DesignerArgs parameter. Example:
B4X:
Calling this method from the script (class name is DDD):
B4X:
As you can see, the script call can include any number of parameters. The DesignerArgs object will hold all the parameters, as well as other useful information about the layout.
Q: How is the class instance created?
It depends...
Note that the B4X code is not executed at design time.
I believe that over time this new feature, with a supportive framework, will change the way we manage complex layouts.
Q: Which subs can be called from the designer script?
1. Subs in classes.
2. The subs signature must be a single DesignerArgs parameter. Example:
B4X:
کد:
محتوای بلوک کدها در دسترس شما نیست. برای مشاهده بلوک کدها، وارد انجمن شوید یاثبت نام کنید
B4X:
DDD.AddClass("small button", Button1, Button3)
As you can see, the script call can include any number of parameters. The DesignerArgs object will hold all the parameters, as well as other useful information about the layout.
Q: How is the class instance created?
It depends...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید