Java Question Creating advanced button properties in code, not designer.

Discussion in 'Libraries developers questions' started by Larry McQuerrey, Jun 3, 2015.

  1. Larry McQuerrey

    Larry McQuerrey New Member Licensed User

    There are many button properties that appear in the designer that do not appear when creating a button in code. How can I make those properties available with code?
     
  2. DonManfred

    DonManfred Expert Licensed User

    what exactly you are missing?
     
  3. Larry McQuerrey

    Larry McQuerrey New Member Licensed User

    Drawable,EnableDraable,Corner Radius, Border Color, Border Width, etc.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You have posted the question in the java forum. Are you asking about B4A code or library code?
     
  5. DonManfred

    DonManfred Expert Licensed User

    I think he is asking about B4A code when adding a button by code
     
  6. Larry McQuerrey

    Larry McQuerrey New Member Licensed User

    How can I create in BRA code all of the button properties that appear in the B4A design?
     
  7. DonManfred

    DonManfred Expert Licensed User

    The productname is B4A
     
  8. Troberg

    Troberg Well-Known Member Licensed User

    Those properties are mostly part of some object that, in turn, is a property. For example, CornerRadius is a property of the Drawable.

    However, some properties available in the designer scripts are not available elsewhere (Right, Bottom, HorizontalCenter(?), VerticalCenter(?) and so on). That's a Little sad, as they are quite useful. Sure, they are easy to produce from Left and Width et cetera, but for pure code readaility, I would very much prefer if they were available in code as well. Once you start moving things around in code, you tend to get long lines, which would be much neater if those properties existed.
     
  9. Larry McQuerrey

    Larry McQuerrey New Member Licensed User

    Thank you Troberg. It appears as you can read past a typo in the product name. Manfred must have been an English teach in his last life.

    Larry
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    The anchors feature as well as the designer scripts, are based on the visual designer engine. So they can only be used when the layout file is loaded.
     
  11. Troberg

    Troberg Well-Known Member Licensed User

    Would it be possible to extend the views with those properties in code as well? It would, of course, be two different implementations under the hood, but, on the outside, they would look the same.

    Now, I'm not talking about anchors, just the Right, Bottom and Center.
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Yes, these properties can be added. Please post it in the wishlist forum.
     
    Troberg likes this.
  13. Troberg

    Troberg Well-Known Member Licensed User

    I've already done it a while ago, so I won't doublepost.
     
Loading...