Hi there! B4a is the best work I've seen made in recent years ... really congratulations! the designer, then, is an excellent tool ...
But I'd be a little more "open" to the developers ... in particular I like to create views, but put them inside the activity becomes less friendly ...
want to say that I develop in B4a by 4 days ... and I'm already in love with this wonderful tool (I have almost finished developing my first component)
The smartest thing that could be done would be to add an annotation java (eclipse)-side to mark the view as a "component" for the designer (may be listed in a sub menu in the menu "add view > custom views") , another annotation to mark properties and its read and write methods for the properties window, and can be used @Events annotation to define custom events for "generate members" menu item ...
Something like this:
or, alternatively or together, a standard view called "placeholder" that included into "add view" menu allowing to define the "dimensions" and "relations with the screen and the other view" of the custom view that will replace it.
I already do this using a panel as a placeholder and replace it at runtime with this code B4a:
though so I omit the z-order (but in this case I do not need)
while it would be nice to have a method of activity like this:
where plhButton is the name of the placeholder that must be replaced from the button, and myButton is the name of the button.
Obviously the above method should preserve all the spatial properties defined for the placeholder, including the z-order
Well ... clearly the first option would allow the development B4a-side much more friendly (allowing you to place the actual view without adding more code and defining at the same time both the properties that the events) ...
but I realize that the work be done to achieve it is much more than the second solution (although I would like to see them both made)
is also true that accomplished that, the designer would be the best tool of all time!
however ... congratulations for your work! :sign0098:
But I'd be a little more "open" to the developers ... in particular I like to create views, but put them inside the activity becomes less friendly ...
want to say that I develop in B4a by 4 days ... and I'm already in love with this wonderful tool (I have almost finished developing my first component)
The smartest thing that could be done would be to add an annotation java (eclipse)-side to mark the view as a "component" for the designer (may be listed in a sub menu in the menu "add view > custom views") , another annotation to mark properties and its read and write methods for the properties window, and can be used @Events annotation to define custom events for "generate members" menu item ...
Something like this:
B4X:
@ShortName("myComponent") // existing
@Events(values={ myEvent(x as Int) }) // existing
@Version(1.0f) // existing
@IsDesignerComponent (true) // or something like this
@Properties(values={ { propName, readPropMethod, writePropMethod }, { readonlyProp, readReadonlyPropMethod, null } } ) // or something like this
public class myComponent extends ViewWrapper<...> implements ...
{
public <type> readPropMethod()
{
return ...
}
public void writePropMethod(<type> value)
{
...
}
public <type> readReadonlyPropMethod()
{
return ...
}
...
}
I already do this using a panel as a placeholder and replace it at runtime with this code B4a:
B4X:
' into b4a Activity_Create
Activity.AddView(myComponent, pnlPlaceholder.Left, pnlPlaceholder.Top, pnlPlaceholder.Width, pnlPlaceholder.Height)
pnlPlaceholder.RemoveView
while it would be nice to have a method of activity like this:
B4X:
' b4a code
Activity.replacePlaceholder (plhButton, myButton)
where plhButton is the name of the placeholder that must be replaced from the button, and myButton is the name of the button.
Obviously the above method should preserve all the spatial properties defined for the placeholder, including the z-order
Well ... clearly the first option would allow the development B4a-side much more friendly (allowing you to place the actual view without adding more code and defining at the same time both the properties that the events) ...
but I realize that the work be done to achieve it is much more than the second solution (although I would like to see them both made)
is also true that accomplished that, the designer would be the best tool of all time!
however ... congratulations for your work! :sign0098: