Wish Two Module Wishes

LWGShane

Well-Known Member
Licensed User
Longtime User
I would love to see the two abilities be added to the B4X lineup:

  1. Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog.
  2. Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules. I would also suggesting making this feature (if implemented) compatible with wish #1.
Thanks for the consideration.
 

LucaMs

Expert
Licensed User
Longtime User
Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules
It would be very useful to be able to create custom classes (or code modules) just as you can with projects.

An alternative would be to save a module/class with "Save As," thus having a duplicate (which, however, must then be loaded into the project).

(?) "Save as template" 😊
 

LucaMs

Expert
Licensed User
Longtime User
Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog.
Yes, it could be useful in some cases, especially with B4XPages.

But what bothers me is having to go through N menu items (the mouse cursor sometimes moves to the wrong item and you have to go back to the starting point); "many" missing buttons like this would be useful.
 

aeric

Expert
Licensed User
Longtime User
1. Code Snippets is useful especially use with template tag.
2. Reusable projects can also zip as Project Templates.
3. The project template and b4xlib can contain reusable classes.

These features eliminate copy and paste code.
 

LucaMs

Expert
Licensed User
Longtime User
1. Code Snippets is useful especially use with template tag.
2. Reusable projects can also zip as Project Templates.
3. The project template and b4xlib can contain reusable classes.

These features eliminate copy and paste code.
Direct, toolbar-accessible methods would be better in many ways, which I won't list here.

If it's complicated for Erel to add template class/module management, perhaps the following solution would be easier -PERHAPS - for him: implement drag-and-drop of files (classes/modules) from a folder to the IDE-project (the File tab currently accepts file drops).

You could then create a macro/comment to open your folder containing the template classes and...!
 

aeric

Expert
Licensed User
Longtime User
You could then create a macro/comment to open your folder containing the template classes and...!
If you put the code snippets inside a b4xlib then it is available by start typing "code".

If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab.

For me this is very convenient already.

Example, I have added WebController and ApiController classes in my web project template in the past.

Just not many B4X developers make use of these features.

 

LucaMs

Expert
Licensed User
Longtime User
If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab.

For me this is very convenient already.

1758004169893.png


I really like that one, but I don't understand how it works! 😳

If I use one of my project templates, will I have that menu item to add a class that is part of the project template to the current project? 😳



P.S. Mario, just try! 😁
 

LucaMs

Expert
Licensed User
Longtime User
You need to add the class with file extension .b4x_excluded
I'd forgotten about it, and most importantly, I think I've written several times that it would be useful to be able to create your own class templates, like for projects, but Erel never commented with something like:
"It's already possible"
(perhaps he didn't do it so as not to make me look bad!😄)

Perhaps, I repeat: perhaps, at the time I thought it was only for B4A (or maybe that was the case at the time, initially).


Thank you, @aeric
 

aeric

Expert
Licensed User
Longtime User
I'd forgotten about it,
Maybe you are not.
Actually I think this is not a documented or an official feature.
The concept was first introduced in jar library. One day I was curious and made my own experiment and it did work with b4xlib too.
My bad I didn't share this idea but it is one of the "hidden" ideas in my WebAPI Controller b4xlib as a "bonus" for who "followed" and test my libraries.
It just not obvious. :)

https://www.b4x.com/android/forum/threads/custom-class-templates.90550/
https://www.b4x.com/android/forum/threads/custom-class-templates-in-b4x.90552/#post-572445
 
Top