Wish Allowing Libraries to add custom Properties to be used in a CustomView in Designer

Discussion in 'Bugs & wishlist' started by DonManfred, Mar 22, 2015.

  1. DonManfred

    DonManfred Expert Licensed User

    Allowing Libraries to add custom Properties to be used in a CustomView in Designer
    In the last weeks i have wrapped some libraries. Some of them have their own Properties.
    I wish i could write a code in a library which will be called from the designer to get a list of properties.

    Possible Types of Properties i saw so far:
    - int
    - double
    - float
    - long
    - String
    - Color
    - fontsize
    - fontface
    - width
    - height
    - bitmap
    - image
    - drawable(s)

    It would be great if we, the librarydeveloper, could design properties of a new view which then all can be set in the designer
     
  2. DonManfred

    DonManfred Expert Licensed User

    After seeing the new great b4a ide and the "new designer" this wish came into my mind again.
    Everytime i do a wrapper i wish i could add additional properties to the designer :)
     
    MarcoRome and ArminKH like this.
  3. Cableguy

    Cableguy Expert Licensed User

  4. klaus

    klaus Expert Licensed User

    +1!
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    While v5.00 doesn't support this feature, the new designer was implemented in such a way that will make this feature much more feasible.
     
  6. Cableguy

    Cableguy Expert Licensed User

    So we can expect it for b4a v5.1???
     
    DonManfred likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    I didn't say that...
     
  8. Cableguy

    Cableguy Expert Licensed User

    Wishfull thinking... Still, B4a v5.0 makes a great birthday gift!
     
    RandomCoder likes this.
  9. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]

    [​IMG]

    These two images are from the next version of B4J. The same feature will also be added to B4A and B4i.
     
  10. DonManfred

    DonManfred Expert Licensed User

    WOOOOOOOOWWWW.... Great! I hardly can´t wait for the next release!

    EREL, you are the best! As always! :D

    PS: Time for some library-wrapper (me included ;)))to do updates for their wraps ;)
     
    Last edited: Jan 13, 2016
  11. Cableguy

    Cableguy Expert Licensed User

    Question: Will existing CustomViews automatically exhibit the custom properties in the designer or will they need to be exposed like the event is?
     
  12. DonManfred

    DonManfred Expert Licensed User

    Good question. I guess @Erel is building something new here. Somewhere in forum he wrote that B4J libraries are not able to use customviewwith designer support at this time and it will be changed in future.

    Now, seeing his answer here is guess it is much more than just the possibility to use customviews with designersupport...

    It must be more. I like this more; what ever it will be ;-)
     
    Cableguy likes this.
  13. Erel

    Erel Administrator Staff Member Licensed User

    Properties will not be added automatically. The view's developer needs to explicitly declare the custom properties.
     
    Cableguy, klaus and DonManfred like this.
  14. Erel

    Erel Administrator Staff Member Licensed User

    Another example, this time it is for a B4X class:

    [​IMG]

    [​IMG]


    The properties are declared like this:
    Code:
    #Event: DateChanged (NewDate As Long)
    #DesignerProperty: Key: CancelVisible, DisplayName: Cancel Visible, FieldType: Boolean, DefaultValue: True, Description: Whether the cancel button should be displayed.
    #DesignerProperty: Key: TodayVisible, DisplayName: Today Visible, FieldType: Boolean, DefaultValue: True
    #DesignerProperty: Key: Modal, DisplayName: Modal Window, FieldType: Boolean, DefaultValue: True, Whether the window should be modal.
    #DesignerProperty: Key: MinYear, DisplayName: Minimum Year, FieldType: Int, DefaultValue: 1970, MinRange: 0, MaxRange: 3000
    #DesignerProperty: Key: MaxYear, DisplayName: Maximum Year, FieldType: Int, DefaultValue: 2030, MinRange: 0, MaxRange: 3000
    #DesignerProperty: Key: FirstDay, DisplayName: First Day, FieldType: String, DefaultValue: Sunday, List: Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday, Description: Sets the first day of week.
    #DesignerProperty: Key: Title, DisplayName: Title, FieldType: String, DefaultValue: Select Date
    #DesignerProperty: Key: BackgroundColor, DisplayName: Background Color, FieldType: Color, DefaultValue: #FFCFDCDC
    #DesignerProperty: Key: SelectedColor, DisplayName: Selected Color, FieldType: Color, DefaultValue: 0xFF0BA29B
    #DesignerProperty: Key: HighlightedColor, DisplayName: Highlighted Color, FieldType: Color, DefaultValue: 0xFFABFFFB
    New class template:

    [​IMG]
     
  15. DonManfred

    DonManfred Expert Licensed User

    I get wet pants!
    That´s GREAT!
    I LOVE IT. :D
     
    MarcoRome, Peter Simpson and Erel like this.
  16. DonManfred

    DonManfred Expert Licensed User

    Should´nt it not be
    ?
     
  17. ArminKH

    ArminKH Well-Known Member

    wooooooooooooooooow thank u erel
    looks great ;)
    but it seems Custom Properties is accessible from B4A Classes only ! ?
    what is the implementation for java when we want to wrap a view?
    sorry i can't wait for next version :D
     
    Last edited: Jan 15, 2016
    DonManfred likes this.
  18. Erel

    Erel Administrator Staff Member Licensed User

    You are correct.

    They can also be added to Java libraries.
     
    ArminKH, lemonisdead and DonManfred like this.
  19. DonManfred

    DonManfred Expert Licensed User

    How can i use
    in a java-library?

    I guess there is now something new like the @commands? Maybe
    Code:
    @DesignerProperty(...)
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    That's true:

    [​IMG]
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice