Wish Allow grouping of custom view properties in Designer

Sandman

Expert
Licensed User
Longtime User
Some custom views contain a lot of custom properties, AS TextFieldAdvanced is an example of this:

1704287726365.png


It quickly becomes a bit overwhelming to navigate all the properties. It would be nice if one therefore could specify a group in the #DesignerProperty.

Perhaps using Group like this:
B4X:
#DesignerProperty: Group: Info, Key: Hint, DisplayName: Hint, FieldType: Boolean, DefaultValue: True
#DesignerProperty: Group: Info, Key: HintText, DisplayName: Hint Text, FieldType: String, DefaultValue: Hint

#DesignerProperty: Group: Counter, Key: Counter, DisplayName: Counter, FieldType: Boolean, DefaultValue: False, Description: If True a counter is visible on bottom right
#DesignerProperty: Group: Counter, Key: CounterMax, DisplayName: Counter Max, FieldType: Int, DefaultValue: 20, MinRange: 0, Description: 5/10

Which then would make the designer show it like this (use your imagination here :) ):
B4X:
> Custom Properties
    > Info
        Info          [x]
        Info Text     Informations
    > Counter
        Counter       [x]
        Counter Max   5


(Which then obviously also could be simplified thanks to the grouping:
B4X:
> Custom Properties
    > Info
        Enabled   [x]
        Text      Informations
    > Counter
        Enabled   [x]
        Max       5
)
 

Alexander Stolte

Expert
Licensed User
Longtime User
I would like that very much. With the xChart I'm always overwhelmed by all the properties in the designer...

 

klaus

Expert
Licensed User
Longtime User
I fully agree !
Yes, the xChart library has more than 90 properties.
Another wish would be to have a conditional display for properties depending on another one.
For example, in the xChart library there are different chart types, and there are properties specific to a given type.
When a give type is selected only the relevant properties for this chart type should be displayed.
But, I am afraid that this is more a dream rather than a wish.
 

Sandman

Expert
Licensed User
Longtime User
Another wish would be to have a conditional display for properties depending on another one.
If you post a separate wish I can hallucinate a solution for how the #DesignerProperty could support it. :)

(Unfortunately I have no idea how difficult it would be for Erel to dynamically modify the property list. But my gut feeling is that it wouldn't be the most difficult thing he solved with B4X.)
 

klaus

Expert
Licensed User
Longtime User
(Unfortunately I have no idea how difficult it would be for Erel to dynamically modify the property list. But my gut feeling is that it wouldn't be the most difficult thing he solved with B4X.)
That's why I have never asked for it even as a dream.
 

Filippo

Expert
Licensed User
Longtime User
For example, in the xChart library there are different chart types, and there are properties specific to a given type.
Hi Klaus,

Just an idea. You could split the library into different classes like the xchart-type, so that you have the right properties in advance for the selected class in the designer.
 

klaus

Expert
Licensed User
Longtime User
I am not sure if this would be a good solution.
The major part of the code and properties are common to all chart types.
Then, a part of the code and properties are common to several chart types but not all.
And finally, some code and properties are specific to a given chart type.
If a user needs one class for a line chart and another one for a bar chart he would have a lot of code twice.
The maintenance of these classes would become cumbersome.
Even, perhaps with one class with the common code would be more difficult to maintain.
The grouping of properties would already be a good improvement.
 

Alexander Stolte

Expert
Licensed User
Longtime User
If a user needs one class for a line chart and another one for a bar chart he would have a lot of code twice.
The maintenance of these classes would become cumbersome.
I did the whole thing in my AS_Scheduler library with a shared class that contains duplicate code. Together with the "#ModuleVisibility attribute" you can even hide this class for the end user.
 
Top