B4A Class ButtonBar

Discussion in 'Additional libraries, classes and official updates' started by tremara1, Apr 14, 2015.

  1. tremara1

    tremara1 Active Member Licensed User

    I am not sure if b4a has a buttonBar or not but I made this one. I have found using radiobuttons a bit of a chore and they tend to use a bit of screen real estate along with the handlers required. This custom control consists of as many buttons as you need for making a unique selection. There is also a "clr" button to reset all the buttons to enabled state. The selected button changes color and shrinks to indicate selection. The text of the buttons resizes as required. I struggled a little how to set the number of buttons so I used the tag value of the custom view when added to the designer to hold the number of buttons (the more buttons you have might restrict the amount of space you have for text...see demo). I have added properties to change the border color (you can also make the border transparent) and the button state colors for enabled, pressed, disabled. You can also set text of buttons, text color which can be different for each button or same for all using 99 in the call. Also a setEvent for the click event. I have demo'd some of them in the example. This control can be used for selecting options or performing actual tasks. I have commented quite a lot, and the demo is also commented. This custom view requires Rsize and rndButton classses which I did a while ago they are in the demo.Forgot to say
    classes and demo in link

    https://www.dropbox.com/s/xz6fumuwbdj3y8g/buttonBarv1.1.zip?dl=0





     

    Attached Files:

    Last edited: Apr 15, 2015
    paragkini, cimperia, iz0ndg and 3 others like this.
  2. tremara1

    tremara1 Active Member Licensed User

    I have updated with a version with no clear button. Also it now sets the textsize of buttons to the smallest size so all text are all the same size.
    I have updated the link above.....
     
  3. mshafiee110

    mshafiee110 Active Member Licensed User

    hi @tremara1 can you upload again this class.
    because the file has been moved or deleted.
     
  4. tremara1

    tremara1 Active Member Licensed User

  5. mshafiee110

    mshafiee110 Active Member Licensed User

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