No Activation Event fired when clicking through open images
Hi there,
with several images open, I want to track which one is currently the active image. But McApplication.SelectedDataChanged only fires on deactivating an image (Flags parameter is always 255). The same happens with the McImage-Events. The Activate-Event doesn't fire, only the Deactivate-Event.
I want to automatically run code on the active image once the user has clicked into another image.
Thank you.
Regards,
Helga
with several images open, I want to track which one is currently the active image. But McApplication.SelectedDataChanged only fires on deactivating an image (Flags parameter is always 255). The same happens with the McImage-Events. The Activate-Event doesn't fire, only the Deactivate-Event.
Private Sub _application_SelectedDataChanged(Flags As MediaCy.IQL.Application.IMcData.DataTypes) Handles _application.SelectedDataChanged ' ONLY FIRES WHEN LEAVING AN IMAGE myImg = _application.ActiveImage Debug.Print(myImg.Name) End Sub Private Sub myImg_Deactivate(Image As McImage) Handles myImg.Deactivate 'FIRES ON LEAVING THE IMAGE Debug.Print(myImg.Name) End Sub Private Sub myImg_Activate(Image As McImage) Handles myImg.Activate 'NEVER FIRES Debug.Print(myImg.Name) End SubCan anyone direct me how to solve the problem.
I want to automatically run code on the active image once the user has clicked into another image.
Thank you.
Regards,
Helga
Tagged:
0
Best Answer
-
Hi Helga,
The myImg.Activate event is not fired, because myImg is set to the old image at that time.
You can also use McWindows.Activating event (from ThisApplication.Windows) http://projects.mediacy.com/help/html/Events_T_MediaCy_IQL_Application_McWindows.htm
You can get McImage from McWindow using Window.Document.Data property.
Yuri0
Answers