Hi,
you have two main ways to go about this:
- you either create the buttons on the fly and assign them specific ids, or string based events ( you can send event using a string, the action is SendEventByName)
this way you have a manager that knows what to show fore a given context, you can then properly set the button label, icon, etc etc.
- you have the buttons already present during editing, and they send each a predefined event, it's then up to a manager to catch these and depending on the context, forward the right event or do that right thing for this context.
you have then several variants in between, it depends how far you want to take dynamic buttons handling.
your array list of all buttons that you then activate/deactivate is ok, but could become cumbersome if you expect the number of buttons to grow as you develop further your project.
Bye,
Jean