I have a Window that has an Enumeration: say enContext. It is commonly addressed and changed within the Window and exclusively “used” within the Window. But occasionally I want to be able to change its value elsewhere.
That Window comes in and out of existence during the use of the application.
Let’s say I want to maintain a Global value that is available to change in other parts of the application with other Windows open. If I return to the Window with the Enumeration, and I want to use the Global value to select a particular enContext value, what is the best way to do this?
I can imagine pulling the Enumeration outside of the Window entirely into a Module so it itself is Global but I resist this, perhaps stupidly. Perhaps I can use an Integer as a Global value that “matches” one of the Window’s enumeration values, but then it seems that using an Enumeration at all loses some of its value (Integers can take on any value outside the range of the Enumeration itself.)
Do any people more experienced with using Enumerations have a suggestion of how to handle this elegantly? What approach would they take?