Question: I don't get callbacks from objects on secondary layers
I have a question about FV 3.3.1 R7 client editor created layers.
The behavior I am seeing is that I get the layer editor callbacks only for objects that are created on the layer handle that was passed to my editor when the client editor toolbar button was pressed.
If my editor subsequently creates additional layers, and places objects on those layers, I do NOT get TestSelected or Selected callbacks for those objects. I DO get OnSelect and the GetHelpText?, etc. callbacks.
It looks like my editor is not being associated with the layers I create. This almost would not be a problem except when objects are OnSelected, the drag parameter is not given, so I can't turn on drag and drop.
Perhaps I am having a fundamental misunderstanding of how layers are related to editors? I would have expected all of the objects on all of my layers to cause TestSelected and Selected callbacks to be invoked...
Am I missing something, or is this in fact the correct FV behavior?
Thank you,
[Name Witheld]
Environment
| FalconView Version: | unspecified |
| Interface: | |
| Language: |
-- ChrisBailey - 24 Jun 2008
Answer
The behavior you are seeing is correct. You are creating layers that are not associated with any editor mode. If you really need to do this, instead of using CreateLayer call CreateOverlay with the type = 1000 + your registered type. No other FalconView overlay, when created, spawns off other overlays.
In almost all cases an overlay should never create an instance of itself. This means CreateOverlay shouldn't be called from within your ILayerEditor implementation. An instance of your overlay is created automatically for you by the framework whenever the user does File
NT: Our JLOC application creates many layers and we have the same problem described above. If editors are not supposed to use more than one layer, why do we have the CreateLayer function at all? It would help if this kind of information was included in the interface documentation.
-- NigelThompson - 07 Jul 2008
The CreateLayer is there to be called from FalconView not to call on yourself. There are many times when you will have more than one overlay per editor, it is the equivalent of opening multiple drawing files or multiple point overlays. It is unusual for one editor to create multiple overlays automatically but you can do it (via CreateLayer as mentioned above).
-- ChrisBailey - 15 Jul 2008
