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
classes and demo in link
https://www.dropbox.com/s/xz6fumuwbdj3y8g/buttonBarv1.1.zip?dl=0
Attachments
Last edited: