onActiveWindowChange :p

Hi All,

I have multiple non-modal windows open (each can have a different module of our application, employees, customers, etc) and jump between them.
When I click on a window I need to know that it became active.
We rely heavily on the knowledge of which module is currently selected and whenever the user opens a module a global variable is set accordingly. But that sort of design was implemented before multiple windows, so we could only have one module open at the same time. Now it’s many and I’m stuck.
How do I know that? onShow is not applicable here and I can’t really think of anything else :?

Cheers,
Maria

Servoy doesn’t have such an event, what would you do on that event? What kind of code should run?

jcompagner:
Servoy doesn’t have such an event, what would you do on that event? What kind of code should run?

Switching between windows in our application works like switching between the modules.
Say, one window contains a customer record (customer module), another has a job record (job module).
Some forms in both of these windows are based on the same parent and there’s code in it that relies on knowing what the current module is (maybe design can be changed, I’m just reluctant to do so because this approach is used in many-many places).
So when I open my customers window I set my global variable that stores the current module to ‘customers’. When I open jobs I set it to ‘jobs’.
But now that they both are open I need to set that variable whenever I switch between the windows.
Hope it makes it clear…

I guess I’ll have to change the way things work but anyway, is there an event to capture the change of the active window planned for implementation in future? I’m aware that ForPro has a capability to find out what window is currently on top, they have this function WONTOP(). So I thought there might be something similar in Servoy :D

Cheers,
Maria

servoy also can give you that, currentcontroller.getWindow()

jcompagner:
servoy also can give you that, currentcontroller.getWindow()

Yes, I guess I was half asleep when I posted the question :oops: but then figured it out :lol: