zui
zui copied to clipboard
Checkbox groups
Changed my mind and implemented https://github.com/armory3d/armorpaint/pull/1349#issuecomment-1090383438. Implemented an AltExclusive behavior and an exclusive behavior (radio button). What did improve?
- The checkbox the user clicks on is automatically drawn correctly. This was not the case in my first approach.
- It is a bit more automated.
- It is much clearer and reusable.
- The implementation can be extended easily. For example a:
SelectAtLeastOnewould be easy to implement.
What's not perfect?
- The other checkboxes are only updated in the next frame.
- The code is not really shorter
- Checkboxes may return the wrong value because they are may be updated in
endGroup.
Consider https://github.com/armory3d/armorpaint/pull/1349/commits/45b8bdb677888bdc96dc4b01a08d2ea37e5b8ed1 to see it in action.