The current on-size-fits-all uiBut creates quite a mess, where it's hard to
reason about which members are free for use, under which conditions they are
used and how. This tries to untangle that mess.
A draw-back is that many casts have to be done although this seems reasonable.
(I don't expect an in-depth review, but would like to have the general design
change reviewed first.)
A complication was that we sometimes change the button type after it's created.
So I had to add logic to reallocate the button for use with the new, possibly
derived struct. Ideally that wouldn't be needed, but for now that's what we have.
This is also something I'd like to have reviewed.
Part of T74432.